/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    cursor: none; /* إخفاء المؤشر الافتراضي */
}

/* إظهار المؤشر فقط عند التحويم على عناصر التحكم */
.controls:hover,
#status:hover,
.fullscreen-btn:hover,
.content-info:hover {
    cursor: default;
}

/* ==================== شريط الحالة ==================== */
#status {
    position: fixed;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.85);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 1000;
    border: 1px solid #3498db;
    min-width: 250px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    backdrop-filter: blur(5px);
    opacity: 1;
    transition: opacity 0.5s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#status.hidden {
    opacity: 0;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-icon {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-icon.connecting {
    background: #f39c12;
    animation: pulse 1.5s infinite;
}

.status-icon.online {
    background: #27ae60;
}

.status-icon.offline {
    background: #e74c3c;
}

/* ==================== منطقة المحتوى ==================== */
#content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

#default {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, rgba(0,0,0,0.9), rgba(44, 62, 80, 0.9));
    border-radius: 15px;
    border: 2px solid #3498db;
    color: white;
    max-width: 90%;
    box-shadow: 0 5px 30px rgba(52, 152, 219, 0.3);
}

#default h1 {
    color: #3498db;
    margin-bottom: 20px;
    font-size: 32px;
}

#default p {
    font-size: 18px;
    opacity: 0.8;
    margin: 10px 0;
}

#image {
    width: 100%;
    height: 100%;
    display: none;
    object-fit: fill;
}

#video {
    width: 100%;
    height: 100%;
    display: none;
    object-fit: fill;
}

@media screen and (orientation: landscape) {
    #image, #video {
        object-fit: fill; /* أو cover حسب رغبتك */
    }
}

/* أضف/عدل هذا في ملف CSS */

.media-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
}

.media-item {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: contain;
    
    /* الحالة الافتراضية: مخفي تماماً */
    opacity: 0;
    z-index: 1;
    
    /* هذا السطر هو المسؤول عن النعومة */
    transition: opacity 1.5s ease-in-out; 
    
    /* لإخفائه من القارئ عندما يكون شفافاً */
    pointer-events: none;
}

.media-item.active {
    /* الحالة النشطة: ظاهر تماماً */
    opacity: 1;
    z-index: 2;
    pointer-events: auto;
}

/* ==================== شريط التقدم ==================== */
#progress {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: rgba(255,255,255,0.1);
    z-index: 999;
}

#progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    width: 0%;
    transition: width 1s linear;
}

/* ==================== معلومات المحتوى ==================== */
.content-info {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 15px;
    border-radius: 10px;
    font-size: 14px;
    max-width: 300px;
    border: 1px solid #2ecc71;
    display: none;
    z-index: 998;
}

.content-info h4 {
    color: #2ecc71;
    margin-bottom: 10px;
    font-size: 16px;
}

/* ==================== عناصر التحكم ==================== */
.controls {
    position: fixed;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 10px;
    z-index: 1001;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.controls.hidden {
    opacity: 0;
}

.control-btn {
    background: rgba(0,0,0,0.8);
    color: white;
    border: 1px solid #3498db;
    border-radius: 5px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.control-btn:hover {
    background: #3498db;
}

/* ==================== زر ملء الشاشة ==================== */
.fullscreen-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: 1px solid #3498db;
    border-radius: 5px;
    padding: 10px 15px;
    cursor: pointer;
    z-index: 1002;
    font-size: 14px;
    transition: all 0.3s;
    opacity: 1;
}

.fullscreen-btn.hidden {
    opacity: 0;
}

.fullscreen-btn:hover {
    background: #3498db;
}

/* ==================== ANIMATIONS ==================== */
.loading {
    color: #3498db;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ==================== FULLSCREEN STYLES ==================== */
body:-webkit-full-screen {
    background: black;
}

body:-moz-full-screen {
    background: black;
}

body:-ms-fullscreen {
    background: black;
}

body:fullscreen {
    background: black;
}

/* ==================== KEEP ALIVE INDICATOR ==================== */
#keepAliveIndicator {
    position: fixed;
    bottom: 10px;
    right: 10px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #27ae60;
    opacity: 0.7;
    z-index: 999;
    animation: keepAlivePulse 2s infinite;
}

@keyframes keepAlivePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}