/**
 * Character Hub Main Stylesheet
 * Path: /assets/css/characters-main.css
 * Purpose: Complete styles for both Character Hub and Women's Hub
 * Version: 2.0.0
 */

/* ===========================
   CSS Variables & Base Setup
   =========================== */
:root {
    --primary-dark: #0a0a0a;
    --primary-light: #ffffff;
    --accent-blue: #00b4d8;
    --accent-purple: #7209b7;
    --accent-rose: #e11d48;
    --accent-gold: #d4af37;
    --accent-green: #10b981;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-gray: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-gray: #f3f4f6;
    --border-light: #e5e7eb;
    --border-dark: #d1d5db;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    background: var(--bg-secondary);
    line-height: 1.6;
}

/* ===========================
   Navigation Styles
   =========================== */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

#main-nav.scrolled {
    box-shadow: var(--shadow-lg);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--primary-dark);
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-icon {
    width: 40px;
    height: 40px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-dark);
    background: rgba(0, 0, 0, 0.05);
}

.dropdown {
    position: relative;
}

.dropdown-toggle::after {
    content: '▾';
    font-size: 0.8rem;
    margin-left: 0.25rem;
    display: inline-block;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-toggle::after {
    transform: rotate(180deg);
}

.dropdown-content {
    display: none;
    position: absolute;
    background: var(--bg-primary);
    min-width: 220px;
    box-shadow: var(--shadow-xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    top: 100%;
    margin-top: 0.5rem;
    padding: 0.5rem 0;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    display: block;
    padding: 0.75rem 1.25rem;
    transition: all 0.2s ease;
}

.dropdown-content a:hover {
    background: var(--bg-gray);
    padding-left: 1.75rem;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 4px;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--primary-dark);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ===========================
   Hero Section
   =========================== */
.hero {
    background: linear-gradient(135deg, #1a1a1a 0%, #00b4d8 50%, #0a0a0a 100%);
    padding: 8rem 2rem 4rem;
    margin-top: 60px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    color: white;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: rgba(255, 255, 255, 0.9);
    max-width: 800px;
    margin: 0 auto 3rem;
    line-height: 1.6;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 4rem;
    flex-wrap: wrap;
}

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

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    display: block;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.stat-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.5rem;
}

/* ===========================
   Container & Layout
   =========================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* ===========================
   Quick Links
   =========================== */
.quick-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.quick-link {
    padding: 0.75rem 1.5rem;
    background: var(--bg-primary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-full);
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.quick-link:hover {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.quick-link.women {
    border-color: var(--accent-purple);
}

.quick-link.women:hover {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-rose) 100%);
    border-color: transparent;
}

/* ===========================
   Section Headers
   =========================== */
.section-header {
    margin: 3rem 0 2rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--text-gray);
    font-size: 1.1rem;
}

/* ===========================
   Featured Grid
   =========================== */
.featured-grid,
#featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.character-card,
.woman-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--border-light);
    text-decoration: none;
    color: inherit;
    display: block;
    box-shadow: var(--shadow-sm);
}

.character-card:hover,
.woman-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: transparent;
}

.character-header,
.woman-card-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--border-light);
}

.character-name,
.woman-card-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.character-hebrew,
.woman-card-hebrew {
    font-family: 'SBL Hebrew', 'Ezra SIL', 'Times New Roman', serif;
    color: var(--accent-purple);
    font-size: 1.1rem;
    direction: rtl;
    unicode-bidi: embed;
}

.character-body,
.woman-card-body {
    padding: 1.5rem;
}

.character-desc,
.woman-card-desc {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.character-meta,
.woman-card-meta {
    font-size: 0.9rem;
    color: var(--accent-purple);
    font-weight: 600;
}

/* ===========================
   Book Data Cards Grid
   =========================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

/* ===========================
   Study Card Styles
   =========================== */
.study-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.study-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: transparent;
}

.study-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 1.5rem;
    padding-bottom: 3.5rem; /* Space for arrow */
}

.study-card-header {
    margin-bottom: 1rem;
}

.study-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.study-card-title .hebrew {
    font-family: 'SBL Hebrew', 'Ezra SIL', 'Times New Roman', serif;
    color: var(--accent-purple);
    direction: rtl;
    unicode-bidi: embed;
}

.study-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-gray);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    border: 1px solid var(--border-light);
}

.tag.primary {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-rose) 100%);
    color: white;
    border-color: transparent;
}

.tag.group {
    background: #dbeafe;
    color: #1e40af;
    border-color: #93c5fd;
}

