/* Custom styles for Film Recommendations */

/* Smooth animations */
* {
    transition: all 0.2s ease-in-out;
}

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

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Form focus states */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Button hover effects */
button:hover {
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

/* Loading animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Slide up animation */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #3b82f6, #f2740a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

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

/* Custom focus ring */
.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

/* Responsive text */
@media (max-width: 640px) {
    .text-responsive {
        font-size: 1.5rem;
    }
}

@media (min-width: 641px) {
    .text-responsive {
        font-size: 3rem;
    }
}

/* Loading spinner */
.spinner {
    border: 2px solid #f3f4f6;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success animation */
@keyframes checkmark {
    0% {
        stroke-dashoffset: 100;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

.checkmark {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: checkmark 0.6s ease-in-out forwards;
}

/* Error shake animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Custom button styles */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Film card styles */
.film-card {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.film-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Film image styles */
.film-image {
    transition: transform 0.3s ease;
}

.film-card:hover .film-image {
    transform: scale(1.05);
}

/* Image loading animation */
@keyframes imageLoad {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.film-image.loaded {
    animation: imageLoad 0.3s ease-out;
}

/* Placeholder image styles */
.film-placeholder {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 0.75rem;
    text-align: center;
}

/* Example query button styles */
.example-query {
    position: relative;
    overflow: hidden;
}

.example-query::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s;
}

.example-query:hover::before {
    left: 100%;
}

/* Responsive design improvements */
@media (max-width: 640px) {
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .text-5xl {
        font-size: 2rem;
        line-height: 2.25rem;
    }
    
    .text-4xl {
        font-size: 1.875rem;
        line-height: 2.25rem;
    }
    
    .text-3xl {
        font-size: 1.5rem;
        line-height: 2rem;
    }
    
    .text-xl {
        font-size: 1.125rem;
        line-height: 1.75rem;
    }
    
    .text-lg {
        font-size: 1rem;
        line-height: 1.5rem;
    }
    
    /* Mobile-specific spacing */
    .py-12 {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    .mb-12 {
        margin-bottom: 2rem;
    }
    
    .mb-8 {
        margin-bottom: 1.5rem;
    }
    
    /* Mobile form improvements */
    .rounded-2xl {
        border-radius: 1rem;
    }
    
    .rounded-xl {
        border-radius: 0.75rem;
    }
    
    /* Better touch targets */
    button, .example-query {
        min-height: 44px;
    }
    
    /* Improved text wrapping */
    .break-words {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .text-5xl {
        font-size: 2.5rem;
        line-height: 2.75rem;
    }
}

@media (min-width: 769px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* Additional mobile optimizations */
@media (max-width: 640px) {
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }
    
    /* Better form input handling */
    input, textarea, select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Improved button interactions */
    button:active {
        transform: scale(0.98);
    }
    
    /* Better focus states for touch devices */
    button:focus,
    .example-query:focus {
        outline: 2px solid #3b82f6;
        outline-offset: 2px;
    }
    
    /* Smooth scrolling for mobile */
    html {
        scroll-behavior: smooth;
    }
    
    /* Better text selection */
    ::selection {
        background-color: #3b82f6;
        color: white;
    }
}

/* Tablet optimizations */
@media (min-width: 641px) and (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    /* Better spacing for tablets */
    .py-12 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
}

/* Large screen optimizations */
@media (min-width: 1025px) {
    .container {
        max-width: 1280px;
    }
    
    /* Better hover effects for desktop */
    .film-card:hover {
        transform: translateY(-4px) scale(1.02);
    }
    
    .example-query:hover {
        transform: translateY(-2px);
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .dark-mode {
        background-color: #1f2937;
        color: #f9fafb;
    }
}
