/* Custom Video Player Styles */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans Arabic', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

/* Header */
.room-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px 0;
    margin-bottom: 20px;
}

.room-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.back-btn {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-2px);
}

.room-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.username {
    color: white;
    font-weight: 600;
}

.player-badge {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Main content */
.room-main {
    padding: 20px 0;
}

.room-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Video Section */
.video-section {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.custom-video-container {
    position: relative;
    width: 100%;
    background: #000;
    aspect-ratio: 16/9;
}

.custom-video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Custom Controls Overlay */
.custom-video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-video-container:hover .custom-video-controls {
    opacity: 1;
}

.progress-container {
    margin-bottom: 15px;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    cursor: pointer;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s ease;
}

.progress-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.progress-bar:hover .progress-handle {
    opacity: 1;
}

.time-display {
    color: white;
    font-size: 0.9rem;
    text-align: center;
}

.controls-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

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

.volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-slider {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

.sync-status {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    background: rgba(76, 175, 80, 0.8);
    color: white;
}

.sync-status.info {
    background: rgba(33, 150, 243, 0.8);
}

.sync-status.warning {
    background: rgba(255, 152, 0, 0.8);
}

.sync-status.success {
    background: rgba(76, 175, 80, 0.8);
}

/* Loading and Placeholder */
.video-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 10;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #4ecdc4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

.video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding: 40px;
    z-index: 5;
}

.video-placeholder i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.8;
}

.video-placeholder h3 {
    font-size: 2rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.video-placeholder p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    opacity: 0.9;
    max-width: 500px;
}

.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    padding: 40px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 400px;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: #4ecdc4;
    background: rgba(78, 205, 196, 0.1);
}

.upload-area i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.7;
}

.url-input-container {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 500px;
}

#video-url-input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 1rem;
}

.load-btn {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    border: none;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.load-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Chat Section */
.chat-section {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    height: 600px;
}

.chat-header {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
}

.user-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f8f9fa;
}

.message {
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.message .username {
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.message .text {
    color: #333;
    line-height: 1.4;
}

.system-message {
    text-align: center;
    padding: 10px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border-radius: 10px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.chat-input {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
}

#message-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

#message-input:focus {
    border-color: #667eea;
}

#send-message {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border: none;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#send-message:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Users Section */
.users-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.users-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 700;
}

.users-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.user-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.user-item.host {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #333;
}

.user-item i {
    color: #667eea;
}

.user-item.host i {
    color: #d4af37;
}

.user-role {
    margin-left: auto;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.user-item.host .user-role {
    background: rgba(212, 175, 55, 0.2);
    color: #b8860b;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .room-content {
        grid-template-columns: 1fr;
    }
    
    .controls-row {
        justify-content: center;
    }
    
    .sync-status {
        margin-left: 0;
        margin-top: 10px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .room-nav {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .video-placeholder {
        padding: 20px;
    }
    
    .video-placeholder h3 {
        font-size: 1.5rem;
    }
    
    .url-input-container {
        flex-direction: column;
    }
    
    .upload-area {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .controls-row {
        gap: 5px;
    }
    
    .control-btn {
        padding: 6px 8px;
        min-width: 35px;
        height: 35px;
    }
    
    .volume-slider {
        width: 60px;
    }
    
    .chat-section {
        height: 400px;
    }
}