/* Unique Names Styling */

:root {
    --unique-bg-gradient: linear-gradient(135deg, #F8F2FF 0%, #EEF4FF 50%, #FFFFFF 100%);
    --card-shadow-premium: 0 10px 30px rgba(0, 0, 0, 0.05);
    --card-shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.1);
    --exclusive-gold: #E2B558;
    --rare-purple: #6C2BD9;
    --very-rare-ruby: #D95757;
    --text-strong: #1F1B2E;
    --text-muted: #5C566E;
}

body[data-theme="girl"] {
    --unique-bg-gradient: linear-gradient(135deg, #F8F2FF 0%, #FFFFFF 100%);
}

#unique-names-page {
    background: var(--unique-bg-gradient);
    min-height: 100vh;
    padding-top: 80px;
    font-family: 'Inter', sans-serif;
}

.hero-section {
    text-align: center;
    padding: 60px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.page-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 15px;
    letter-spacing: -1px;
    background: linear-gradient(45deg, var(--text-dark), #666);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-subtitle {
    font-size: 1.25rem;
    color: var(--text-medium);
    margin-bottom: 30px;
    line-height: 1.6;
}

.seo-content-section {
    max-width: 1200px;
    margin: 38px auto 0;
    padding: 0 20px 42px;
}

.seo-content-section .content-wrapper {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(108, 43, 217, 0.14);
    border-radius: 14px;
    padding: 24px;
    box-shadow: var(--card-shadow-premium);
}

.seo-content-section h2 {
    margin: 0 0 10px;
    color: var(--text-strong);
    font-size: 1.7rem;
}

.seo-content-section h3 {
    margin: 16px 0 6px;
    color: var(--text-strong);
    font-size: 1rem;
}

.seo-content-section p {
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0;
}

.seo-link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
    margin: 18px 0 4px;
}

.seo-link-grid a {
    border: 1px solid rgba(108, 43, 217, 0.16);
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
    color: var(--rare-purple);
    font-weight: 700;
    text-decoration: none;
}

/* Filters */
.filters-section {
    padding: 20px;
    position: sticky;
    top: 70px;
    z-index: 100;
}

.filters-container {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(14px);
    padding: 28px 32px;
    border-radius: 22px;
    box-shadow: var(--card-shadow-premium);
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    align-items: center;
    border: 1px solid rgba(108, 43, 217, 0.2);
    position: relative;
    overflow: hidden;
}

.filters-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(108, 43, 217, 0.09), transparent 58%);
    pointer-events: none;
}

.filters-container>* {
    position: relative;
    z-index: 1;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.filter-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-pill {
    min-height: 54px;
    padding: 13px 22px;
    border-radius: 30px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    color: var(--text-medium);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
    line-height: 1.15;
    overflow-wrap: normal;
    word-break: keep-all;
}

.filter-pill.active {
    background: var(--text-dark);
    color: white;
    border-color: var(--text-dark);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.filter-select {
    min-height: 60px;
    padding: 15px 16px;
    border-radius: 14px;
    border: 1px solid #ddd;
    background: white;
    font-size: 1.04rem;
    font-weight: 600;
    outline: none;
}

.results-info {
    min-height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(108, 43, 217, 0.08);
    border: 1px solid rgba(108, 43, 217, 0.16);
    color: var(--text-muted);
    font-weight: 600;
}

.results-info #showing-count {
    color: var(--rare-purple);
    font-weight: 800;
}

.filter-group-gender .filter-pills {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
}

.filter-group-gender .filter-pills::-webkit-scrollbar {
    display: none;
}

.filter-group-gender .filter-pill {
    flex: 0 0 auto;
    min-width: 104px;
}

.filter-group-style {
    grid-column: span 2;
}

.filter-group-style .filter-pills {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.filter-group-style .filter-pill {
    min-width: 0;
    padding: 10px 8px;
    font-size: 0.82rem;
}

@media (max-width: 1120px) {
    .filters-container {
        grid-template-columns: minmax(0, 1fr);
    }

    .filter-group-style {
        grid-column: auto;
    }

    .filter-group-style .filter-pills {
        display: flex;
        flex-wrap: wrap;
    }

    .filter-group-style .filter-pill {
        min-width: max-content;
        padding-inline: 16px;
    }
}

/* Names Grid */
.names-section {
    padding: 40px 20px 80px;
}

.names-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.name-card {
    background: white;
    border-radius: 24px;
    padding: 30px;
    position: relative;
    box-shadow: var(--card-shadow-premium);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    border: 1px solid transparent;
    overflow: hidden;
}

.name-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(108, 43, 217, 0.08), transparent 45%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.name-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--card-shadow-hover);
    border-color: rgba(0, 0, 0, 0.05);
}

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

.rarity-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rarity-rare {
    background: #f0f7ff;
    color: #2980b9;
}

.rarity-very-rare {
    background: #fdf2f2;
    color: #e74c3c;
}

.rarity-exclusive {
    background: #fff8e1;
    color: #c5a059;
}

.name-display {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 8px;
    margin-top: 10px;
    /* Space from top icons */
    color: var(--text-dark);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.boy-card .name-display {
    color: #5d5dff;
}

.girl-card .name-display {
    color: #ff5db1;
}

.name-display-hi {
    margin-top: -2px;
    margin-bottom: 12px;
    font-size: 1.35rem;
    line-height: 1.25;
    font-weight: 700;
    color: var(--text-medium);
}

.gender-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-medium);
    margin-bottom: 15px;
}

