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

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #8b5cf6;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --border: #334155;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.search-section {
    margin-bottom: 3rem;
}

.search-box {
    display: flex;
    gap: 1rem;
    max-width: 700px;
    margin: 0 auto;
}

#searchInput {
    flex: 1;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

#searchInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

button {
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

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

.secondary-button {
    background: var(--surface-light);
    margin-bottom: 1.5rem;
}

.secondary-button:hover {
    background: var(--surface);
}

.loading {
    text-align: center;
    padding: 3rem;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border: 4px solid var(--surface-light);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.hidden {
    display: none !important;
}

.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
}

.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.movie-card {
    background: var(--surface);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.movie-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
    border-color: var(--primary-color);
}

.movie-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    background: var(--surface-light);
}

.movie-info {
    padding: 1.5rem;
}

.movie-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.movie-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.movie-overview {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-available {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.status-pending {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.status-processing {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.request-button {
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.request-button:disabled {
    background: var(--surface-light);
    cursor: not-allowed;
    transform: none;
}

.request-button:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--surface);
    border-radius: 20px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 2px solid var(--border);
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--surface-light);
    transition: all 0.3s ease;
}

.close:hover {
    background: var(--primary-color);
    color: white;
}

.modal-header {
    position: relative;
    height: 400px;
    background-size: cover;
    background-position: center;
    border-radius: 20px 20px 0 0;
}

.modal-backdrop {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), transparent);
}

.modal-body {
    padding: 2rem;
}

.modal-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.modal-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.modal-overview {
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

.recent-requests-section {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
}

.recent-requests-section h2 {
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

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

.request-item {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.request-item:hover {
    border-color: var(--primary-color);
}

.request-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.request-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .search-box {
        flex-direction: column;
    }

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

    .modal-content {
        width: 95%;
    }

    .modal-header {
        height: 250px;
    }

    .modal-title {
        font-size: 1.5rem;
    }
}
