/* أنماط محسنة للمشغل والواجهة */

/* تحسينات المشغل */
.video-container {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.video-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: white;
    text-align: center;
    font-size: 1.1rem;
}

/* رسائل الخطأ المحسنة */
.hls-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(220, 53, 69, 0.95);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    z-index: 100;
    max-width: 350px;
    box-shadow: 0 8px 32px rgba(220, 53, 69, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hls-error i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    display: block;
    animation: pulse 2s infinite;
}

.hls-error button {
    margin-top: 15px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hls-error button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* زر التشغيل المحسن */
.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(59, 130, 246, 0.95);
    color: white;
    padding: 20px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 50;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.4);
    backdrop-filter: blur(10px);
}

.play-button:hover {
    background: rgba(59, 130, 246, 1);
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 12px 40px rgba(59, 130, 246, 0.6);
}

.play-button i {
    margin-right: 8px;
}

/* أزرار التحكم المحسنة */
.video-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.control-btn:active {
    transform: translateY(0);
}

.control-btn i {
    font-size: 1rem;
}

/* أزرار التزامن */
.sync-controls {
    display: flex;
    gap: 5px;
    margin: 10px 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.sync-controls .control-btn {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #059669;
    font-size: 0.9rem;
    padding: 6px 10px;
}

.sync-controls .control-btn:hover {
    background: rgba(16, 185, 129, 0.2);
    color: #047857;
}

.sync-controls .control-btn.active {
    background: #10b981;
    color: white;
    border-color: #059669;
}

/* مؤشر حالة التزامن */
.sync-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.sync-status.enabled {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.sync-status.disabled {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.sync-status i {
    font-size: 0.7rem;
    animation: spin 2s linear infinite;
}

.sync-status.disabled i {
    animation: none;
}

/* مؤشر جودة الاتصال */
.connection-quality {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 12px;
    font-size: 0.8rem;
    z-index: 10;
}

.connection-quality.excellent {
    color: #10b981;
}

.connection-quality.good {
    color: #f59e0b;
}

.connection-quality.poor {
    color: #ef4444;
}

.connection-quality i {
    font-size: 0.7rem;
}

/* مؤشر التحميل المحسن */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: rgba(255, 255, 255, 0.8);
}

.loading-spinner i {
    font-size: 2.5rem;
    animation: spin 1s linear infinite;
}

.loading-spinner span {
    font-size: 1.1rem;
    font-weight: 500;
}

/* رسائل الحالة */
.status-message {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 20;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.status-message.success {
    background: rgba(16, 185, 129, 0.9);
}

.status-message.warning {
    background: rgba(245, 158, 11, 0.9);
}

.status-message.error {
    background: rgba(239, 68, 68, 0.9);
}

/* تحسينات الاستجابة */
@media (max-width: 768px) {
    .video-controls {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .control-btn {
        padding: 6px 8px;
        font-size: 0.9rem;
    }
    
    .sync-controls {
        margin: 5px 0;
        padding: 5px;
    }
    
    .hls-error {
        max-width: 280px;
        padding: 15px;
    }
    
    .play-button {
        padding: 15px 25px;
        font-size: 1.1rem;
    }
}

/* تحسينات إضافية للواجهة */
.video-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.video-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

/* تحسينات قائمة الشاشات */
.screen-item {
    transition: all 0.3s ease;
    border-radius: 8px;
    margin-bottom: 8px;
}

.screen-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.screen-item.active {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    color: white;
    transform: translateX(5px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
}

/* تحسينات الخريطة */
.map-container {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.location-details {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.location-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #4b5563;
}

.location-icon {
    color: #6b7280;
    width: 16px;
    text-align: center;
}

/* الرسوم المتحركة */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* تطبيق الرسوم المتحركة */
.video-container {
    animation: fadeIn 0.5s ease-out;
}

.screen-item {
    animation: slideIn 0.3s ease-out;
}

.status-message {
    animation: fadeIn 0.3s ease-out;
}

/* تحسينات إضافية للأداء */
.video-player {
    will-change: transform;
}

.control-btn {
    will-change: transform, background-color;
}

.screen-item {
    will-change: transform;
}

/* تحسينات الطباعة */
@media print {
    .video-container,
    .video-controls,
    .sync-controls {
        display: none;
    }
}

