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

body {
    font-family: 'Arial', 'Noto Sans Hebrew', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #e2e8f0;
    direction: rtl;
    text-align: right;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

h1 {
    color: #f1f5f9;
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.translate-link {
    display: inline-block;
    margin-bottom: 20px;
    padding: 8px 16px;
    background: rgba(33, 150, 243, 0.2);
    color: #2196F3;
    text-decoration: none;
    border-radius: 20px;
    border: 1px solid rgba(33, 150, 243, 0.3);
    transition: all 0.3s ease;
}

.translate-link:hover {
    background: rgba(33, 150, 243, 0.3);
    transform: translateY(-1px);
}

.search-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.search-row {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.translating-indicator {
    position: absolute;
    right: 10px;
    font-size: 16px;
    animation: spin 1s linear infinite;
}

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

#searchInput {
    padding: 12px 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    font-size: 16px;
    background: rgba(30, 41, 59, 0.8);
    color: #f1f5f9;
    min-width: 300px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    direction: rtl;
    text-align: right;
}

#searchInput:focus {
    outline: none;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.5);
    border-color: rgba(59, 130, 246, 0.8);
    transform: translateY(-2px);
}

#searchInput::placeholder {
    color: rgba(241, 245, 249, 0.6);
}

#typeFilter option {
    background: #1e293b;
    color: #f1f5f9;
}

#searchBtn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

#searchBtn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

#typeFilter {
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    font-size: 16px;
    background: rgba(30, 41, 59, 0.8);
    color: #f1f5f9;
    min-width: 140px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    direction: rtl;
    text-align: right;
}

#typeFilter:focus {
    outline: none;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.5);
    border-color: rgba(59, 130, 246, 0.8);
    transform: translateY(-2px);
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.3);
    color: #e2e8f0;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.filter-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-color: #3b82f6;
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.movie-type {
    color: #10b981;
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.movie-card {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    cursor: pointer;
}

.movie-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
    border-color: rgba(59, 130, 246, 0.3);
}

.movie-poster {
    position: relative;
    overflow: hidden;
    height: 400px;
}

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

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

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.movie-card:hover .play-overlay {
    opacity: 1;
}

.play-button {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #333;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.play-button:hover {
    background: white;
    transform: scale(1.1);
}

.movie-info {
    padding: 20px;
    text-align: right;
    direction: rtl;
}

.movie-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: #f1f5f9;
    margin-bottom: 8px;
    line-height: 1.3;
}

.movie-year {
    color: #94a3b8;
    font-size: 1rem;
    margin-bottom: 5px;
}

.movie-genre {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 8px;
    font-style: italic;
}

.movie-rating {
    color: #f59e0b;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1rem;
}

.movie-plot {
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.2rem;
    color: #f1f5f9;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    margin: 20px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.error {
    text-align: center;
    padding: 40px;
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid #ef4444;
    border-radius: 15px;
    margin: 20px 0;
    color: #fca5a5;
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .search-container {
        flex-direction: column;
        align-items: center;
    }
    
    #searchInput {
        min-width: 250px;
        width: 100%;
        max-width: 400px;
    }
    
    .movie-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .movie-card {
        margin: 0 auto;
        max-width: 300px;
    }
    
    .movie-poster {
        height: 350px;
    }
    
    .movie-info {
        padding: 15px;
    }
    
    .movie-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 20px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    #searchInput {
        min-width: 200px;
    }
    
    .movie-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .movie-poster {
        height: 300px;
    }
    
    .search-row {
        flex-direction: column;
        align-items: center;
    }
    
    #typeFilter {
        min-width: 200px;
        width: 100%;
        max-width: 400px;
    }

    .filter-buttons {
        gap: 8px;
    }

    .filter-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
}

.loading-more {
    text-align: center;
    padding: 20px;
    margin: 20px 0;
    color: #f1f5f9;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(241, 245, 249, 0.3);
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px auto;
}

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

.no-more-content {
    text-align: center;
    padding: 20px;
    margin: 20px 0;
    color: rgba(241, 245, 249, 0.6);
    font-style: italic;
}

.series-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    direction: rtl;
}

.modal-content {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    max-width: 800px;
    max-height: 80vh;
    width: 90%;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #f1f5f9;
    border-radius: 15px 15px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #f1f5f9;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.close-modal:hover {
    background: rgba(59, 130, 246, 0.3);
}

.season-info {
    padding: 20px;
    background: rgba(30, 41, 59, 0.5);
}

.season-info h3 {
    color: #f1f5f9;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.episodes-count {
    color: #94a3b8;
    margin-bottom: 20px;
    font-weight: bold;
}

.episode-card {
    background: rgba(51, 65, 85, 0.6);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    border-right: 4px solid #3b82f6;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.clickable-episode {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.episode-card:hover {
    background: rgba(71, 85, 105, 0.8);
    transform: translateX(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border-color: rgba(59, 130, 246, 0.3);
}

.episode-info h4 {
    color: #f1f5f9;
    margin: 0 0 8px 0;
    font-size: 1.1rem;
}

.episode-date {
    color: #94a3b8;
    font-size: 0.9rem;
    margin: 5px 0;
}


.episode-rating {
    color: #f59e0b;
    font-weight: bold;
    margin: 5px 0 0 0;
}

.episode-play-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 50%;
    margin-right: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
}

.episode-play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.5);
}

.play-icon {
    color: white;
    font-size: 16px;
    margin-right: 2px;
}

.episode-info {
    flex: 1;
}

.clickable-episode:hover .episode-play-btn {
    transform: scale(1.15);
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

.season-actions-top {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(30, 41, 59, 0.3);
    text-align: center;
}

.season-actions {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(30, 41, 59, 0.5);
    border-radius: 0 0 15px 15px;
    text-align: center;
}

.watch-series-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.watch-series-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
    
    .season-info {
        padding: 15px;
    }
    
    .episode-card {
        padding: 12px;
    }
    
    .season-actions {
        padding: 15px;
    }
}

/* Video Player Overlay */
.video-player-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.player-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 10000;
}

.player-control-btn {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.player-control-btn:hover {
    background: rgba(59, 130, 246, 0.8);
    border-color: #3b82f6;
    transform: scale(1.1);
}

.close-player span {
    font-size: 24px;
}

.new-window-btn span {
    font-size: 18px;
}

.video-player-container {
    width: 90vw;
    height: 80vh;
    max-width: 1200px;
    max-height: 700px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.video-player-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Mobile responsiveness for player */
@media (max-width: 768px) {
    .video-player-container {
        width: 95vw;
        height: 70vh;
    }
    
    .player-controls {
        top: 10px;
        right: 10px;
        gap: 8px;
    }
    
    .player-control-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}