:root {
    --primary-color: #1e3a8a;
    --secondary-color: #3b82f6;
    --accent-color: #f97316;
    --background-color: #f9fafb;
    --card-bg: #ffffff;
    
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-light: #f9fafb;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

[data-theme="dark"] {
    --primary-color: #1e40af;
    --secondary-color: #60a5fa;
    --accent-color: #fb923c;
    --background-color: #111827;
    --card-bg: #1f2937;
    
    --text-primary: #f3f4f6;
    --text-secondary: #e5e7eb;
    --text-light: #f9fafb;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    transition: all var(--transition-normal);
    line-height: 1.6;
}

header {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    backdrop-filter: blur(10px);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: var(--primary-color);
    color: var(--text-light);
    box-shadow: var(--shadow-md);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 1.5rem;
    color: var(--accent-color);
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

h1 span {
    font-weight: 300;
    opacity: 0.9;
}

.nav-buttons {
    display: flex;
    gap: 0.75rem;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.875rem;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.nav-btn.active {
    background: var(--secondary-color);
    box-shadow: var(--shadow-sm);
}

.header-controls {
    display: flex;
    gap: 0.75rem;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

button {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
}

main {
    position: relative;
    min-height: calc(100vh - 70px);
}

.picker-section {
    display: none;
    padding: 2rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.picker-section.active {
    display: block;
    animation: fadeIn var(--transition-normal);
}

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

.picker-card {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 2fr;
    transition: all var(--transition-normal);
}

.picker-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.media-poster {
    height: 100%;
    overflow: hidden;
    position: relative;
}

.media-poster::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    opacity: 0.5;
}

.media-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.picker-card:hover .media-poster img {
    transform: scale(1.05);
}

.media-details {
    padding: 2rem;
    position: relative;
}

.media-details h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.2;
    color: var(--text-primary);
}

.meta-info {
    display: flex;
    gap: 0.75rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.05);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.meta-item:hover {
    background: rgba(0, 0, 0, 0.1);
}

.description {
    margin: 1.5rem 0;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.action-buttons button {
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: var(--radius-full);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pick-another {
    background: var(--secondary-color);
    color: white;
}

.pick-another:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

.save-favorite {
    background: var(--accent-color);
    color: white;
}

.save-favorite:hover {
    background: #ea580c;
    transform: translateY(-2px);
}

.watch-trailer {
    background: #ef4444;
    color: white;
}

.watch-trailer:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

#favorites-sidebar {
    position: fixed;
    right: -350px;
    top: 0;
    width: 350px;
    height: 100%;
    background: var(--card-bg);
    box-shadow: var(--shadow-lg);
    transition: right var(--transition-normal);
    padding: 0;
    z-index: 200;
    overflow-y: auto;
}

#favorites-sidebar.active {
    right: 0;
}

.favorites-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--primary-color);
    color: var(--text-light);
}

.favorites-header h2 {
    font-size: 1.25rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#favorites-list {
    padding: 1rem;
}

.favorite-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin: 0.75rem 0;
    background: rgba(0, 0, 0, 0.03);
    border-radius: var(--radius-md);
    position: relative;
    transition: all var(--transition-fast);
}

.favorite-item:hover {
    background: rgba(0, 0, 0, 0.06);
    transform: translateX(-5px);
}

.favorite-item img {
    width: 60px;
    height: 90px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.favorite-item h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.favorite-item small {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.remove-favorite {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: var(--radius-full);
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0;
}

.remove-favorite:hover {
    background: #ef4444;
    color: white;
}

.no-fav-image {
    width: 60px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-align: center;
}

.error {
    padding: 2rem;
    text-align: center;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    max-width: 600px;
    margin: 2rem auto;
}

.error h2 {
    color: #ef4444;
    margin-bottom: 1rem;
}

.retry-button {
    background: var(--secondary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-full);
    margin-top: 1.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.retry-button:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

.no-poster {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.05) 100%);
    color: var(--text-secondary);
    font-size: 1rem;
    text-align: center;
    padding: 2rem;
}

.no-cover {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.05) 100%);
    color: var(--text-secondary);
    font-size: 1rem;
    text-align: center;
    padding: 2rem;
}

@media (max-width: 992px) {
    .picker-card {
        grid-template-columns: 1fr;
    }
    
    .media-poster {
        height: 300px;
    }
    
    .media-details {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .nav-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .header-controls {
        position: absolute;
        top: 1rem;
        right: 1rem;
    }
    
    .picker-section {
        padding: 1rem 0.5rem;
    }
    
    .media-poster {
        height: 250px;
    }
    
    .media-details h2 {
        font-size: 1.5rem;
    }
    
    .description {
        -webkit-line-clamp: 3;
    }
    
    .action-buttons {
        justify-content: center;
    }
    
    #favorites-sidebar {
        width: 100%;
        right: -100%;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.25rem;
    }
    
    .nav-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .icon-btn {
        width: 2rem;
        height: 2rem;
    }
    
    .media-poster {
        height: 200px;
    }
    
    .media-details {
        padding: 1rem;
    }
    
    .media-details h2 {
        font-size: 1.25rem;
    }
    
    .meta-info {
        gap: 0.5rem;
    }
    
    .meta-item {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .action-buttons button {
        width: 100%;
        justify-content: center;
    }
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
}

.meta-item i {
    transition: transform var(--transition-fast);
}

.meta-item:hover i {
    transform: scale(1.2);
}

button:focus-visible {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}
