/* ===== LEXUP PREMIUM DICTIONARY SYSTEM CSS ===== */

*, *::before, *::after {
    box-sizing: border-box;
}

a {
    text-decoration: none !important;
}


:root {
    --bg-dark: #0b0f19;
    --bg-card: rgba(20, 30, 45, 0.7);
    --border-light: rgba(126, 168, 255, 0.09);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: rgba(148, 163, 184, 0.5);
    
    /* CEFR Colors */
    --cefr-a: #10b981;
    --cefr-b: #3b82f6;
    --cefr-c: #8b5cf6;
    
    /* Accents */
    --accent-blue: #7ea8ff;
    --accent-blue-gradient: linear-gradient(135deg, #5b7fd6, #7ea8ff);
    --accent-success: #10b981;
    --accent-danger: #ef4444;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== GLOWING MESH BACKDROP ===== */
.bg-glow-wrapper {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-glow-orb-1 {
    position: absolute;
    top: -15%;
    left: 20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
    filter: blur(80px);
}

.bg-glow-orb-2 {
    position: absolute;
    bottom: -10%;
    right: 10%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
    filter: blur(100px);
}

/* ===== DICTIONARY LAYOUT ===== */
.dict-main {
    position: relative;
    z-index: 5;
    padding-top: 100px;
    padding-bottom: 80px;
}

.dict-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== PREMIUM WORD DETAILS CARD ===== */
.word-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: 28px;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    margin-bottom: 32px;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.word-card:hover {
    border-color: rgba(126, 168, 255, 0.18);
}

/* Word Header block */
.word-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 24px;
    margin-bottom: 28px;
}

.word-title-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.word-title {
    font-size: clamp(40px, 6vw, 58px);
    font-weight: 900;
    letter-spacing: -0.035em;
    background: linear-gradient(135deg, #ffffff 20%, #e2ecff 60%, #a8c8ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    line-height: 1.1;
}

.word-phonetic {
    font-size: 15px;
    color: rgba(180, 195, 220, 0.7);
    font-weight: 400;
    letter-spacing: 0.04em;
    font-style: italic;
}

.word-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 2px;
}

/* Translation inline badge */
.translation-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: rgba(200, 210, 230, 0.85);
    font-weight: 500;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.translation-badge .trans-flag {
    font-size: 15px;
    line-height: 1;
}

.translation-badge .trans-word {
    font-weight: 600;
    color: rgba(230, 240, 255, 0.9);
}

/* Speaker & Translation Control Area */
.word-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
}

.control-btn:hover {
    background: rgba(126, 168, 255, 0.1);
    border-color: rgba(126, 168, 255, 0.35);
    color: var(--accent-blue);
    transform: scale(1.08);
}

.control-btn.speaking {
    background: rgba(126, 168, 255, 0.15);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    animation: pulse-speak 1s ease-in-out infinite;
}

@keyframes pulse-speak {
    0%, 100% { box-shadow: 0 0 0 0 rgba(126, 168, 255, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(126, 168, 255, 0); }
}

.control-btn .tooltip {
    visibility: hidden;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #152033;
    color: #fff;
    text-align: center;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    border: 1px solid var(--border-light);
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 100;
    pointer-events: none;
}

.control-btn:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

/* CEFR badges - compact pill */
.cefr-badge {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.4;
}

.cefr-badge.level-a {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.cefr-badge.level-b {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.cefr-badge.level-c {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

/* Content block styling */
.content-section {
    margin-bottom: 32px;
}

.content-section:last-child {
    margin-bottom: 0;
}

.section-label {
    font-size: 11px;
    font-weight: 800;
    color: var(--accent-blue);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.definition-text {
    font-size: 17px;
    color: #f1f5f9;
    line-height: 1.7;
    margin: 0;
}

/* Examples list */
.examples-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.example-item {
    font-size: 14.5px;
    color: rgba(241, 245, 249, 0.75);
    font-style: italic;
    line-height: 1.6;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.015);
    border-left: 3px solid var(--accent-blue);
    border-radius: 0 16px 16px 0;
    position: relative;
}

.example-item strong {
    font-style: normal;
    color: #ffffff;
    font-weight: 700;
    background: rgba(126, 168, 255, 0.08);
    padding: 1px 4px;
    border-radius: 4px;
}

/* ===== QUIZ BLOCK ===== */
.quiz-card {
    background: rgba(126, 168, 255, 0.02);
    border: 1px dashed rgba(126, 168, 255, 0.2);
    border-radius: 20px;
    padding: 24px;
    margin-top: 36px;
    position: relative;
    overflow: hidden;
}

.quiz-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.quiz-badge {
    background: rgba(139, 92, 246, 0.15);
    color: #c084fc;
    border: 1px solid rgba(139, 92, 246, 0.3);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 3px 8px;
    border-radius: 6px;
}

.quiz-question {
    font-size: 15.5px;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 20px;
}

.quiz-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (max-width: 600px) {
    .quiz-options {
        grid-template-columns: 1fr;
    }
}

.quiz-opt-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    color: var(--text-secondary);
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-opt-btn:hover {
    background: rgba(126, 168, 255, 0.05);
    border-color: rgba(126, 168, 255, 0.2);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.quiz-opt-btn.correct {
    background: rgba(16, 185, 129, 0.12) !important;
    border-color: var(--accent-success) !important;
    color: #fff !important;
}

.quiz-opt-btn.wrong {
    background: rgba(239, 44, 44, 0.12) !important;
    border-color: var(--accent-danger) !important;
    color: #fff !important;
}

.quiz-feedback {
    margin-top: 16px;
    font-size: 13.5px;
    font-weight: 600;
    display: none;
    align-items: center;
    gap: 8px;
}

.quiz-feedback.success {
    color: var(--accent-success);
}

.quiz-feedback.error {
    color: var(--accent-danger);
}

/* ===== APP DOWNLOAD CTA BANNER ===== */
.app-cta-banner {
    background: linear-gradient(160deg, #101a2b, #19273f);
    border: 1px solid rgba(126, 168, 255, 0.14);
    border-radius: 28px;
    padding: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-top: 48px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
}

.app-cta-banner::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(91, 127, 214, 0.15), transparent 70%);
}

.app-cta-title {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 8px;
}

.app-cta-subtitle {
    font-size: 14.5px;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto 24px;
}

.app-cta-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.cta-store-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: var(--accent-blue-gradient);
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(91, 127, 214, 0.2);
}

.cta-store-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(91, 127, 214, 0.35);
    color: #fff;
}

.cta-store-btn.apple-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.cta-store-btn.apple-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ===== DICTIONARY HOME / DIRECTORY SEARCH VIEW ===== */
.dict-home-title {
    text-align: center;
    font-size: clamp(32px, 6vw, 44px);
    font-weight: 900;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #ffffff 40%, #7ea8ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dict-home-desc {
    text-align: center;
    color: var(--text-secondary);
    max-width: 550px;
    margin: 0 auto 36px;
    font-size: 15.5px;
}

/* Search bar styling */
.search-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto 48px;
    z-index: 50;
}

.search-bar-input {
    width: 100%;
    background: rgba(24, 33, 44, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(126, 168, 255, 0.15);
    border-radius: 18px;
    padding: 16px 20px 16px 52px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.search-bar-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 10px 35px rgba(126, 168, 255, 0.2);
}

.search-icon-svg {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    transition: color 0.3s;
}

.search-bar-input:focus + .search-icon-svg {
    color: var(--accent-blue);
}

/* Suggestion dropdown overlay */
.suggest-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(15, 23, 32, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    max-height: 330px;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
    display: none;
    z-index: 100;
}

.suggest-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.suggest-item:last-child {
    border-bottom: none;
}

.suggest-item:hover {
    background: rgba(126, 168, 255, 0.08);
}

.suggest-word {
    font-weight: 600;
    font-size: 15px;
    color: #fff;
}

.suggest-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.suggest-level {
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 4px;
    color: #fff;
    text-transform: uppercase;
}

.suggest-level.a { background: var(--cefr-a); }
.suggest-level.b { background: var(--cefr-b); }
.suggest-level.c { background: var(--cefr-c); }

/* A-Z Index Directory block */
.az-directory-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    text-align: center;
    margin-bottom: 24px;
}

.az-index-list {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    max-width: 700px;
    margin: 0 auto 52px;
}

.az-letter-link {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.2s ease;
    cursor: pointer;
}

.az-letter-link:hover {
    background: var(--accent-blue-gradient);
    border-color: transparent;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(91, 127, 214, 0.25);
}

.az-letter-link.active {
    background: var(--accent-blue-gradient);
    border-color: transparent;
    color: #fff;
}

/* Word listings from alphabet directories */
.words-grid-wrapper {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.alphabet-header {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 10px;
}

.words-column-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .words-column-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .words-column-grid {
        grid-template-columns: 1fr;
    }
}

.grid-word-item {
    font-size: 14.5px;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.grid-word-item:hover {
    color: var(--accent-blue);
    background: rgba(126, 168, 255, 0.04);
    border-color: rgba(126, 168, 255, 0.15);
}

.grid-word-level {
    font-size: 9px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 3px;
    color: #fff;
}

.grid-word-level.a { background: var(--cefr-a); }
.grid-word-level.b { background: var(--cefr-b); }
.grid-word-level.c { background: var(--cefr-c); }

/* BREADCRUMB STYLING */
.dict-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.dict-breadcrumb a {
    color: var(--text-secondary);
    transition: color 0.2s;
}

.dict-breadcrumb a:hover {
    color: var(--accent-blue);
}

.dict-breadcrumb-sep {
    color: var(--text-muted);
}

/* PENDING DEFINITION CARD */
.pending-definition-card {
    display: flex;
    gap: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(126, 168, 255, 0.08);
    border-radius: 16px;
    padding: 24px;
    margin-top: 12px;
    align-items: flex-start;
}

.pending-icon {
    background: rgba(126, 168, 255, 0.1);
    color: #7ea8ff;
    padding: 10px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pending-content h3 {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.pending-content p {
    margin: 0;
    font-size: 14.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}

@media (max-width: 576px) {
    .pending-definition-card {
        flex-direction: column;
        gap: 14px;
        padding: 20px;
    }
}

/* LANGUAGE SELECTOR STYLING */
.lang-select-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 0 14px 0 32px;
    height: 38px;
    transition: all 0.25s ease;
}

.lang-select-wrapper:hover {
    background: rgba(126, 168, 255, 0.08);
    border-color: rgba(126, 168, 255, 0.35);
}

.lang-select-wrapper select {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.lang-select-wrapper select:focus {
    color: #ffffff;
}

.lang-select-wrapper option {
    background: #0f1720;
    color: var(--text-primary);
}

.lang-select-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(126, 168, 255, 0.65);
    pointer-events: none;
}

/* ===== MOBILE RESPONSIVE SYSTEM OVERRIDES ===== */
@media (max-width: 600px) {
    .dict-container {
        padding: 0 16px;
    }
    
    .dict-main {
        padding-top: 80px;
        padding-bottom: 40px;
    }
    
    /* Remove word card widget container borders and background on mobile */
    .word-card {
        background: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border: none !important;
        padding: 0 !important;
        box-shadow: none !important;
        margin-bottom: 24px;
    }
    
    .word-header {
        padding-bottom: 16px;
        margin-bottom: 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .word-title {
        font-size: 34px !important;
    }
    
    .word-controls {
        width: 100%;
        justify-content: flex-start;
        gap: 12px;
    }
    
    /* Remove quiz card styling constraint, print directly on background */
    .quiz-card {
        background: rgba(255, 255, 255, 0.01) !important;
        border: 1px solid rgba(126, 168, 255, 0.15) !important;
        border-radius: 16px !important;
        padding: 18px 16px !important;
        margin-top: 24px !important;
    }
    
    .quiz-question {
        font-size: 14.5px !important;
        margin-bottom: 16px;
    }
    
    .app-cta-banner {
        padding: 24px 16px !important;
        border-radius: 20px !important;
        margin-top: 32px;
    }
    
    .app-cta-buttons {
        display: flex !important;
        flex-direction: row !important;
        gap: 12px !important;
        width: 100% !important;
        justify-content: center !important;
    }
    
    .app-cta-buttons .cta-store-btn {
        flex: 1 !important;
        justify-content: center !important;
        padding: 12px 8px !important;
        font-size: 13px !important;
        white-space: nowrap !important;
    }
    
    .search-wrapper {
        margin-bottom: 28px !important;
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
}
