/* ── Base ─────────────────────────────────────────────────── */
* { box-sizing: border-box; }

body {
    font-family: 'Cairo', 'Segoe UI', sans-serif;
    background: #f8f9fa;
    color: #2d3748;
}

/* ── Hero Section ─────────────────────────────────────────── */
.hero-section {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 40%, #6f42c1 100%);
    min-height: 380px;
    display: flex;
    align-items: center;
}

/* ── Page Header ─────────────────────────────────────────── */
.page-header {
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
}

/* ── Name Card ───────────────────────────────────────────── */
.name-card {
    transition: transform .18s ease, box-shadow .18s ease;
    border-radius: 14px !important;
    cursor: pointer;
}
.name-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,.12) !important;
}

.name-text {
    font-size: 1.25rem;
    letter-spacing: .02em;
}

.name-letter {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 900;
    flex-shrink: 0;
}

.meaning-preview {
    min-height: 2.5em;
}

/* ── Name Show Page ──────────────────────────────────────── */
.name-hero-stripe {
    height: 6px;
}

.name-hero-letter {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 900;
    flex-shrink: 0;
}

/* ── Alphabet Grid ───────────────────────────────────────── */
.alphabet-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.alphabet-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: #fff;
    color: #0d6efd;
    font-weight: 700;
    font-size: 1.15rem;
    text-decoration: none;
    border: 2px solid #dee2e6;
    transition: all .15s ease;
}
.alphabet-btn:hover {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
    transform: scale(1.08);
}

/* ── Letter badge (footer) ───────────────────────────────── */
.letter-badge {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
    transition: background .15s;
}
.letter-badge:hover { background: #495057 !important; }

/* ── Category Cards ──────────────────────────────────────── */
.card-hover {
    border-radius: 14px !important;
    transition: transform .18s ease, box-shadow .18s ease;
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,.1) !important;
}

.cat-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* ── Filter bar ──────────────────────────────────────────── */
.filter-btn.active {
    font-weight: 600;
}

/* ── Letter dropdown ─────────────────────────────────────── */
.letter-dropdown {
    flex-wrap: wrap;
    width: 240px;
    max-height: 300px;
    overflow-y: auto;
}
.letter-dropdown.show {
    display: flex;
}

/* ── Loading overlay ─────────────────────────────────────── */
.grid-loading {
    position: relative;
    min-height: 200px;
}
.grid-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.7);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Pagination ──────────────────────────────────────────── */
.page-link {
    border-radius: 8px !important;
    margin: 0 2px;
    font-weight: 600;
    min-width: 38px;
    text-align: center;
}

/* ── Navbar ──────────────────────────────────────────────── */
.navbar-brand { letter-spacing: -.02em; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 576px) {
    .hero-section { min-height: 280px; }
    .name-hero-letter { width: 60px; height: 60px; font-size: 1.6rem; }
    .display-5 { font-size: 1.8rem; }
    .alphabet-btn { width: 40px; height: 40px; font-size: 1rem; }
}
