/* ============================================
   OWANLY DICTIONARY STYLES
   Premium Ancestral Dictionary Design
   ============================================ */

/* ============================================
   DICTIONARY HERO
   ============================================ */
.dict-hero {
    position: relative;
    background: linear-gradient(135deg, var(--dark) 0%, #0A3517 50%, #0D4420 100%);
    padding: 10rem 2rem 4rem;
    text-align: center;
    overflow: hidden;
}

.dict-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(151, 241, 56, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(151, 241, 56, 0.08) 0%, transparent 40%);
    pointer-events: none;
}

.dict-hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    margin: 0 auto;
}

.dict-hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 900;
    color: #fff;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

.dict-hero-subtitle {
    font-size: 1.25rem;
    color: var(--lime);
    font-weight: 600;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* ============================================
   SEARCH BAR
   ============================================ */
.dict-search {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.dict-search i {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    color: #666;
}

.dict-search input {
    width: 100%;
    padding: 1.25rem 3.5rem;
    font-size: 1.125rem;
    font-weight: 500;
    border: none;
    border-radius: 100px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    font-family: inherit;
}

.dict-search input:focus {
    outline: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 0 4px rgba(151, 241, 56, 0.3);
}

.dict-search input::placeholder {
    color: #999;
}

.search-clear {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.search-clear:hover {
    background: #e0e0e0;
}

.search-clear.visible {
    display: flex;
}

/* ============================================
   STATS BAR
   ============================================ */
.dict-stats {
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    position: sticky;
    top: 70px;
    z-index: 90;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.dict-stats-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-around;
    gap: 1rem;
}

.dict-stat-item {
    text-align: center;
}

.dict-stat-num {
    display: block;
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--dark);
    line-height: 1;
}

.dict-stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   CATEGORY NAVIGATION
   ============================================ */
.dict-nav-section {
    background: #f8f9fa;
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    position: sticky;
    top: 140px;
    z-index: 85;
}

.dict-categories {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--lime) transparent;
    -webkit-overflow-scrolling: touch;
}

.dict-categories::-webkit-scrollbar {
    height: 4px;
}

.dict-categories::-webkit-scrollbar-track {
    background: transparent;
}

.dict-categories::-webkit-scrollbar-thumb {
    background: var(--lime);
    border-radius: 2px;
}

.cat-btn {
    flex-shrink: 0;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: 2px solid transparent;
    border-radius: 100px;
    background: #fff;
    color: #444;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    font-family: inherit;
}

.cat-btn:hover {
    border-color: var(--lime);
    color: var(--dark);
    transform: translateY(-2px);
}

.cat-btn.active {
    background: var(--dark);
    color: var(--lime);
    border-color: var(--dark);
    box-shadow: 0 4px 15px rgba(10, 42, 18, 0.3);
}

/* ============================================
   MAIN DICTIONARY CONTENT
   ============================================ */
.dict-main {
    padding: 3rem 0;
    background: linear-gradient(180deg, #f8f9fa 0%, #fff 100%);
    min-height: 60vh;
}

/* ============================================
   SEARCH RESULTS
   ============================================ */
.search-results {
    margin-bottom: 3rem;
}

.search-results.hidden {
    display: none;
}

.results-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.results-count {
    font-size: 1rem;
    font-weight: 600;
    color: #666;
}

.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.no-results i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 1rem;
    display: block;
}

.no-results p {
    font-size: 1.125rem;
    font-weight: 600;
}

.no-results span {
    font-size: 0.875rem;
    color: #999;
    display: block;
    margin-top: 0.5rem;
}

/* ============================================
   DICTIONARY SECTIONS
   ============================================ */
.dict-section {
    margin-bottom: 4rem;
    scroll-margin-top: 200px;
}

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

.dict-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #eee;
}

.dict-section-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-emoji {
    font-size: 1.75rem;
}

.word-count {
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    background: var(--dark);
    padding: 0.375rem 0.875rem;
    border-radius: 100px;
}

.section-intro {
    font-size: 1rem;
    color: #666;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(151, 241, 56, 0.1);
    border-radius: 12px;
    border-left: 4px solid var(--lime);
}

/* ============================================
   WORDS GRID
   ============================================ */
.words-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.word-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.word-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
    border-color: var(--lime);
}

.word-owan {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.word-english {
    font-size: 1rem;
    color: #666;
    font-weight: 500;
}

.word-play {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(151, 241, 56, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark);
    margin-left: auto;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.word-play:hover {
    background: var(--lime);
    transform: scale(1.1);
}

/* Highlighted word in search */
.word-card.highlight {
    border-color: var(--lime);
    background: rgba(151, 241, 56, 0.05);
}

.word-card .highlight-text {
    background: var(--lime);
    padding: 0 4px;
    border-radius: 4px;
    color: var(--dark);
}

/* ============================================
   NAMES GRID
   ============================================ */
.names-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.name-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.name-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--lime);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.name-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}

