/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Cherry Blossom Theme Colors */
    --sakura-pink: #FFB7C5;
    --sakura-light: #FFC0CB;
    --sakura-deep: #FF69B4;
    --sakura-white: #FFF8DC;
    --mountain-blue: #4A6FA5;
    --sky-blue: #87CEEB;
    --mist-lavender: #E6E6FA;
    --pagoda-red: #DC143C;
    --cherry-bark: #8B4513;
    --mountain-gray: #708090;
    
    /* Updated theme variables */
    --primary-color: var(--sakura-pink);
    --secondary-color: var(--sakura-deep);
    --accent-color: var(--mountain-blue);
    --highlight-color: var(--pagoda-red);
    --text-light: #ffffff;
    --text-dark: #2F1B14;
    --text-muted: #8B7355;
    --background-light: linear-gradient(135deg, var(--sky-blue) 0%, var(--mist-lavender) 50%, var(--sakura-light) 100%);
    --card-background: rgba(255, 255, 255, 0.9);
    --border-color: rgba(255, 183, 197, 0.4);
    --shadow: 0 8px 25px rgba(255, 105, 180, 0.2);
    --shadow-lg: 0 15px 35px rgba(255, 105, 180, 0.3);
    --gradient-primary: linear-gradient(135deg, rgba(255, 183, 197, 0.9), rgba(255, 105, 180, 0.8));
    --gradient-secondary: linear-gradient(135deg, var(--pagoda-red), var(--sakura-deep));
    --warm-overlay: rgba(255, 183, 197, 0.15);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    color: var(--text-dark);
    background: var(--background-light);
    background-attachment: fixed;
    overflow-x: hidden;
    font-weight: 400;
    position: relative;
}

/* Cherry Blossom Petals Animation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><g fill="%23FFB7C5" opacity="0.7"><circle cx="20" cy="20" r="2"/><circle cx="80" cy="40" r="1.5"/><circle cx="40" cy="70" r="2.5"/><circle cx="90" cy="80" r="1"/><circle cx="10" cy="90" r="1.5"/></g></svg>');
    background-size: 200px 200px;
    animation: sakuraDrift 20s linear infinite;
    pointer-events: none;
    z-index: 1;
}

/* Mountain silhouette background */
body::after {
    content: '';
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to top, 
        var(--mountain-gray) 0%, 
        rgba(112, 128, 144, 0.8) 30%, 
        rgba(112, 128, 144, 0.4) 60%, 
        transparent 100%);
    clip-path: polygon(0 100%, 15% 60%, 35% 80%, 55% 40%, 75% 70%, 90% 30%, 100% 50%, 100% 100%);
    pointer-events: none;
    z-index: 1;
}

@keyframes sakuraDrift {
    0% {
        transform: translateX(-100px) translateY(-100px) rotate(0deg);
    }
    100% {
        transform: translateX(calc(100vw + 100px)) translateY(calc(100vh + 100px)) rotate(360deg);
    }
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--text-light);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-screen p {
    color: var(--text-light);
    font-size: 1.1rem;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Navigation */
.navbar {
    background: rgba(255, 183, 197, 0.95);
    backdrop-filter: blur(20px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.2rem 0;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 105, 180, 0.3);
    box-shadow: 0 4px 20px rgba(255, 105, 180, 0.2);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-light);
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 8px;
}

.nav-logo i {
    color: var(--highlight-color);
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--highlight-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--highlight-color);
    border-radius: 1px;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    background: var(--gradient-primary);
    background-image: 
        linear-gradient(135deg, rgba(255, 183, 197, 0.8), rgba(255, 105, 180, 0.6)),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><pattern id="sakura" width="100" height="100" patternUnits="userSpaceOnUse"><g fill="rgba(255,255,255,0.1)"><path d="M50,20 Q55,25 50,30 Q45,25 50,20 M50,30 Q55,35 50,40 Q45,35 50,30"/><path d="M20,50 Q25,55 20,60 Q15,55 20,50 M80,70 Q85,75 80,80 Q75,75 80,70"/></g></pattern></defs><rect width="100%" height="100%" fill="url(%23sakura)"/></svg>');
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 100px 2rem 4rem;
}

/* Pagoda silhouette in hero */
.hero-section::before {
    content: '';
    position: absolute;
    top: 10%;
    right: 10%;
    width: 150px;
    height: 200px;
    background: var(--pagoda-red);
    clip-path: polygon(
        50% 0%, 
        40% 15%, 60% 15%,
        35% 20%, 65% 20%,
        30% 35%, 70% 35%,
        25% 40%, 75% 40%,
        20% 55%, 80% 55%,
        15% 60%, 85% 60%,
        10% 75%, 90% 75%,
        5% 80%, 95% 80%,
        0% 100%, 100% 100%
    );
    opacity: 0.3;
    animation: pagodaGlow 6s ease-in-out infinite;
    z-index: 1;
}

