/* Custom Styles for AD2ER */

/* Animations */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fade-in 0.8s ease-out forwards;
}

/* Loading Skeletons */
.skeleton-card {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 0.5rem;
    height: 400px;
}

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

/* Movie/Series Card */
.media-card {
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: #1f2937;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.media-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 25px 50px rgba(234, 88, 12, 0.3);
    border: 2px solid rgba(234, 88, 12, 0.5);
}

.media-card img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.media-card:hover img {
    opacity: 0.7;
}

.media-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, transparent 100%);
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.media-card:hover .media-card-overlay {
    transform: translateY(0);
}

.media-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-card-meta {
    font-size: 0.875rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rating-badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.3), rgba(234, 88, 12, 0.1));
    border: 2px solid #ea580c;
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    box-shadow: 0 0 20px rgba(234, 88, 12, 0.3);
}

.watchlist-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(234, 88, 12, 0.3);
    padding: 0.75rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.watchlist-btn:hover {
    background: linear-gradient(135deg, #ea580c, #f97316);
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 0 25px rgba(234, 88, 12, 0.6);
}

.watchlist-btn.active {
    background: linear-gradient(135deg, #ea580c, #f97316);
    color: white;
    animation: heart-beat 0.5s ease;
}

@keyframes heart-beat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.watchlist-btn i {
    font-size: 1.25rem;
}

/* Search Filters */
.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #f3f4f6;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #4b5563;
    background: #374151;
    color: white;
    font-size: 1rem;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #ea580c;
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.1);
}

/* Genre Tags */
.genre-tag {
    display: inline-block;
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.2), rgba(234, 88, 12, 0.1));
    border: 1px solid #ea580c;
    padding: 0.375rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.genre-tag:hover {
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.4), rgba(234, 88, 12, 0.2));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.3);
}

/* Modal/Trailer */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: #1f2937;
    border-radius: 0.5rem;
    overflow: hidden;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.8);
    border: none;
    color: white;
    font-size: 2rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: #ea580c;
}

/* Cast/Crew Cards */
.cast-card {
    text-align: center;
    background: #374151;
    border-radius: 0.5rem;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.cast-card:hover {
    transform: translateY(-4px);
}

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

.cast-card-info {
    padding: 1rem;
}

.cast-card-name {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.cast-card-character {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Episode Card */
.episode-card {
    display: flex;
    gap: 1rem;
    background: #374151;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.episode-card:hover {
    transform: translateX(4px);
    background: #4b5563;
}

.episode-card img {
    width: 180px;
    height: 100px;
    object-fit: cover;
}

.episode-card-info {
    flex: 1;
    padding: 1rem;
}

.episode-number {
    font-size: 0.875rem;
    color: #ea580c;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.episode-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.episode-overview {
    font-size: 0.875rem;
    color: #9ca3af;
    line-height: 1.4;
}

/* Responsive Typography */
@media (max-width: 768px) {
    .media-card img {
        height: 300px;
    }
    
    .episode-card {
        flex-direction: column;
    }
    
    .episode-card img {
        width: 100%;
        height: 200px;
    }
}

/* RTL Support for Arabic */
html[dir="rtl"] .media-card-overlay,
html[dir="rtl"] .episode-card-info,
html[dir="rtl"] .cast-card-info {
    text-align: right;
}

html[dir="rtl"] .genre-tag {
    margin-right: 0;
    margin-left: 0.5rem;
}

html[dir="rtl"] .rating-badge {
    flex-direction: row-reverse;
}

/* Loading Spinner */
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top: 4px solid #ea580c;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

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

/* Error Message */
.error-message {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid #dc2626;
    color: #fca5a5;
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    margin: 2rem 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #9ca3af;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #d1d5db;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

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

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ea580c, #f97316);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #f97316, #fb923c);
}

/* Focus Styles for Accessibility */
button:focus,
a:focus,
input:focus,
select:focus {
    outline: 2px solid #ea580c;
    outline-offset: 2px;
}