.name-card:hover::before {
    opacity: 1;
}

.name-title {
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.name-meaning {
    font-size: 0.9375rem;
    color: #666;
    font-weight: 500;
    line-height: 1.5;
    font-style: italic;
}

.name-meaning::before {
    content: '"';
    color: var(--lime);
    font-weight: 800;
    font-size: 1.25rem;
}

.name-meaning::after {
    content: '"';
    color: var(--lime);
    font-weight: 800;
    font-size: 1.25rem;
}

/* ============================================
   ALPHABET SECTION
   ============================================ */
.alphabet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.alphabet-group {
    background: #fff;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.05);
}

.alphabet-group h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #eee;
}

.letters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
}

.letter {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
    padding: 0 0.75rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border: 2px solid #eee;
    border-radius: 12px;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--dark);
    transition: all 0.3s ease;
    cursor: default;
}

.letter:hover {
    border-color: var(--lime);
    background: rgba(151, 241, 56, 0.1);
    transform: translateY(-2px);
}

.alphabet-note {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(10, 42, 18, 0.05);
    border-radius: 12px;
    font-size: 0.875rem;
    color: #666;
}

.alphabet-note strong {
    color: var(--dark);
}

/* ============================================
   BACK TO TOP BUTTON
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border: none;
    background: var(--dark);
    color: var(--lime);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 100;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--lime);
    color: var(--dark);
    transform: translateY(-4px);
}

/* ============================================
   LOADING STATE
   ============================================ */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.word-skeleton {
    height: 80px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .dict-hero {
        padding: 8rem 1.5rem 3rem;
    }

    .dict-hero-title {
        font-size: 2rem;
    }

    .dict-hero-subtitle {
        font-size: 1rem;
    }

    .dict-search input {
        padding: 1rem 3rem;
        font-size: 1rem;
    }

    .dict-stats-container {
        padding: 1rem;
        gap: 0.5rem;
    }

    .dict-stat-num {
        font-size: 1.25rem;
    }

    .dict-stat-label {
        font-size: 0.625rem;
    }

    .dict-nav-section {
        padding: 1rem 0;
    }

    .cat-btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.8125rem;
    }

    .dict-main {
        padding: 2rem 0;
    }

    .dict-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .dict-section-header h2 {
        font-size: 1.25rem;
    }

    .words-grid {
        grid-template-columns: 1fr;
    }

    .names-grid {
        grid-template-columns: 1fr;
    }

    .alphabet-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .letter {
        min-width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 480px) {
    .dict-hero {
        padding: 7rem 1rem 2.5rem;
    }

    .dict-hero-title {
        font-size: 1.75rem;
    }

    .dict-stats {
        top: 60px;
    }

    .dict-nav-section {
        top: 125px;
    }

    .dict-section {
        scroll-margin-top: 180px;
    }

    .word-card {
        padding: 1rem;
    }

    .name-card {
        padding: 1.25rem;
    }

    .name-title {
        font-size: 1.25rem;
    }
}

/* ============================================
   DARK MODE (Optional)
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .dict-hero,
    .dict-stats,
    .dict-nav-section,
    .back-to-top,
    .nav,
    .footer,
    .word-play {
        display: none !important;
    }

    .dict-main {
        padding: 0;
    }

    .dict-section {
        page-break-inside: avoid;
        margin-bottom: 2rem;
    }

    .word-card,
    .name-card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.word-card,
.name-card {
    animation: fadeInUp 0.4s ease backwards;
}

.words-grid .word-card:nth-child(1) { animation-delay: 0.05s; }
.words-grid .word-card:nth-child(2) { animation-delay: 0.1s; }
.words-grid .word-card:nth-child(3) { animation-delay: 0.15s; }
.words-grid .word-card:nth-child(4) { animation-delay: 0.2s; }
.words-grid .word-card:nth-child(5) { animation-delay: 0.25s; }
.words-grid .word-card:nth-child(6) { animation-delay: 0.3s; }

.names-grid .name-card:nth-child(1) { animation-delay: 0.05s; }
.names-grid .name-card:nth-child(2) { animation-delay: 0.1s; }
.names-grid .name-card:nth-child(3) { animation-delay: 0.15s; }
.names-grid .name-card:nth-child(4) { animation-delay: 0.2s; }
.names-grid .name-card:nth-child(5) { animation-delay: 0.25s; }
.names-grid .name-card:nth-child(6) { animation-delay: 0.3s; }
