:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #1e293b;
    --accent-color: #10b981;
    --error-color: #ef4444;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(239, 68, 68, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
}

.app-container {
    max-width: 800px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

header {
    text-align: center;
    animation: fadeInDown 0.8s ease-out;
}

header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

header h1 span {
    color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    font-size: 1.1rem;
    color: #94a3b8;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
}

.controls-card {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: space-between;
    align-items: center;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #cbd5e1;
}

select {
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: 1px solid var(--glass-border);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

select:focus {
    border-color: var(--primary-color);
}

.options-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 0.75rem;
}

.toggle input {
    display: none;
}

.slider {
    width: 44px;
    height: 24px;
    background-color: #475569;
    border-radius: 34px;
    position: relative;
    transition: background-color 0.3s;
}

.slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle input:checked + .slider {
    background-color: var(--primary-color);
}

.toggle input:checked + .slider::before {
    transform: translateX(20px);
}

.label-text {
    font-size: 0.95rem;
    user-select: none;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

textarea {
    width: 100%;
    min-height: 120px;
    background-color: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    border-radius: 8px;
    padding: 1rem;
    font-family: inherit;
    font-size: 1.1rem;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
}

.primary-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.secondary-btn {
    background-color: transparent;
    color: var(--text-color);
    border: 1px solid var(--glass-border);
}

.secondary-btn:hover {
    background-color: var(--secondary-color);
}

.result-section {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.result-section.hidden {
    display: none;
}

.result-section.success #result-title {
    color: var(--accent-color);
}

.result-section.error #result-title {
    color: var(--error-color);
}

#result-title {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

#result-message {
    font-size: 1.1rem;
    color: #e2e8f0;
}

.missing-letters {
    margin-top: 1rem;
    width: 100%;
}

.missing-letters h3 {
    font-size: 1rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

#missing-letters-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.letter-badge {
    background-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
}

.history-section h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
}

#history-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-item {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.history-item:hover {
    background: rgba(15, 23, 42, 0.6);
}

.history-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 1rem;
    font-size: 1rem;
}

.history-status {
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.status-success {
    background-color: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.status-error {
    background-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.history-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.3rem;
    border-radius: 4px;
    transition: background-color 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.copy-btn {
    color: #cbd5e1;
}

.share-btn {
    color: var(--primary-color);
}

.delete-btn {
    color: #94a3b8;
    margin-left: 0.5rem;
}

.delete-btn:hover {
    color: var(--error-color);
    background-color: rgba(239, 68, 68, 0.1);
}

footer {
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
    margin-top: auto;
    padding-top: 2rem;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.pop-in {
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* SEO Section & Ratings */
.seo-section {
    margin-top: 1rem;
    line-height: 1.6;
}

.seo-section h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.seo-section h3 {
    font-size: 1.4rem;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    color: var(--accent-color);
}

.seo-section p {
    margin-bottom: 1rem;
    color: #cbd5e1;
}

.seo-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.example-card {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--glass-border);
    padding: 1.2rem;
    border-radius: 8px;
}

.example-card h4 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    color: #f8fafc;
}

.example-card blockquote {
    font-style: italic;
    color: #94a3b8;
    border-left: 3px solid var(--primary-color);
    padding-left: 0.8rem;
    margin-bottom: 0.8rem;
}

.rating-widget {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 2rem;
    text-align: center;
}

.rating-widget h3 {
    margin-top: 0;
}

.rating-stats {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 1rem;
}

.stars {
    display: inline-flex;
    flex-direction: row;
    font-size: 2.5rem;
    color: #475569;
    cursor: pointer;
    gap: 0.2rem;
}

.stars span {
    transition: color 0.2s, transform 0.2s;
}

.stars span.active,
.stars span:hover {
    color: #fbbf24;
    transform: scale(1.1);
}

.stars.voted span {
    cursor: default;
}

.stars.voted span:hover {
    transform: none;
}

.rating-feedback {
    margin-top: 1rem;
    font-weight: 600;
    color: var(--accent-color);
    min-height: 1.5em;
}

/* EEAT Card */
.eeat-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 1rem;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
    border-left: 4px solid var(--accent-color);
}

.eeat-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
}

.eeat-avatar img {
    border-radius: 50%;
    border: 2px solid var(--glass-border);
    background-color: var(--secondary-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.eeat-info h3 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-size: 1.3rem;
}

.eeat-info p {
    color: #cbd5e1;
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

.eeat-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.eeat-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.eeat-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.eeat-action {
    display: flex;
    justify-content: flex-end;
}

.contact-btn {
    text-decoration: none;
    display: inline-block;
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
    z-index: 9999;
    padding: 1.5rem;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.4s ease-in-out;
}

.cookie-banner.hidden {
    transform: translateY(100%);
}

.cookie-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.cookie-content p {
    flex: 1;
    min-width: 280px;
    font-size: 0.95rem;
    color: #e2e8f0;
    line-height: 1.5;
}

.cookie-actions {
    display: flex;
    gap: 1rem;
    white-space: nowrap;
}

/* Responsiveness */
@media (max-width: 640px) {
    .eeat-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .eeat-content {
        flex-direction: column;
        align-items: flex-start;
    }
    .eeat-action {
        width: 100%;
        justify-content: stretch;
    }
    .contact-btn {
        width: 100%;
        text-align: center;
    }
    header h1 {
        font-size: 2.2rem;
    }
    .controls-card {
        flex-direction: column;
        align-items: stretch;
    }
    .actions {
        flex-direction: column;
    }
}
