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

/* Flash Messages */
.flash-messages {
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 2rem;
}

.flash-message {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    font-weight: 500;
}

.flash-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.flash-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.flash-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Header */
header {
    background-color: #1a1a1a;
    color: white;
    padding: 0;
    position: relative;
    z-index: 1000;
}

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

/* Logo */
nav h1 a {
    color: #00a4dc;
    font-size: 1.5rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

nav h1 a:hover {
    color: #0088b8;
}

/* Desktop Navigation */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-menu li a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-menu li a:hover {
    background-color: rgba(0, 164, 220, 0.1);
    color: #00a4dc;
}

/* Navigation Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Search Toggle */
.search-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.search-toggle:hover {
    background-color: rgba(0, 164, 220, 0.1);
    color: #00a4dc;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-menu-toggle {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.user-menu-toggle:hover {
    background-color: rgba(0, 164, 220, 0.1);
}

.username {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.user-dropdown li a:hover {
    background-color: #f8f9fa;
}

/* Login Button */
.login-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #00a4dc;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.login-btn:hover {
    background-color: #0088b8;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    min-width: 44px;
    min-height: 44px;
}

.mobile-menu-toggle:hover {
    background-color: rgba(0, 164, 220, 0.1);
    color: #00a4dc;
}

/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 100px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-container {
    width: 90%;
    max-width: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.search-form {
    display: flex;
    align-items: center;
    padding: 1rem;
    gap: 0.5rem;
}

.search-form input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-form input:focus {
    border-color: #00a4dc;
}

.search-close {
    background: none;
    border: none;
    color: #666;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-close:hover {
    background-color: #f8f9fa;
    color: #333;
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
    border-top: 1px solid #e9ecef;
}

.search-item {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    border-bottom: 1px solid #f8f9fa;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-item:last-child {
    border-bottom: none;
}

.search-result-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: background-color 0.2s ease;
}

.search-result-link:hover {
    background-color: #f8f9fa;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1500;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu {
    width: 280px;
    height: 100%;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.mobile-menu-overlay.active .mobile-menu {
    transform: translateX(0);
}

.mobile-menu-close {
    align-self: flex-end;
    background: none;
    border: none;
    color: #666;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 1rem;
    margin-bottom: 1rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-close:hover {
    color: #333;
}

.mobile-nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
}

.mobile-nav-menu li {
    border-bottom: 1px solid #f8f9fa;
}

.mobile-nav-menu li a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.mobile-nav-menu li a:hover {
    background-color: #f8f9fa;
}

.mobile-submenu {
    position: relative;
}

.mobile-submenu-toggle {
    width: 100%;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: #333;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.mobile-submenu-toggle:hover {
    background-color: #f8f9fa;
}

.mobile-submenu-items {
    list-style: none;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-submenu-items.active {
    max-height: 200px;
}

.mobile-submenu-items li {
    border-bottom: 1px solid #e9ecef;
}

.mobile-submenu-items li:last-child {
    border-bottom: none;
}

.mobile-submenu-items li a {
    padding: 0.75rem 2rem;
    font-size: 0.9rem;
}

/* Body state for mobile menu */
.mobile-menu-open {
    overflow: hidden;
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus indicators */
.search-toggle:focus,
.user-menu-toggle:focus,
.login-btn:focus,
.mobile-menu-toggle:focus,
.search-close:focus,
.mobile-menu-close:focus,
.mobile-submenu-toggle:focus {
    outline: 2px solid #00a4dc;
    outline-offset: 2px;
}

.user-dropdown a:focus,
.mobile-nav-menu a:focus,
.search-result-link:focus {
    outline: 2px solid #00a4dc;
    outline-offset: 2px;
    background-color: #f8f9fa;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .nav-container {
        border-bottom: 1px solid #000;
    }

    .user-dropdown,
    .mobile-menu {
        border: 2px solid #000;
    }

    .search-overlay {
        background-color: #000;
    }

    .search-container {
        border: 2px solid #fff;
    }
}

/* 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;
}

/* Skip link for keyboard users */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
    border-radius: 4px;
}

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

.movie-detail {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.movie-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.movie-poster img {
    width: 300px;
    height: 450px;
    object-fit: cover;
    border-radius: 0.5rem;
}

.movie-info h1 {
    margin: 0 0 1rem 0;
    font-size: 2.5rem;
}

.movie-info p {
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

.movie-overview {
    margin-bottom: 2rem;
}

.movie-overview h3 {
    margin-bottom: 1rem;
}

.movie-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.movie-votes, .movie-protection {
    margin-top: 1rem;
}

.series-detail {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.series-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.series-poster img {
    width: 300px;
    height: 450px;
    object-fit: cover;
    border-radius: 0.5rem;
}

.series-info h1 {
    margin: 0 0 1rem 0;
    font-size: 2.5rem;
}

.series-info p {
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

.series-overview {
    margin-bottom: 2rem;
}

.series-overview h3 {
    margin-bottom: 1rem;
}

.series-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.series-votes, .series-protection {
    margin-top: 1rem;
}

/* Search icon buttons */
.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.btn-icon i {
    font-size: 1rem;
}

.search-form {
    display: inline-block;
}

.search-form .btn-icon {
    margin: 0;
}



nav h1 a {
    color: #00a4dc;
    font-size: 1.8rem;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav ul li a {
    color: white;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: #00a4dc;
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

h2 {
    margin-bottom: 2rem;
    color: #1a1a1a;
}

/* Dashboard Header */
.dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
}

.dashboard-title h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.dashboard-title p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 0;
}

.dashboard-actions {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: flex-start;
    margin-top: 2rem;
}

.search-bar {
    width: 100%;
    max-width: 500px;
    display: flex;
    gap: 0.5rem;
}

.search-bar input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
}

.quick-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.1)"/><circle cx="10" cy="50" r="0.5" fill="rgba(255,255,255,0.1)"/><circle cx="90" cy="30" r="0.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.1;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.search-bar {
    width: 100%;
    max-width: 500px;
    display: flex;
    gap: 0.5rem;
}

.search-bar input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
}

.search-bar input::placeholder {
    color: #666;
}

.search-bar input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.search-bar #header-search-btn {
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    transition: background-color 0.2s;
}

.search-bar #header-search-btn:hover {
    background: rgba(255, 255, 255, 1);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-primary {
    background-color: #00a4dc;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #0088b8;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: #00a4dc;
    color: white;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #0088b8;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #00a4dc, #764ba2);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
    font-weight: 500;
}

.stat-link {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    color: #00a4dc;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover .stat-link {
    opacity: 1;
}

/* Dashboard Styles */
.dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
}

.dashboard-title h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.dashboard-title p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 0;
}