.tag.warning {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

.study-card-body {
    color: var(--text-gray);
}

.study-card-meta {
    font-size: 0.875rem;
    color: var(--accent-purple);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.study-card-desc {
    line-height: 1.6;
    margin: 0;
    color: var(--text-secondary);
}

.study-card-arrow {
    position: absolute;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.study-card:hover .study-card-arrow {
    transform: scale(1.1);
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-rose) 100%);
}

.study-card-arrow svg {
    width: 16px;
    height: 16px;
    color: white;
}

/* Song link for women with songs */
.song-link {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--accent-gold) 0%, #fbbf24 100%);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.3s ease;
}

.song-link:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

/* ===========================
   Tabs
   =========================== */
.main-tabs-container {
    margin: 4rem 0;
}

.main-tabs-nav {
    display: flex;
    gap: 1rem;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 2rem;
}

.main-tab-button {
    padding: 1rem 2rem;
    background: none;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-gray);
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.main-tab-button:hover {
    color: var(--text-primary);
}

.main-tab-button.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.sub-tabs-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0 1rem;
    flex-wrap: wrap;
}

.tanakh-chip {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: var(--radius-full);
    font-weight: 600;
    color: var(--accent-blue);
    font-size: 0.9rem;
}

.tanakh-chip.disabled {
    opacity: 0.7;
    cursor: default;
}

.sub-tab-button {
    padding: 0.5rem 1.25rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.sub-tab-button:hover {
    background: var(--bg-gray);
    color: var(--text-primary);
    border-color: var(--border-dark);
}

.sub-tab-button.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.sub-tab-content {
    display: none;
}

.sub-tab-content.active {
    display: block;
}

/* ===========================
   Tables
   =========================== */
.tanakh {
    width: 100%;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin: 1rem 0;
}

.tanakh thead {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.tanakh th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-light);
}

.tanakh td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.tanakh tbody tr {
    transition: all 0.2s ease;
    cursor: pointer;
}

.tanakh tbody tr:hover {
    background: var(--bg-gray);
}

.tanakh tbody tr:last-child td {
    border-bottom: none;
}

.hebrew {
    font-family: 'SBL Hebrew', 'Ezra SIL', 'Times New Roman', serif;
    color: var(--accent-purple);
    direction: rtl;
    unicode-bidi: embed;
    font-size: 1.1em;
}

/* ===========================
   Book Data Section
   =========================== */
#book-data-section {
    margin-top: 2rem;
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    min-height: 300px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-light);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===========================
   Empty State
   =========================== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-gray);
    border-radius: var(--radius-xl);
    border: 2px dashed var(--border-dark);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state-subtext {
    color: var(--text-gray);
    max-width: 400px;
    margin: 0 auto;
}

/* ===========================
   Details/Summary Styling
   =========================== */
details {
    margin: 1rem 0;
}

summary {
    padding: 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.3s ease;
    user-select: none;
}

summary:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

summary::marker {
    color: var(--accent-blue);
}

details[open] summary {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin-bottom: 0;
}

/* ===========================
   Footer
   =========================== */
footer {
    background: var(--primary-dark);
    color: white;
    text-align: center;
    padding: 3rem 2rem;
    margin-top: 6rem;
}

footer p {
    margin: 0;
    opacity: 0.9;
}

/* ===========================
   Women's Hub Specific Styles
   =========================== */
.women-hub .hero {
    background: linear-gradient(135deg, #1a1a1a 0%, var(--accent-purple) 50%, var(--accent-rose) 100%);
}

.women-hub .main-tab-button.active {
    color: var(--accent-purple);
    border-bottom-color: var(--accent-purple);
}

.women-hub .sub-tab-button.active {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-rose) 100%);
    border-color: transparent;
}

.women-hub .tanakh-chip {
    background: linear-gradient(135deg, rgba(114, 9, 183, 0.1) 0%, rgba(225, 29, 72, 0.1) 100%);
    color: var(--accent-purple);
}

.women-hub .study-card-arrow {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-rose) 100%);
}

.women-hub summary::marker {
    color: var(--accent-purple);
}

.women-hub .loading-spinner {
    border-top-color: var(--accent-purple);
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 65px;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: white;
        flex-direction: column;
        padding: 2rem;
        gap: 1rem;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
    }

    .nav-links.active {
        right: 0;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .dropdown-content {
        position: static;
        display: block;
        box-shadow: none;
        background: var(--bg-gray);
        margin-left: 1rem;
        margin-top: 0.5rem;
        border-radius: 0;
        border: none;
        border-left: 2px solid var(--border-light);
    }

    .hero {
        padding: 6rem 1rem 3rem;
    }

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

    .hero-stats {
        gap: 2rem;
    }

    .featured-grid,
    #featured-grid,
    .cards-grid {
        grid-template-columns: 1fr;
    }

    .main-tabs-nav {
        flex-wrap: wrap;
    }

    .main-tab-button {
        flex: 1;
        min-width: 150px;
    }

    .tanakh th,
    .tanakh td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }

    .tanakh th:nth-child(2),
    .tanakh td:nth-child(2) {
        display: none; /* Hide literal meaning on mobile */
    }

    .container {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .stat-number {
        font-size: 2rem;
    }

    .quick-links {
        flex-direction: column;
    }

    .quick-link {
        width: 100%;
        justify-content: center;
    }
}

