/* Custom CSS for Abdullah Al-Sarem Live TV Website */

/* Root Variables */
:root {
    --primary-color: #1d4ed8;
    --primary-dark: #1e3a8a;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --light-gray: #f8fafc;
    --medium-gray: #64748b;
    --dark-gray: #334155;
    --border-radius: 0.5rem;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Arabic Font Optimization */
body {
    font-family: 'Cairo', 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    scroll-behavior: smooth;
}

/* RTL Support */
[dir="rtl"] {
    text-align: right;
}

/* Custom Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.8);
    }
}

@keyframes live-indicator {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Header Enhancements */
.header-blur {
    backdrop-filter: blur(10px);
    background: rgba(29, 78, 216, 0.95);
}

/* Hero Section Animations */
.hero-content {
    animation: fadeInUp 1s ease-out;
}

/* Channel Cards */
.channel-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    overflow: hidden;
    position: relative;
}

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

.channel-card .channel-logo {
    width: 100%;
    height: 120px;
    object-fit: contain;
    padding: 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

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

.channel-card .channel-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 0.5rem;
}

.channel-card .channel-category {
    font-size: 0.875rem;
    color: var(--medium-gray);
    margin-bottom: 0.75rem;
}

.channel-card .live-indicator {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: var(--success-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    animation: live-indicator 2s infinite;
}

.channel-card .quality-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--info-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.channel-card .play-button {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: var(--primary-color);
    color: white;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
    opacity: 0;
}

.channel-card:hover .play-button {
    opacity: 1;
    transform: scale(1.1);
}

.channel-card .play-button:hover {
    background: var(--primary-dark);
    animation: pulse-glow 1s infinite;
}

/* Category Cards Enhancements */
.category-card {
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: var(--transition);
}

.category-card:hover::before {
    opacity: 1;
}

.category-card:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Search and Filter Section */
.search-filter-section {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
}

.filter-input {
    transition: var(--transition);
}

.filter-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Video Modal Enhancements */
.video-modal {
    backdrop-filter: blur(5px);
}

.video-modal .modal-content {
    animation: fadeInUp 0.3s ease-out;
}

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
}

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

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

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

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Back to Top Button */
#back-to-top {
    transition: var(--transition);
}

#back-to-top.visible {
    transform: translateY(0);
    opacity: 1;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .channel-card .channel-logo {
        height: 100px;
    }
    
    .category-card {
        padding: 1rem;
    }
    
    .hero-content h2 {
        font-size: 2.5rem;
    }
}

@media (max-width: 640px) {
    .channel-card .channel-logo {
        height: 80px;
    }
    
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .search-filter-section {
        padding: 1rem;
    }
}

/* Video Player Customization */
.video-js {
    font-family: 'Cairo', 'Tajawal', Arial, sans-serif;
}

.video-js .vjs-big-play-button {
    background: rgba(59, 130, 246, 0.9);
    border: none;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    line-height: 80px;
    margin-top: -40px;
    margin-left: -40px;
}

.video-js .vjs-big-play-button:hover {
    background: rgba(59, 130, 246, 1);
}

/* Country Flags */
.country-flag {
    width: 24px;
    height: 16px;
    display: inline-block;
    margin-left: 0.5rem;
    border-radius: 2px;
    vertical-align: middle;
}

/* Status Indicators */
.status-online {
    color: var(--success-color);
}

.status-offline {
    color: var(--danger-color);
}

.status-loading {
    color: var(--warning-color);
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Styles */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .channel-card {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
}

/* Dark Mode Support (Future Enhancement) */
@media (prefers-color-scheme: dark) {
    .dark-mode-ready {
        --bg-primary: #1f2937;
        --bg-secondary: #374151;
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .channel-card {
        border: 2px solid #000;
    }
    
    .category-card {
        border: 2px solid #fff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-screen .spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #e2e8f0;
    border-top: 6px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error States */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

.success-message {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

/* Tooltip Styles */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 140px;
    background-color: #555;
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 150%;
    left: 50%;
    margin-left: -70px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Progressive Enhancement */
.no-js .js-only {
    display: none;
}

.js .no-js-only {
    display: none;
}