@keyframes pagodaGlow {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.05); }
}

.hero-content {
    max-width: 800px;
    text-align: center;
    z-index: 2;
    color: var(--text-light);
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.gradient-text {
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.85);
}

/* Search Container */
.search-container {
    margin-bottom: 2rem;
}

.search-box {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    max-width: 600px;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--highlight-color);
    box-shadow: 0 0 0 4px rgba(233, 69, 96, 0.1);
}

.search-icon {
    color: var(--text-light);
    margin-right: 1rem;
    opacity: 0.7;
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-light);
    font-size: 1rem;
    font-weight: 400;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-btn {
    background: var(--gradient-secondary);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.search-btn:hover {
    transform: scale(1.05);
}

.search-btn i {
    color: var(--text-light);
}

/* Quick Filters */
.quick-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.filter-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-size: 1.1rem;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-tag {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.filter-tag:hover {
    background: var(--highlight-color);
    border-color: var(--highlight-color);
    transform: translateY(-2px);
}

/* Floating Elements - Cherry Blossom Petals */
.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.floating-elements {
    position: relative;
    width: 100%;
    height: 100%;
}

.floating-element {
    position: absolute;
    background: radial-gradient(circle, var(--sakura-pink) 30%, var(--sakura-light) 70%, transparent 100%);
    border-radius: 50% 50% 50% 20%;
    opacity: 0.7;
    animation: sakuraPetalFloat 8s ease-in-out infinite;
    transform-origin: center;
}

.floating-element:nth-child(1) {
    width: 25px;
    height: 35px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
    background: radial-gradient(ellipse, var(--sakura-white) 20%, var(--sakura-pink) 80%);
}

.floating-element:nth-child(2) {
    width: 30px;
    height: 40px;
    top: 60%;
    right: 10%;
    animation-delay: 2s;
    background: radial-gradient(ellipse, var(--sakura-light) 30%, var(--sakura-deep) 90%);
}

.floating-element:nth-child(3) {
    width: 20px;
    height: 28px;
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
    background: radial-gradient(ellipse, var(--sakura-white) 40%, var(--sakura-pink) 85%);
}

@keyframes sakuraPetalFloat {
    0% { 
        transform: translateY(0px) rotate(0deg) translateX(0px); 
        opacity: 0.8;
    }
    25% { 
        transform: translateY(-30px) rotate(90deg) translateX(20px); 
        opacity: 1;
    }
    50% { 
        transform: translateY(-20px) rotate(180deg) translateX(-15px); 
        opacity: 0.9;
    }
    75% { 
        transform: translateY(-40px) rotate(270deg) translateX(30px); 
        opacity: 0.7;
    }
    100% { 
        transform: translateY(0px) rotate(360deg) translateX(0px); 
        opacity: 0.8;
    }
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 2;
}

.section {
    margin: 4rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--highlight-color), rgba(255, 107, 53, 0.6));
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 300;
    margin-top: 1rem;
}

/* Anime Grid */
.anime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.anime-card {
    background: var(--card-background);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.anime-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--sakura-deep);
    background: rgba(255, 255, 255, 0.95);
}

.anime-card-image {
    position: relative;
    overflow: hidden;
}

.anime-card-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.anime-card:hover .anime-card-image img {
    transform: scale(1.05);
}

.anime-score {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--gradient-secondary);
    color: var(--text-light);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.anime-format {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--gradient-secondary);
    color: var(--text-light);
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid var(--sakura-deep);
}

.anime-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.anime-popularity,
.anime-favourites {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--sakura-deep);
    font-weight: 500;
}

.anime-popularity i,
.anime-favourites i {
    color: var(--pagoda-red);
}

.anime-duration {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.anime-card-content {
    padding: 1.5rem;
}

.anime-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.anime-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.anime-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.anime-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.genre-tag {
    background: linear-gradient(135deg, var(--sakura-pink), var(--sakura-deep));
    color: var(--text-light);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--sakura-light);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Genres Grid */
.genres-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 2rem 0;
}

.genre-card {
    background: var(--card-background);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 1px solid var(--border-color);
}

.genre-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 183, 197, 0.8), 
        rgba(255, 105, 180, 0.6),
        rgba(74, 111, 165, 0.4));
    transition: all 0.3s ease;
}

.genre-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-secondary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    z-index: 2;
}

.genre-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--sakura-deep);
}

.genre-card:hover::before {
    background: linear-gradient(135deg, 
        rgba(255, 183, 197, 0.6), 
        rgba(255, 105, 180, 0.4),
        rgba(74, 111, 165, 0.2));
}

.genre-card:hover::after {
    transform: scaleX(1);
}

.genre-card h3 {
    color: var(--text-light);
    font-size: 1.3rem;
    font-weight: 700;
    position: relative;
    z-index: 3;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    margin: 0;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 2rem;
}