.name-meaning {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-medium);
    margin-top: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-style: italic;
    opacity: 0.9;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f0f0f0;
    padding-top: 15px;
}

.origin-tag {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
}

.origin-tag i {
    font-size: 0.8rem;
}

.style-chip-row {
    margin-top: 8px;
    margin-bottom: 2px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.style-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    border: 1px solid transparent;
}

.style-chip.style-modern {
    background: #eef4ff;
    color: #2f5fd2;
    border-color: #d2defc;
}

.style-chip.style-short-cool {
    background: #f2ecff;
    color: #6a32d5;
    border-color: #dbc8ff;
}

.style-chip.style-nature {
    background: #ebfaef;
    color: #187a3a;
    border-color: #c8edd3;
}

.style-chip.style-spiritual {
    background: #fff6e8;
    color: #9a5b08;
    border-color: #f7debc;
}

.like-btn-card {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: #ddd;
    transition: all 0.3s ease;
}

.like-btn-card.liked {
    color: #ff4757;
    transform: scale(1.1);
}

/* Empty State */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    font-size: 1.2rem;
    color: var(--text-medium);
}

[data-theme='dark'] #unique-names-page,
body[data-theme='dark'] #unique-names-page {
    background: linear-gradient(135deg, #0f1117 0%, #151827 52%, #10141f 100%);
    color: #d8e0ec;
}

[data-theme='dark'] #unique-names-page .page-title,
body[data-theme='dark'] #unique-names-page .page-title {
    background: none;
    -webkit-text-fill-color: #f4f7fb;
    color: #f4f7fb;
}

[data-theme='dark'] #unique-names-page .page-subtitle,
[data-theme='dark'] #unique-names-page .results-info,
body[data-theme='dark'] #unique-names-page .page-subtitle,
body[data-theme='dark'] #unique-names-page .results-info {
    color: #c7d0dd;
}

[data-theme='dark'] #unique-names-page .filters-container,
[data-theme='dark'] #unique-names-page .name-card,
body[data-theme='dark'] #unique-names-page .filters-container,
body[data-theme='dark'] #unique-names-page .name-card {
    background: linear-gradient(165deg, rgba(24, 31, 45, 0.98), rgba(16, 21, 33, 0.98));
    border-color: rgba(139, 92, 246, 0.36);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.34);
}

[data-theme='dark'] #unique-names-page .filter-label,
[data-theme='dark'] #unique-names-page .name-display,
[data-theme='dark'] #unique-names-page .origin-tag,
body[data-theme='dark'] #unique-names-page .filter-label,
body[data-theme='dark'] #unique-names-page .name-display,
body[data-theme='dark'] #unique-names-page .origin-tag {
    color: #f4f7fb;
}

[data-theme='dark'] #unique-names-page .name-display-hi,
[data-theme='dark'] #unique-names-page .gender-badge,
[data-theme='dark'] #unique-names-page .name-meaning,
body[data-theme='dark'] #unique-names-page .name-display-hi,
body[data-theme='dark'] #unique-names-page .gender-badge,
body[data-theme='dark'] #unique-names-page .name-meaning {
    color: #d8e0ec;
    opacity: 1;
}

[data-theme='dark'] #unique-names-page .filter-pill,
[data-theme='dark'] #unique-names-page .filter-select,
body[data-theme='dark'] #unique-names-page .filter-pill,
body[data-theme='dark'] #unique-names-page .filter-select {
    background: #111827;
    border-color: rgba(196, 181, 253, 0.38);
    color: #d8e0ec;
}

[data-theme='dark'] #unique-names-page .card-footer,
body[data-theme='dark'] #unique-names-page .card-footer {
    border-top-color: rgba(196, 181, 253, 0.18);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.name-card {
    animation: fadeInUp 0.5s ease backwards;
}

/* Detail Modal Overrides (if needed) */
.name-details-container {
    max-width: 700px;
    margin: 40px auto;
}

@media (max-width: 768px) {
    .filters-section {
        position: static;
        top: auto;
    }

    .page-title {
        font-size: 2.5rem;
    }

    .filters-container {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 18px;
    }

    .filter-group-style {
        grid-column: auto;
    }

    .filter-group-gender .filter-pills,
    .filter-group-style .filter-pills {
        display: flex;
        flex-wrap: wrap;
    }

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

    .name-card {
        padding: 20px;
        border-radius: 16px;
    }

    .rarity-badge {
        top: 14px;
        right: 14px;
        font-size: 0.68rem;
    }
}

@media (max-width: 1160px) {
    .filter-group-style {
        grid-column: auto;
    }

    .filter-group-style .filter-pills {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 380px) {
    .filter-pill {
        flex: 1 1 100%;
    }
}

@media (max-width: 520px) {
    #unique-names-page {
        padding-top: 72px;
    }

    .hero-section {
        padding: 34px 14px 24px;
    }

    .page-title {
        font-size: 2rem;
        line-height: 1.2;
    }

    .page-subtitle {
        font-size: 0.95rem;
    }

    .filters-section,
    .names-section {
        padding-left: 12px;
        padding-right: 12px;
    }

    .filter-pills {
        flex-wrap: wrap;
    }

    .filter-pill {
        flex: 1 1 calc(50% - 8px);
        text-align: center;
        min-height: 48px;
        padding: 10px 12px;
    }
}