.dashboard-actions {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: flex-start;
    margin-top: 2rem;
}

.search-bar {
    width: 100%;
    max-width: 500px;
    display: flex;
    gap: 0.5rem;
}

.search-bar input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
}

.quick-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.dashboard-grid {
    display: grid;
    gap: 2rem;
    margin-bottom: 3rem;
}

.dashboard-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dashboard-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #333;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.5rem;
}

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

.section-header h2 {
    margin: 0;
    border: none;
    padding: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header .btn-small {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.section-header .btn-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.view-all {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.view-all:hover {
    text-decoration: underline;
}

/* Service Status */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.service-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.service-online {
    border-left: 4px solid #28a745;
}

.service-offline {
    border-left: 4px solid #dc3545;
    opacity: 0.7;
}

.service-icon {
    font-size: 1.5rem;
}

.service-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.service-status {
    font-size: 0.85rem;
    margin: 0 0 0.25rem 0;
    font-weight: 500;
}

.service-online .service-status {
    color: #28a745;
}

.service-offline .service-status {
    color: #dc3545;
}

.service-version {
    font-size: 0.75rem;
    color: #666;
    margin: 0;
}

/* Sync Status */
/* Data Synchronization Styling */
.sync-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.sync-metric {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.sync-metric::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

.sync-metric:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.metric-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.metric-value.healthy {
    color: #4ade80;
}

.metric-value.warning {
    color: #fbbf24;
}

.metric-label {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.sync-details {
    display: grid;
    gap: 0.75rem;
}

.sync-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
    position: relative;
}

.sync-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #adb5bd;
}

.sync-source {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.95rem;
}

.status-success {
    color: #38a169;
    font-weight: 600;
    background: rgba(56, 161, 105, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
}

.status-error {
    color: #e53e3e;
    font-weight: 600;
    background: rgba(229, 62, 62, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
}

.status-pending {
    color: #d69e2e;
    font-weight: 600;
    background: rgba(214, 158, 46, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
}

.sync-time {
    font-size: 0.8rem;
    color: #718096;
    font-weight: 500;
    margin-left: auto;
    margin-right: 1rem;
    opacity: 0.8;
}

.sync-empty {
    text-align: center;
    color: #718096;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 12px;
    border: 2px dashed #cbd5e0;
}

.sync-empty p {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

/* Progress indicator for sync overview */
.sync-progress {
    position: relative;
    margin-top: 1rem;
}

.sync-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.sync-progress-fill {
    height: 100%;
    background: #4ade80;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Responsive design for sync section */
@media (max-width: 768px) {
    .sync-overview {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .sync-metric {
        padding: 1.25rem;
    }

    .metric-value {
        font-size: 1.75rem;
    }

    .sync-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .sync-time {
        margin-left: 0;
        margin-right: 0;
        align-self: flex-end;
    }

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

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

/* Recent Content */
.recent-content-grid {
    display: grid;
    gap: 2rem;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.content-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.content-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.content-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.content-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 1rem;
}

.content-overlay h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.content-overlay p {
    margin: 0;
    font-size: 0.8rem;
    opacity: 0.9;
}

.no-image {
    width: 100%;
    height: 250px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #666;
    text-align: center;
}

.stat-card a {
    color: #00a4dc;
    font-weight: bold;
}

/* Media Grid */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.media-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.media-card:hover {
    transform: translateY(-5px);
}

.media-poster {
    height: 300px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.poster-link {
    text-decoration: none;
    display: block;
}

.no-poster {
    color: #666;
    font-size: 1.1rem;
}

.media-info {
    padding: 1.5rem;
}

.title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.status-indicator {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.status-available {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-downloaded {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-downloading {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.status-sonarr_downloaded,
.status-radarr_downloaded {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-sonarr_monitored,
.status-radarr_monitored {
    background-color: #cce5ff;
    color: #004085;
    border: 1px solid #b3d7ff;
}

.status-sonarr_unmonitored,
.status-radarr_unmonitored {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-sonarr-available {
    background-color: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

.status-downloading .fa-spinner {
    animation: fa-spin 1s infinite linear;
}

.media-info h3 {
    font-size: 1.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    flex: 1;
}

.search-form, .favorite-form {
    display: flex;
    align-items: center;
}

.search-btn, .favorite-btn, .action-btn {
    background: transparent;
    border: none;
    color: #ffc107;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    margin-right: 0.5rem;
}

.search-btn {
    color: #007bff;
}

.action-btn:hover {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

.action-btn:hover {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

.quality-badge {
    display: inline-block;
    background-color: transparent;
    color: #007bff;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: bold;
}

.episode-link {
    display: inline-block;
    color: #00a4dc;
    text-decoration: none;
    font-weight: bold;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.episode-link:hover {
    text-decoration: underline;
}

.year {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.genres {
    color: #00a4dc;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.overview {
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.rating {
    color: #ff6b35;
    font-weight: bold;
}



.votes {
    color: #dc3545;
    font-weight: bold;
    margin: 0.5rem 0;
}

.media-info button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.media-info button:hover {
    opacity: 0.8;
}

/* No Content */
.no-content {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.no-content h3 {
    margin-bottom: 1rem;
    color: #666;
}

/* Login Form */
.login-container {
    max-width: 400px;
    margin: 2rem auto;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group input:focus, .form-group textarea:focus {
    border-color: #00a4dc;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 164, 220, 0.5);
}

button {
    width: 100%;
    padding: 0.8rem;
    background-color: #00a4dc;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #0088b8;
}

.error {
    color: red;
    margin-bottom: 1rem;
    text-align: center;
}

/* Button Variants */
.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-success {
    background-color: #28a745;
}

.btn-success:hover {
    background-color: #1e7e34;
}

.btn-danger {
    background-color: #dc3545;
}

.btn-danger:hover {
    background-color: #bd2130;
}

.btn-info {
    background-color: #17a2b8;
}

.btn-info:hover {
    background-color: #117a8b;
}

.btn-warning {
    background-color: #ffc107;
    color: #000;
}

.btn-warning:hover {
    background-color: #e0a800;
}

/* Forms */
.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group textarea {
    resize: none;
    min-height: 3rem;
}

/* Progress */
progress {
    width: 100%;
    height: 1rem;
    border-radius: 5px;
}

/* Media Card Alignment */
.media-card {
    display: flex;
    flex-direction: column;
}

.media-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.media-info .buttons {
    margin-top: auto;
    display: none;
    flex-wrap: wrap;
    gap: 0.3rem;
    justify-content: flex-start;
}

/* Download Progress */
.download-status {
    margin: 0.5rem 0;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #dee2e6;
}

.progress-bar {
    position: relative;
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.download-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #6c757d;
}

.status {
    text-transform: capitalize;
}

.time-left {
    font-weight: bold;
    color: #007bff;
}

.btn-warning {
    background-color: #ffc107;
    color: #000;
}

.btn-warning:hover {
    background-color: #e0a800;
}

/* Episode Detail Pages */
.episode-detail {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.episode-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.episode-poster img {
    width: 300px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.episode-info h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
}

.episode-info h2 {
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
    color: #666;
}

.episode-info h2 a {
    color: #007bff;
    text-decoration: none;
}

.episode-info h2 a:hover {
    text-decoration: underline;
}

.episode-overview {
    margin-bottom: 2rem;
}

.episode-overview h3 {
    margin-bottom: 1rem;
    color: #333;
}

.episode-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.episode-navigation {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #dee2e6;
}

.episode-navigation h3 {
    margin-bottom: 1rem;
}

.nav-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links .btn {
    min-width: 150px;
}

/* Episode card links in series detail */
.media-card .poster-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.media-card .poster-link:hover .media-poster img {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

.media-card:hover .buttons {
    display: flex;
}

.media-info .buttons form {
    display: inline-block;
}

.media-info .buttons button, .media-info .buttons .btn {
    width: 90px;
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    margin: 0;
    text-align: center;
}

/* Admin Styles */
.admin-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 1rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    color: #007bff;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.nav-link:hover {
    background-color: #f8f9fa;
}

.nav-link.active {
    background-color: #007bff;
    color: white;
}

.admin-section {
    margin-bottom: 2rem;
}

.admin-section h2 {
    color: #333;
    border-bottom: 2px solid #00a4dc;
    padding-bottom: 0.5rem;
}

.settings {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.settings form {
    display: flex;
    gap: 1rem;
    align-items: center;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
}

.settings label {
    font-weight: bold;
    min-width: 150px;
}

.settings textarea {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    resize: vertical;
    min-height: 2rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.settings button {
    background: #00a4dc;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 3px;
}

/* System Controls */
.system-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.control-group {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.control-group h3 {
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.control-group p {
    color: #6c757d;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* Cache Status */
#cache-status {
    margin-top: 1rem;
}

.cache-status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.status-section {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.status-section h4 {
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.25rem;
}

.status-section p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

.success {
    color: #28a745;
}

.error {
    color: #dc3545;
}
    cursor: pointer;
}

.settings button:hover {
    background: #0088b8;
}

.settings textarea:focus {
    border-color: #00a4dc;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 164, 220, 0.5);
}

/* Settings Table */
.settings-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.settings-table th, .settings-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.settings-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #333;
}

.settings-table textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    resize: none;
    min-height: 2rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.settings-table textarea:focus {
    border-color: #00a4dc;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 164, 220, 0.5);
}

.settings-table button {
    background: #00a4dc;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9rem;
}

.settings-table button:hover {
    background: #0088b8;
}

.season-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.season-buttons form {
    display: inline;
}



/* Footer */
footer {
    background-color: #1a1a1a;
    color: white;
    text-align: center;
    padding: 1rem 0;
    margin-top: 3rem;
}

/* Sync Status */
/* Recent Sections */
.recent-section {
    margin-bottom: 3rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.8rem;
    color: #1a1a1a;
    margin: 0;
    font-weight: 600;
}

.view-all {
    color: #00a4dc;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s ease;
}

.view-all:hover {
    color: #0088b8;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.content-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.content-card img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
}

.content-card .no-image {
    width: 100%;
    height: 280px;
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    color: #999;
    text-align: center;
}

.content-info {
    padding: 1rem;
}

.content-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #1a1a1a;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.content-info .year,
.content-info .episodes {
    font-size: 0.85rem;
    color: #666;
    margin: 0.25rem 0;
}

.content-info .episodes {
    color: #00a4dc;
    font-weight: 500;
}

/* Sync Status */
.sync-status {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.sync-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.sync-status h3 {
    margin: 0;
    color: #1a1a1a;
    font-size: 1.4rem;
    font-weight: 600;
}

.sync-summary {
    margin-bottom: 1.5rem;
}

.sync-overview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #00a4dc;
}

.sync-count {
    font-weight: 600;
    color: #1a1a1a;
}

.sync-health {
    font-size: 0.9rem;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-weight: 500;
}

.sync-health.healthy {
    background: #d4edda;
    color: #155724;
}

.sync-health.warning {
    background: #fff3cd;
    color: #856404;
}

.sync-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
}

.sync-item {
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #00a4dc;
    font-size: 0.9rem;
}

.status-success {
    color: #28a745;
    font-weight: bold;
}

.status-error {
    color: #dc3545;
    font-weight: bold;
}

.status-pending {
    color: #ffc107;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .nav-container {
        padding: 0 1.5rem;
    }

    .username {
        display: none;
    }

    .user-menu-toggle .fa-chevron-down {
        margin-left: auto;
    }
}

@media (max-width: 768px) {
    /* Navigation */
    .nav-container {
        padding: 0 1rem;
        min-height: 50px;
    }

    nav h1 a {
        font-size: 1.3rem;
    }

    /* Hide desktop menu, show mobile toggle */
    .desktop-menu {
        display: none;
    }

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

    /* Adjust nav actions for mobile */
    .nav-actions {
        gap: 0.5rem;
    }

    .search-toggle,
    .user-menu-toggle,
    .login-btn {
        padding: 0.5rem;
        min-width: 40px;
        min-height: 40px;
    }

    .user-menu-toggle {
        padding: 0.5rem;
    }

    .user-menu-toggle .username {
        display: none;
    }

    /* Search overlay mobile adjustments */
    .search-overlay {
        padding-top: 60px;
    }

    .search-container {
        width: 95%;
        max-width: none;
    }

    .search-form {
        padding: 0.75rem;
    }

    .search-form input {
        font-size: 16px; /* Prevent zoom on iOS */
    }

    /* Mobile menu adjustments */
    .mobile-menu {
        width: 260px;
    }

    .mobile-nav-menu li a {
        padding: 1rem 1rem;
        font-size: 1rem;
    }

    .mobile-submenu-toggle {
        padding: 1rem 1rem;
    }

    .mobile-submenu-items li a {
        padding: 0.75rem 1.5rem;
    }

    /* Hero section */
    .hero h1 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .hero-actions {
        gap: 1.5rem;
    }

    .search-bar {
        max-width: 400px;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
    }

    .content-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1rem;
    }

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

    .sync-overview {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .hero-buttons .btn {
        width: 200px;
        text-align: center;
    }

    /* Stats */
    .stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

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

    /* Media grid */
    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1rem;
    }

    .media-card {
        border-radius: 8px;
    }

    .media-poster {
        height: 250px;
    }

    .media-info {
        padding: 1rem;
    }

    .media-info h3 {
        font-size: 1rem;
    }

    /* Sync status */
    .sync-details {
        grid-template-columns: 1fr;
    }

    .sync-item {
        padding: 0.75rem;
    }

    /* Main content */
    main {
        padding: 1rem;
    }

    /* Forms */
    .login-container {
        margin: 1rem auto;
        padding: 1.5rem;
    }

    /* Admin sections */
    .admin-nav {
        flex-direction: column;
        gap: 0.5rem;
        padding-bottom: 1rem;
    }

    .admin-nav .nav-link {
        padding: 0.5rem 1rem;
    }

    .control-group {
        padding: 1rem;
    }

    .settings form {
        flex-direction: column;
        gap: 0.5rem;
    }

    .settings label {
        min-width: auto;
    }

    .settings textarea {
        min-height: 3rem;
    }

    /* Episode details */
    .episode-detail {
        padding: 1rem;
    }

    .episode-header {
        flex-direction: column;
        gap: 1rem;
    }

    .episode-info h1 {
        font-size: 1.8rem;
    }

    .episode-info h2 {
        font-size: 1.1rem;
    }

    .episode-poster img {
        width: 250px;
        height: auto;
    }

    .episode-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .episode-actions .btn {
        width: 100%;
        text-align: center;
    }

    .episode-navigation .nav-links {
        flex-direction: column;
        gap: 0.5rem;
    }

    .episode-navigation .nav-links .btn {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .nav-container {
        padding: 0 0.5rem;
    }

    nav h1 a {
        font-size: 1.2rem;
    }

    .search-container {
        width: 98%;
    }

    .search-form {
        padding: 0.5rem;
    }

    .search-form input {
        padding: 0.6rem 0.8rem;
        font-size: 16px;
    }

    .mobile-menu {
        width: 240px;
    }

    .mobile-nav-menu li a {
        padding: 0.875rem 0.875rem;
        font-size: 0.95rem;
    }

    .mobile-submenu-toggle {
        padding: 0.875rem 0.875rem;
    }

    .mobile-submenu-items li a {
        padding: 0.6rem 1.25rem;
        font-size: 0.85rem;
    }

    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 0.75rem;
    }

    .media-poster {
        height: 220px;
    }

    .media-info h3 {
        font-size: 0.9rem;
    }

    .hero {
        padding: 2rem 1rem;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-actions {
        gap: 1rem;
    }

    .search-bar {
        max-width: 100%;
    }

    .search-bar form {
        flex-direction: column;
        gap: 0.5rem;
    }

    .search-bar input {
        padding: 0.7rem;
        font-size: 0.9rem;
    }

    .hero-buttons {
        width: 100%;
        justify-content: stretch;
    }

    .hero-buttons .btn {
        flex: 1;
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }

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

    .stat-card {
        padding: 1.5rem;
    }

    .stat-icon {
        font-size: 2rem;
    }

    .stat-content h3 {
        font-size: 1.5rem;
    }

    .content-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }

    .content-card img,
    .content-card .no-image {
        height: 200px;
    }

    .sync-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .sync-details {
        grid-template-columns: 1fr;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-buttons .btn {
        width: 180px;
        padding: 0.7rem 1.2rem;
    }

    .stat-card {
        padding: 1.5rem;
    }

    .stat-card h3 {
        font-size: 1.5rem;
    }

    .login-container {
        margin: 0.5rem auto;
        padding: 1rem;
    }

    .form-group input,
    .form-group textarea {
        padding: 0.7rem;
    }

    button {
        padding: 0.7rem;
        font-size: 0.95rem;
    }
}

/* Search Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 1000;
    padding-top: 5rem;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 90%;
    max-height: 70vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.modal-header h3 {
    margin: 0;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #333;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.search-placeholder {
    text-align: center;
    color: #666;
    padding: 2rem;
}

.search-loading {
    text-align: center;
    color: #666;
    padding: 2rem;
}

.search-results-grid {
    display: grid;
    gap: 1rem;
}

.search-result-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #eee;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: #f9f9f9;
}

.search-result-poster {
    flex-shrink: 0;
    width: 60px;
    height: 90px;
    border-radius: 4px;
    overflow: hidden;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-result-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-poster .no-poster {
    font-size: 0.8rem;
    color: #666;
}

.search-result-info {
    flex: 1;
}

.search-result-info h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.search-result-info h4 a {
    color: #333;
    text-decoration: none;
}

.search-result-info h4 a:hover {
    color: #00a4dc;
}

.search-result-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.search-result-overview {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

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

.error-message {
    background-color: #fee;
    color: #c33;
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid #fcc;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.modal-backdrop.hidden {
    display: none;
}

/* Service Status Styles */
.service-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.service-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #eee;
}

.service-icon {
    font-size: 2rem;
    width: 50px;
    text-align: center;
}

.service-info {
    flex: 1;
}

.service-info h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.1rem;
}

.status-online {
    color: #28a745;
    font-weight: 500;
}

.status-error {
    color: #dc3545;
    font-weight: 500;
}

.status-offline {
    color: #6c757d;
    font-weight: 500;
}

.service-details {
    margin: 0.25rem 0 0 0;
    font-size: 0.9rem;
    color: #666;
}