/* TMDB-inspired design system */
:root {
    /* TMDB Color System */
    --background: 0 0% 100%; /* Clean white background */
    --foreground: 220 13% 18%; /* Dark blue-gray text */
    
    --card: 0 0% 100%; /* White cards */
    --card-foreground: 220 13% 18%;
    
    --popover: 0 0% 100%;
    --popover-foreground: 220 13% 18%;
    
    --primary: 204 100% 40%; /* TMDB blue #0080d7 */
    --primary-foreground: 0 0% 100%;
    
    --secondary: 220 13% 95%; /* Light gray */
    --secondary-foreground: 220 13% 18%;
    
    --muted: 220 13% 95%; /* Muted background */
    --muted-foreground: 220 13% 46%; /* Muted text */
    
    --accent: 204 100% 95%; /* Light blue accent */
    --accent-foreground: 204 100% 40%;
    
    --destructive: 0 84% 60%; /* Red for destructive actions */
    --destructive-foreground: 0 0% 98%;
    
    --border: 220 13% 91%; /* Light border */
    --input: 220 13% 95%; /* Input background */
    --ring: 204 100% 40%; /* Focus ring - TMDB blue */
    
    --radius: 0.5rem; /* Medium radius */
    
    /* TMDB specific colors */
    --tmdb-blue: 204 100% 40%;
    --tmdb-dark-blue: 204 100% 35%;
    --tmdb-light-blue: 204 100% 95%;
    --tmdb-gray: 220 13% 95%;
    --tmdb-dark-gray: 220 13% 18%;
    --tmdb-text: 220 13% 18%;
}

/* Global styles */
* {
    border-color: hsl(var(--border));
}

body {
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-feature-settings: "rlig" 1, "calt" 1;
    line-height: 1.6;
}

/* TMDB Button component */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    gap: 0.5rem;
    height: 2.5rem;
    padding: 0 1rem;
}

.btn:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
}

.btn:disabled {
    pointer-events: none;
    opacity: 0.5;
}

/* Button variants */
.btn-primary {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    box-shadow: 0 1px 2px rgba(0, 128, 215, 0.2);
}

.btn-primary:hover {
    background-color: hsl(var(--tmdb-dark-blue));
    box-shadow: 0 2px 4px rgba(0, 128, 215, 0.3);
}

.btn-secondary {
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    border: 1px solid hsl(var(--border));
}

.btn-secondary:hover {
    background-color: hsl(var(--muted));
}

.btn-outline {
    border: 1px solid hsl(var(--primary));
    color: hsl(var(--primary));
    background-color: transparent;
}

.btn-outline:hover {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.btn-ghost {
    background-color: transparent;
    color: hsl(var(--foreground));
}

.btn-ghost:hover {
    background-color: hsl(var(--muted));
}

/* Button sizes */
.btn-sm {
    height: 2rem;
    padding: 0 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    height: 3rem;
    padding: 0 1.5rem;
    font-size: 1rem;
}

.btn-icon {
    height: 2.5rem;
    width: 2.5rem;
    padding: 0;
}

/* TMDB Card component */
.card {
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    background-color: hsl(var(--card));
    color: hsl(var(--card-foreground));
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.2;
    color: hsl(var(--foreground));
}

.card-description {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.5;
}

.card-content {
    padding: 1.5rem;
    padding-top: 0;
}

.card-footer {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    padding-top: 0;
}

/* TMDB Badge component */
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    transition: colors 0.2s;
    border: 1px solid transparent;
}

.badge-primary {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.badge-secondary {
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
}

.badge-outline {
    color: hsl(var(--foreground));
    border-color: hsl(var(--border));
    background-color: transparent;
}

/* TMDB Movie Card */
.movie-card {
    background: hsl(var(--card));
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid hsl(var(--border));
    transition: all 0.3s ease;
    cursor: pointer;
}

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

.movie-poster {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
}

.movie-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.movie-info {
    padding: 1rem;
}

.movie-title {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.25rem;
    color: hsl(var(--foreground));
}

.movie-date {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
}

.movie-rating {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Typography */
.text-2xl {
    font-size: 1.5rem;
    line-height: 2rem;
}

.text-3xl {
    font-size: 1.875rem;
    line-height: 2.25rem;
}

.text-4xl {
    font-size: 2.25rem;
    line-height: 2.5rem;
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

/* Layout utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.grid {
    display: grid;
}

.flex {
    display: flex;
}

.hidden {
    display: none;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.gap-8 {
    gap: 2rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.py-8 {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.py-12 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* TMDB specific components */
.tmdb-header {
    background: hsl(var(--card));
    border-bottom: 1px solid hsl(var(--border));
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tmdb-nav {
    height: 4rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.tmdb-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: hsl(var(--primary));
    text-decoration: none;
}

.tmdb-nav-link {
    color: hsl(var(--foreground));
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.tmdb-nav-link:hover {
    color: hsl(var(--primary));
}

.tmdb-search {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.tmdb-search input {
    width: 100%;
    height: 2.5rem;
    padding: 0 1rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    transition: border-color 0.2s ease;
}

.tmdb-search input:focus {
    outline: none;
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1);
}

.tmdb-hero {
    background: linear-gradient(135deg, hsl(var(--primary)) 0%, hsl(var(--tmdb-dark-blue)) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.tmdb-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.tmdb-hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.tmdb-section {
    padding: 3rem 0;
}

.tmdb-section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: hsl(var(--foreground));
}

.tmdb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
}

/* Responsive design */
@media (min-width: 640px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .tmdb-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (min-width: 768px) {
    .tmdb-nav {
        gap: 3rem;
    }
    
    .tmdb-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 2rem;
    }
    
    .tmdb-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

/* Loading states */
.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Skeleton loaders */
.skeleton {
    background: linear-gradient(90deg, hsl(var(--muted)) 25%, hsl(var(--muted) / 0.5) 50%, hsl(var(--muted)) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: hsl(var(--muted));
}

::-webkit-scrollbar-thumb {
    background: hsl(var(--muted-foreground));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: hsl(var(--foreground));
}