/* تعطيل الصفحة عند فرض تسجيل الدخول */
body.force-login .container,
body.force-login header,
body.force-login .main-content,
body.force-login aside,
body.force-login .video-section,
body.force-login .map-section {
    pointer-events: none;
    filter: blur(2px) grayscale(0.2);
    user-select: none;
    opacity: 0.5;
}
body.force-login #loginModal {
    pointer-events: auto;
    filter: none;
    opacity: 1;
}
:root {
    --primary-color: #1e3a8a;
    --secondary-color: #64748b;
    --accent-color: #10b981;
    --background-color: #f8fafc;
    --card-background: #ffffff;
    --border-color: #e2e8f0;
    --text-color: #1e293b;
    --light-text-color: #64748b;
    --header-bg: linear-gradient(135deg, #1e3a8a 0%, #3730a3 100%);
    --button-hover-bg: #1e40af;
    --shadow-light: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-large: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --online-color: #10b981;
    --offline-color: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding-top: 70px;
    background-color: var(--background-color);
    color: var(--text-color);
    direction: rtl;
    text-align: right;
    overflow-x: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 70px);
}

/* Header Styles */
.header {
    background: var(--header-bg);
    color: white;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: var(--shadow-medium);
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.5rem;
    font-weight: bold;
}

.logo img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.nav-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Dropdown Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 250px;
    box-shadow: var(--shadow-large);
    z-index: 1001;
    border-radius: 8px;
    overflow: hidden;
    top: 100%;
    right: 0;
    margin-top: 5px;
}

.dropdown-content.show {
    display: block;
}

.dropdown-item {
    color: var(--text-color);
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.3s ease;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-item:hover {
    background-color: var(--background-color);
}

.dropdown-item:last-child {
    border-bottom: none;
}

/* User Menu Styles */
.user-menu {
    position: relative;
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.user-dropdown {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 200px;
    box-shadow: var(--shadow-large);
    z-index: 1001;
    border-radius: 8px;
    overflow: hidden;
    top: 100%;
    left: 0;
    margin-top: 5px;
}

.user-dropdown.show {
    display: block;
}

.user-info {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    background: var(--background-color);
}

.user-name {
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 5px;
}

.user-email {
    font-size: 0.9rem;
    color: var(--light-text-color);
}

/* Main Content Layout */
.main-content {
    display: flex;
    flex: 1;
    gap: 20px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: var(--shadow-light);
    padding: 20px;
    height: fit-content;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
}

.sidebar h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.screen-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.screen-item {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.screen-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.screen-item.active {
    border-color: var(--primary-color);
    background: rgba(30, 58, 138, 0.05);
}

.screen-name {
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 5px;
}

.screen-location {
    color: var(--light-text-color);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.screen-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-online {
    background-color: var(--online-color);
}

.status-offline {
    background-color: var(--offline-color);
}

.screen-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--light-text-color);
}

/* Main Video Area */
.video-section {
    flex: 1;
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: var(--shadow-light);
    overflow: hidden;
}

.video-header {
    background: var(--primary-color);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.video-title {
    font-size: 1.2rem;
    font-weight: bold;
}

.video-controls {
    display: flex;
    gap: 10px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.video-container {
    position: relative;
    width: 100%;
    height: 400px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-placeholder {
    color: #666;
    font-size: 1.1rem;
    text-align: center;
}

.video-info {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: none;
}

.video-description {
    color: var(--light-text-color);
    margin-bottom: 10px;
}

.video-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.action-btn {
    background: none;
    border: none;
    color: var(--light-text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: var(--background-color);
    color: var(--primary-color);
}

.action-btn.liked {
    color: var(--accent-color);
}

/* Suggested Videos */
.suggested-videos {
    padding: 20px;
}

.suggested-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--text-color);
}

.suggested-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.suggested-item {
    background: var(--background-color);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.suggested-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.suggested-thumbnail {
    width: 100%;
    height: 120px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 0.9rem;
}

.suggested-info {
    padding: 10px;
}

.suggested-name {
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.suggested-type {
    color: var(--light-text-color);
    font-size: 0.8rem;
}

/* Map Section */
.map-section {
    width: 350px;
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: var(--shadow-light);
    overflow: hidden;
}

.map-header {
    background: var(--accent-color);
    color: white;
    padding: 15px 20px;
    font-weight: bold;
}

.map-container {
    height: 300px;
    position: relative;
}

#map {
    height: 100%;
    width: 100%;
}

.map-info {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
}

.location-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.location-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.location-icon {
    color: var(--accent-color);
    width: 16px;
}

/* Loading States */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--light-text-color);
}

.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Login Modal */
.login-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.login-modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-large);
    position: relative;
}

.close-modal {
    position: absolute;
    top: 15px;
    left: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--light-text-color);
}