/* ===========================
   Print Styles
   =========================== */
@media print {
    nav,
    .hero,
    .quick-links,
    .mobile-menu-toggle,
    footer {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    .study-card,
    .character-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* ===========================
   Accessibility
   =========================== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-blue);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: var(--radius-md);
    z-index: 10000;
}

.skip-link:focus {
    top: 10px;
}

/* Focus styles */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
/* ===========================
   SEARCH SECTION STYLES
   Added: 2024
   Purpose: Character/Women search functionality
   =========================== */

/* Search Section Container */
.search-section {
    margin: 3rem 0;
    padding: 3rem 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.search-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0, 180, 216, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.women-hub .search-section::before {
    background: radial-gradient(circle, rgba(114, 9, 183, 0.05) 0%, transparent 70%);
}

.search-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

/* Search Header */
.search-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.search-icon {
    font-size: 1.5em;
    vertical-align: middle;
    margin-right: 0.5rem;
    filter: grayscale(0.2);
}

.search-header .section-title {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    color: var(--primary-dark);
}

.search-header .section-subtitle {
    font-size: 1.1rem;
    color: var(--text-gray);
    max-width: 600px;
    margin: 0 auto;
}

/* Search Box */
.search-box {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: stretch;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 1.5rem;
    font-size: 1.05rem;
    border: 2px solid var(--border-light);
    border-radius: 50px;
    background: white;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(0, 180, 216, 0.1), 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.search-input::placeholder {
    color: #9ca3af;
}

/* Women hub specific focus */
.women-hub .search-input:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 4px rgba(114, 9, 183, 0.1), 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Clear button */
.clear-search {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--text-gray);
}

.clear-search:hover {
    background: #e5e7eb;
    color: var(--primary-dark);
}

/* Search Button */
.search-button {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, var(--accent-blue) 0%, #0096c7 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 180, 216, 0.25);
}

.women-hub .search-button {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-rose) 100%);
    box-shadow: 0 4px 15px rgba(114, 9, 183, 0.25);
}

.search-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 180, 216, 0.35);
}

.women-hub .search-button:hover {
    box-shadow: 0 6px 20px rgba(114, 9, 183, 0.35);
}

.search-button:active {
    transform: translateY(0);
}

.search-button svg {
    flex-shrink: 0;
}

/* Search Filters (Optional) */
.search-filters {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.filter-label {
    font-weight: 600;
    color: var(--text-gray);
    font-size: 0.9rem;
}

.filter-chip {
    padding: 0.4rem 1rem;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-gray);
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-chip:hover {
    background: var(--bg-gray);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.filter-chip.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.women-hub .filter-chip:hover {
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

.women-hub .filter-chip.active {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-rose) 100%);
    border-color: transparent;
}

/* Results Count */
.search-results-count {
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-left: 3px solid var(--accent-blue);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: var(--text-gray);
}

.women-hub .search-results-count {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border-left-color: var(--accent-purple);
}

.search-results-count .results-number {
    font-weight: 700;
    color: var(--accent-blue);
    font-size: 1.1rem;
}

.women-hub .search-results-count .results-number {
    color: var(--accent-purple);
}

/* Search Results Container */
.search-results {
    min-height: 0;
    max-height: 600px;
    overflow-y: auto;
    margin-top: 2rem;
    scroll-behavior: smooth;
}

.search-results:not(:empty) {
    padding: 2rem;
    background: white;
    border-radius: 16px;
    border: 1px solid var(--border-light);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* Scrollbar styling */
.search-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.search-results::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 10px;
}

.women-hub .search-results::-webkit-scrollbar-thumb {
    background: var(--accent-purple);
}

.search-results .section-header {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-light);
}

.search-results .studies-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Search result cards animation */
.search-results .study-card {
    animation: fadeInUp 0.4s ease;
}

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

/* Empty state for search */
.search-results .empty-state {
    padding: 4rem 2rem;
    text-align: center;
}

.search-results .empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
    filter: grayscale(1);
}

.search-results .empty-state-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
}

