/* Videos Page Styles */

.videos-container {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.videos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.videos-header h1 {
    color: #2c5f2d;
    margin: 0;
}

.videos-header .header-actions {
    display: flex;
    gap: 1rem;
}

.videos-header button {
    background: #2c5f2d;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

.videos-header button:hover {
    background: #1a3a1b;
}

/* Stats Cards */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    color: #666;
    font-size: 0.9rem;
    margin: 0 0 0.5rem 0;
    font-weight: normal;
}

.stat-card .stat-value {
    color: #2c5f2d;
    font-size: 2rem;
    font-weight: bold;
}

/* Search and Filters */
.videos-controls {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.videos-controls input {
    flex: 2;
    min-width: 200px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.videos-controls select {
    flex: 1;
    min-width: 150px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.videos-controls input:focus,
.videos-controls select:focus {
    outline: none;
    border-color: #2c5f2d;
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 0.5rem;
    background: #f5f5f5;
    border-radius: 6px;
    padding: 4px;
}

.view-toggle button {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.2s;
}

.view-toggle button:hover {
    background: #e0e0e0;
}

.view-toggle button.active {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Videos Grid */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Videos List */
.videos-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.videos-list .video-card {
    display: flex;
    flex-direction: row;
    min-height: 150px;
    height: auto;
    cursor: pointer;
    overflow: visible;
}

.videos-list .video-thumbnail {
    width: 220px;
    height: 140px;
    flex-shrink: 0;
    border-radius: 8px 0 0 8px;
}

.videos-list .video-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1rem;
    gap: 0.5rem;
}

.videos-list .video-card-content h3 {
    font-size: 1rem;
    margin: 0 0 0.25rem 0;
    -webkit-line-clamp: 1;
}

.videos-list .video-description {
    font-size: 0.85rem;
    -webkit-line-clamp: 2;
    margin: 0.25rem 0;
}

.videos-list .video-meta {
    font-size: 0.8rem;
}

.videos-list .video-stats {
    padding-top: 0.5rem;
    font-size: 0.8rem;
}

.videos-list .video-card-actions {
    margin-top: 0.5rem;
}

.video-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    height: 180px;
    aspect-ratio: 16 / 9;
    background: #1a1a1a;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.no-thumbnail {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 3rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.thumbnail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    padding: 0.5rem;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, #2c3e50 0%, #4b79a1 100%);
    font-size: 0.9rem;
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.video-card-content {
    padding: 1rem;
}

.video-card-content h3 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-description {
    color: #666;
    font-size: 0.9rem;
    margin: 0.5rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
    font-size: 0.85rem;
    color: #666;
}

.video-meta .badge {
    background: #e8f5e9;
    color: #2c5f2d;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.video-stats {
    display: flex;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid #eee;
    font-size: 0.85rem;
    color: #666;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.video-stats span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.video-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.btn-icon {
    background: #f5f5f5;
    border: none;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: #e0e0e0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
    font-size: 1.1rem;
}

/* Downloads Section */
.downloads-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.downloads-section h2 {
    margin: 0 0 1rem 0;
    color: #2c5f2d;
}

.download-item {
    padding: 1rem;
    background: #f5f5f5;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.download-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.download-info strong {
    color: #333;
}

.download-info span {
    color: #666;
    font-size: 0.9rem;
}

.progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2c5f2d, #4caf50);
    transition: width 0.3s;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 8px;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: slideIn 0.3s;
}

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

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

.modal-header h2 {
    margin: 0;
    color: #2c5f2d;
}

.close {
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
}

.close:hover {
    color: #333;
}

.form-group {
    margin-bottom: 1.25rem;
}

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #2c5f2d;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.btn-primary {
    background: #2c5f2d;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary:hover {
    background: #1a3a1b;
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* Upload Progress */
.upload-progress {
    display: none;
    margin-top: 1rem;
}

.upload-progress .progress-bar {
    height: 12px;
    margin-bottom: 0.5rem;
}

.upload-status {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

/* Player Modal */
.player-modal .modal-content {
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

.video-player-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.player-stage {
    width: 100%;
    display: flex;
    justify-content: center;
}

.player-frame {
    position: relative;
    width: min(70vw, 800px);
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}

.player-frame video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: inherit;
    display: block;
}

.video-info {
    width: 100%;
}

.player-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 1rem 0;
}

.player-navigation .btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.playing-info {
    margin-bottom: 1rem;
}

.playing-info h3 {
    margin: 0 0 0.5rem 0;
    color: #333;
}

.playing-info p {
    margin: 0.25rem 0;
    color: #666;
}

.playing-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.75rem;
}

.player-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 2000;
    animation: slideInRight 0.3s;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.fade-out {
    animation: fadeOut 0.3s;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(400px);
    }
}

.notification-success {
    border-left: 4px solid #4caf50;
}

.notification-error {
    border-left: 4px solid #f44336;
}

.notification-info {
    border-left: 4px solid #2196f3;
}

/* Responsive Design */
@media (max-width: 768px) {
    .videos-container {
        padding: 1rem;
    }

    .videos-header {
        flex-direction: column;
        align-items: stretch;
    }

    .videos-header .header-actions {
        flex-direction: column;
    }

    .filters-row {
        grid-template-columns: 1fr;
    }

    .videos-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 10% 1rem;
        padding: 1.5rem;
    }

    .player-modal .modal-content {
        margin: 2% 0.5rem;
    }

    .player-frame {
        width: 95vw;
        max-width: none;
    }
}