.close-modal:hover {
    color: var(--text-color);
}

.login-title {
    text-align: center;
    margin-bottom: 25px;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.social-login {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-color);
}

.social-btn:hover {
    background: var(--background-color);
    transform: translateY(-2px);
}

.social-btn.google {
    border-color: #db4437;
    color: #db4437;
}

.social-btn.facebook {
    border-color: #4267B2;
    color: #4267B2;
}

.divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
    color: var(--light-text-color);
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    background: white;
    padding: 0 15px;
}

.email-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-label {
    font-weight: bold;
    color: var(--text-color);
}

.form-input {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.login-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s ease;
}

.login-btn:hover {
    background: var(--button-hover-bg);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar, .map-section {
        width: 100%;
    }
    
    .suggested-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    .header {
        padding: 10px 15px;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .nav-buttons {
        gap: 10px;
    }
    
    .nav-btn {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    .main-content {
        padding: 15px;
        gap: 15px;
    }
    
    .video-container {
        height: 250px;
    }
    
    .map-container {
        height: 200px;
    }

    .dropdown-content {
        min-width: 200px;
    }
}

/* إضافة هذه التعديلات في نهاية ملف index-style.css */

@media (max-width: 576px) {
    /* تعديلات الهيدر للجوال */
    .header {
        padding: 8px 10px;
    }
    
    .logo span {
        display: none;
    }
    
    .nav-buttons {
        gap: 8px;
    }
    
    .nav-btn span {
        display: none;
    }
    
    .nav-btn i {
        margin: 0;
    }
    
    .nav-btn:last-child {
        display: none; /* إخفاء زر ملء الشاشة في الجوال */
    }
    
    /* تعديلات المحتوى الرئيسي للجوال */
    .main-content {
        padding: 10px;
        gap: 10px;
    }
    
    .sidebar {
        display: none; /* إخفاء القائمة الجانبية في الجوال */
    }
    
    /* تعديل ترتيب العناصر في الجوال */
    .container {
        display: flex;
        flex-direction: column;
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .video-section {
        order: 1;
    }
    
    .suggested-videos {
        order: 2;
    }
    
    .map-section {
        order: 3;
    }
    
    .comments-section {
        order: 4;
    }
    
    /* تعديلات مشغل الفيديو للجوال */
    .video-container {
        height: 200px;
    }
    
    .video-controls {
        gap: 5px;
    }
    
    .control-btn {
        padding: 6px;
    }
    
    /* تعديلات الخريطة للجوال */
    .map-container {
        height: 250px;
    }
    
    /* تعديلات أزرار التفاعل */
    .video-actions {
        justify-content: space-around;
    }
    
    .action-btn {
        flex-direction: column;
        gap: 2px;
        font-size: 0.8rem;
        padding: 5px;
    }
    
    .action-btn i {
        font-size: 1.2rem;
    }
    
    /* تعديلات التعليقات للجوال */
    .comment-form {
        flex-direction: column;
    }
    
    .comment-submit {
        margin-top: 8px;
    }
}

/* إضافة تأثيرات للتفاعلات */
.action-btn.liked {
    animation: pulse 0.5s ease;
    color: var(--accent-color);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.action-btn:hover {
    transform: translateY(-2px);
}

/* تحسين ظهور أزرار التفاعل */
.video-info {
    display: block !important; /* إظهار قسم التفاعلات */
}

.video-actions {
    display: flex;
    gap: 10px;
    padding: 10px 0;
}

/* Comments Section */
.comments-section {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.comments-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.comment-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.comment-input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
}

.comment-submit {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.comment-submit:hover {
    background: var(--button-hover-bg);
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.comment-item {
    background: var(--background-color);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.comment-author {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.comment-text {
    color: var(--text-color);
    margin-bottom: 8px;
}

.comment-time {
    color: var(--light-text-color);
    font-size: 0.8rem;
}

.error-message {
    color: #dc3545;
    text-align: center;
    padding: 20px;
}
.error-message i {
    font-size: 2rem;
    margin-bottom: 10px;
}
.loading-spinner {
    color: #007bff;
}

/* إخفاء العنصر النائب للفيديو بشكل افتراضي لتجنب التداخل */
#videoPlaceholder {
    display: none;
}

.conversion-loader {
    text-align: center;
    padding: 30px;
    color: #555;
}

.conversion-loader i {
    font-size: 3rem;
    color: #007bff;
    margin-bottom: 15px;
    display: block;
}

.conversion-progress {
    width: 80%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    margin: 20px auto;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    border-radius: 4px;
    animation: progressAnimation 3s ease-in-out infinite;
}

@keyframes progressAnimation {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}