.search-results .empty-state-subtext {
    color: var(--text-gray);
    font-size: 1rem;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Loading state for search */
.search-loading {
    text-align: center;
    padding: 3rem;
}

.search-loading::after {
    content: "";
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.women-hub .search-loading::after {
    border-top-color: var(--accent-purple);
}

/* Highlight search terms in results */
.search-highlight {
    background: linear-gradient(135deg, rgba(0, 180, 216, 0.2) 0%, rgba(0, 212, 255, 0.2) 100%);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    border-bottom: 2px solid var(--accent-blue);
}

.women-hub .search-highlight {
    background: linear-gradient(135deg, rgba(114, 9, 183, 0.2) 0%, rgba(225, 29, 72, 0.2) 100%);
    border-bottom-color: var(--accent-purple);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .search-section {
        margin: 2rem 0;
        padding: 2rem 0;
    }
    
    .search-container {
        padding: 0 1rem;
    }
    
    .search-header .section-title {
        font-size: 1.5rem;
    }
    
    .search-header .section-subtitle {
        font-size: 0.95rem;
    }
    
    .search-box {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .search-input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.9rem 3rem 0.9rem 1.25rem;
    }
    
    .search-button {
        width: 100%;
        justify-content: center;
        padding: 0.9rem 2rem;
    }
    
    .search-filters {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .filter-label {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .search-results {
        max-height: none;
    }
    
    .search-results .studies-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .search-icon {
        display: block;
        margin: 0 auto 0.5rem;
    }
    
    .filter-chip {
        flex: 1 0 calc(50% - 0.25rem);
        text-align: center;
    }
}

/* Keyboard navigation */
.search-input:focus-visible,
.search-button:focus-visible,
.clear-search:focus-visible,
.filter-chip:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 3px;
}

.women-hub .search-input:focus-visible,
.women-hub .search-button:focus-visible,
.women-hub .clear-search:focus-visible,
.women-hub .filter-chip:focus-visible {
    outline-color: var(--accent-purple);
}

/* Accessibility - Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===========================
   END OF SEARCH SECTION
   =========================== */

/* ===========================
   SEARCH RESULTS CARDS
   Added for enhanced search functionality
   =========================== */
.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.search-result-card {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: all 0.3s ease;
}

.search-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.result-link {
    display: block;
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.result-header {
    margin-bottom: 0.75rem;
}

.result-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.result-title .hebrew {
    color: var(--accent-blue);
    margin-left: 0.5rem;
}

.women-hub .result-title .hebrew {
    color: var(--accent-purple);
}

.result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.result-meta {
    font-size: 0.9rem;
    color: var(--accent-blue);
    margin-bottom: 0.5rem;
}

.women-hub .result-meta {
    color: var(--accent-purple);
}

.result-summary {
    font-size: 0.95rem;
    color: var(--text-gray);
    line-height: 1.5;
}

.no-results {
    text-align: center;
    padding: 3rem;
}

.no-results-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results-text {
    font-size: 1.25rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.no-results-suggestions {
    color: var(--text-gray);
    font-size: 0.95rem;
}

mark.search-highlight {
    background: #fef08a;
    font-weight: 600;
    padding: 0 2px;
    border-radius: 2px;
}

.women-hub mark.search-highlight {
    background: linear-gradient(135deg, rgba(114, 9, 183, 0.2) 0%, rgba(225, 29, 72, 0.2) 100%);
}

.result-source {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.2rem;
    opacity: 0.7;
}

/* Dark mode support for search results */
body.dark-mode .search-result-card {
    background: var(--bg-primary);
    border-color: var(--border-light);
}

body.dark-mode .result-title {
    color: var(--text-primary);
}

body.dark-mode .no-results-text {
    color: var(--text-primary);
}

body.dark-mode mark.search-highlight {
    background: var(--accent-gold);
    color: var(--primary-dark);
}

/* Mobile responsiveness for search results */
@media (max-width: 768px) {
    .search-results-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .result-link {
        padding: 1rem;
    }
}

/* ===========================
   Dark Mode Variables and Styles
   =========================== */
body.dark-mode {
    --primary-dark: #ffffff;
    --primary-light: #0a0a0a;
    --accent-blue: #60a5fa;
    --accent-purple: #a855f7;
    --text-primary: #f3f4f6;
    --text-secondary: #d1d5db;
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --border-light: #374151;
    
    background: var(--bg-secondary);
    color: var(--text-primary);
}

body.dark-mode nav {
    background: rgba(31, 41, 55, 0.98);
}

body.dark-mode .study-card,
body.dark-mode .character-card {
    background: var(--bg-primary);
    border-color: var(--border-light);
}

body.dark-mode .search-input {
    background: var(--bg-primary);
    border-color: var(--border-light);
    color: var(--text-primary);
}