/* Modern Video Player Styling */
.video-page {
    font-family: 'Tajawal', sans-serif;
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
}

.video-player-container {
    max-width: 1200px;
    margin: 0 auto 2rem;
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 1.5rem;
    padding: 0 1rem;
}

.video-container {
    max-width: 900px;
    margin: 0 auto 2rem;
    padding: 1.5rem;
}

/* Main Video Player */
.video-player-wrapper {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.video-player {
    position: relative;
    width: 100%;
    background: #000;
    aspect-ratio: 16/9;
}

.video-player video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Video Overlay with Play Button */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.video-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.video-info {
    color: white;
    text-align: center;
    margin-bottom: 2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.video-info h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.big-play-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(58, 123, 213, 0.9);
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.big-play-btn:hover {
    transform: scale(1.1);
    background: #3a7bd5;
}

/* Video Controls */
.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    transition: opacity 0.3s ease;
    opacity: 0;
    z-index: 1;
}

.video-player:hover .video-controls {
    opacity: 1;
}

.progress-container {
    margin-bottom: 0.8rem;
}

.progress-bar {
    position: relative;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    cursor: pointer;
    margin-bottom: 0.8rem;
}

.progress-bg {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    border-radius: 3px;
}

.progress-filled {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #3a7bd5;
    border-radius: 3px;
    width: 0;
}

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

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

.time-display {
    text-align: left;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    margin-left: 1rem;
}

.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.controls-left, .controls-right {
    display: flex;
    align-items: center;
}

.control-btn {
    background: transparent;
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    margin: 0 2px;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.volume-control {
    display: flex;
    align-items: center;
}

.volume-slider {
    width: 0;
    overflow: hidden;
    transition: width 0.3s ease;
}

.volume-control:hover .volume-slider {
    width: 80px;
}

.volume-progress {
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    width: 70px;
    margin: 0 5px;
    cursor: pointer;
}

.volume-filled {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 2px;
    width: 70%;
}

.volume-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: white;
    top: 50%;
    transform: translate(-50%, -50%);
    left: 70%;
}

/* Playlist */
.playlist-container {
    max-width: 900px;
    margin: 0 auto 2rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.upload-video-btn {
    background: linear-gradient(135deg, #3a7bd5, #00d2ff);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 10px rgba(58, 123, 213, 0.3);
    transition: all 0.3s ease;
}

.upload-video-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(58, 123, 213, 0.4);
}

.upload-video-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(58, 123, 213, 0.3);
}

.playlist-container h3 {
    color: white;
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.playlist-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    overflow-y: auto;
    max-height: 500px;
}

.playlist-item {
    display: flex;
    gap: 1rem;
    padding: 0.8rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.playlist-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

.playlist-item.active {
    background: rgba(58, 123, 213, 0.2);
    border-right: 3px solid #3a7bd5;
}

.playlist-thumbnail {
    position: relative;
    width: 100px;
    height: 56px;
    border-radius: 5px;
    overflow: hidden;
    flex-shrink: 0;
}

.playlist-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-icon {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.playlist-item:hover .play-icon {
    opacity: 1;
}

.playlist-info {
    flex: 1;
}

.playlist-info h4 {
    color: white;
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.playlist-info p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

/* Voice commands styling */
.voice-commands {
    max-width: 1200px;
    margin: 0 auto 2rem;
}

.voice-commands h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.commands-tip {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(58, 123, 213, 0.1);
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1.5rem;
}

.commands-tip i {
    color: #3a7bd5;
    font-size: 1.5rem;
}

/* Upload Modal Styles */
.upload-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow: auto;
    align-items: center;
    justify-content: center;
}

.upload-modal.active {
    display: flex;
}

.upload-modal-content {
    background-color: white;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: modalFadeIn 0.3s ease;
    direction: rtl;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.upload-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #eaeaea;
}

.upload-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.3rem;
}

.close-modal {
    font-size: 1.8rem;
    color: #777;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: #333;
}

.upload-modal-body {
    padding: 1.5rem;
}

.upload-form .form-group {
    margin-bottom: 1.2rem;
}

.upload-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.upload-form input[type="text"],
.upload-form select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}

.upload-form input[type="text"]:focus,
.upload-form select:focus {
    border-color: #3a7bd5;
    outline: none;
}

.upload-area {
    position: relative;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.upload-placeholder {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    color: #777;
    transition: all 0.2s ease;
}

.upload-placeholder:hover,
.upload-placeholder.dragover {
    border-color: #3a7bd5;
    background-color: rgba(58, 123, 213, 0.05);
}

.upload-placeholder i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #3a7bd5;
}

.video-preview-container {
    margin-top: 1.5rem;
}

.video-preview-container h4 {
    margin-bottom: 0.8rem;
    color: #333;
}

#videoPreview {
    width: 100%;
    border-radius: 8px;
    background-color: #000;
    max-height: 250px;
}

.upload-modal-footer {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    border-top: 1px solid #eaeaea;
}

.btn {
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.cancel-btn {
    background-color: #f1f1f1;
    color: #555;
}

.cancel-btn:hover {
    background-color: #e5e5e5;
}

.submit-btn {
    background-color: #3a7bd5;
    color: white;
}

.submit-btn:hover {
    background-color: #2d6ec0;
}

/* Responsive design */
@media (max-width: 992px) {
    .video-player-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .controls-row {
        flex-wrap: wrap;
    }
    
    .controls-right {
        margin-top: 0.5rem;
        width: 100%;
        justify-content: flex-end;
    }
    
    .playlist-items {
        grid-template-columns: 1fr;
    }
    
    .commands-grid {
        grid-template-columns: 1fr;
    }
}