.modal-content {
    background: var(--card-background);
    border-radius: 20px;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--highlight-color);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2001;
    transition: transform 0.3s ease;
}

.modal-close:hover {
    transform: scale(1.1);
}

.modal-close i {
    color: var(--text-light);
}

.modal-banner {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.modal-banner::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(transparent, var(--card-background));
}

.modal-content-wrapper {
    display: flex;
    padding: 2rem;
    gap: 2rem;
}

.modal-image img {
    width: 200px;
    height: 300px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.modal-info {
    flex: 1;
}

.modal-info h1 {
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.modal-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--background-light);
    border-radius: 12px;
}

.modal-meta div {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.modal-genres {
    margin-bottom: 1.5rem;
}

.modal-description h3,
.modal-studios h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.modal-description p,
.modal-studios p {
    color: var(--text-muted);
    line-height: 1.6;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--sakura-deep), var(--mountain-blue));
    color: var(--text-light);
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100"><g fill="rgba(255,255,255,0.1)"><circle cx="20" cy="20" r="1.5"/><circle cx="80" cy="40" r="1"/><circle cx="40" cy="70" r="2"/><circle cx="90" cy="80" r="0.5"/><circle cx="10" cy="90" r="1"/></g></svg>');
    background-size: 50px 50px;
    animation: sakuraDrift 15s linear infinite;
    pointer-events: none;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.social-links a {
    color: var(--text-light);
    font-size: 1.5rem;
    margin-left: 1rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--highlight-color);
}

/* WCAG Accessibility Improvements */

/* Focus indicators for all interactive elements */
button:focus,
.anime-card:focus,
.genre-card:focus,
.nav-link:focus,
input:focus {
    outline: 3px solid var(--mountain-blue);
    outline-offset: 2px;
}

/* Enhanced button contrast */
.search-btn:focus {
    outline: 3px solid var(--text-light);
    outline-offset: 2px;
}

.filter-tag:focus {
    outline: 3px solid var(--mountain-blue);
    outline-offset: 2px;
}

/* Modal accessibility */
.modal-close:focus {
    outline: 3px solid var(--text-light);
    outline-offset: 2px;
}

/* Ensure proper contrast for all text elements */
.hero-subtitle {
    color: rgba(255, 255, 255, 0.95); /* Increased contrast */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.filter-label {
    color: rgba(255, 255, 255, 0.95); /* Increased contrast */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Loading screen accessibility */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem;
    color: var(--text-dark);
}

.loading-container p {
    margin-top: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-dark);
}

/* No results styling */
.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--sakura-deep);
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.no-results p {
    font-size: 1rem;
    color: var(--text-muted);
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--pagoda-red);
    color: var(--text-light);
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
    font-weight: 600;
}

.skip-link:focus {
    top: 6px;
    outline: 3px solid var(--text-light);
    outline-offset: 2px;
}

/* Improved search results header */
.results-header h2 {
    color: var(--text-dark);
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.results-count {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 1rem;
}

/* Enhanced navigation contrast */
.nav-logo {
    color: var(--text-dark);
    text-shadow: none;
}

.nav-link {
    color: var(--text-dark);
    font-weight: 600;
}

.nav-link:hover,
.nav-link.active {
    color: var(--pagoda-red);
}

/* Search input accessibility */
.search-box input {
    color: var(--text-dark);
    font-weight: 500;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-icon {
    color: var(--text-muted);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --text-dark: #000000;
        --text-muted: #333333;
        --border-color: #000000;
        --card-background: #ffffff;
    }
    
    .genre-filter {
        border-width: 3px;
    }
    
    .anime-card {
        border-width: 2px;
        border-color: #000000;
    }
}

/* Reduced motion support */
@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;
    }
}

/* 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;
}

/* Search Page Specific Styles */
.search-page {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    background: rgba(255, 255, 255, 0.95);
}

.search-header {
    position: relative;
    z-index: 15;
    background: rgba(255, 255, 255, 0.98);
    padding: 2rem 0;
}

.search-content {
    position: relative;
    z-index: 15;
    background: rgba(255, 255, 255, 0.98);
    min-height: 60vh;
    padding: 2rem 0;
}

/* Make logo clickable */
.nav-logo {
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 8px;
}

.nav-logo:hover {
    background: rgba(255, 183, 197, 0.1);
    transform: scale(1.05);
}

.nav-logo:focus {
    outline: 2px solid var(--sakura-pink);
    outline-offset: 2px;
}

/* Additional z-index fixes for search results */
.anime-grid {
    position: relative;
    z-index: 20;
}

.anime-card {
    position: relative;
    z-index: 25;
}

/* Ensure loading and no-results are visible */
.loading-container,
.no-results {
    position: relative;
    z-index: 20;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
}

/* High contrast mode support for search page */
@media (prefers-contrast: high) {
    .search-page {
        background: white;
    }
    
    .search-header,
    .search-content {
        background: white;
    }
}