/**
 * Class Recordings page styles for Rajasthan Virtual Shiksha PWA
 */

/* Recording Stats */
.recording-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 80px;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filter Controls */
.filter-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-controls select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: white;
    font-size: 0.9rem;
}

.upload-recording {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Recordings Grid */
.recordings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.recording-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid var(--border-color);
}

.recording-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.recording-card.published {
    border-left-color: #4CAF50;
}

.recording-card.processing {
    border-left-color: #FF9800;
}

.recording-card.draft {
    border-left-color: #2196F3;
}

/* Recording Thumbnail */
.recording-thumbnail {
    position: relative;
    height: 200px;
    background-color: #f0f0f0;
    overflow: hidden;
}

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

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
}

.recording-card:hover .play-overlay {
    opacity: 1;
}

.processing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

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

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

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

.quality-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--primary-color);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
}

.status-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.published {
    background-color: #4CAF50;
    color: white;
}

.status-badge.processing {
    background-color: #FF9800;
    color: white;
}

.status-badge.draft {
    background-color: #2196F3;
    color: white;
}

.trending-badge {
    position: absolute;
    top: 40px;
    left: 10px;
    background-color: #F44336;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Recording Info */
.recording-info {
    padding: 20px;
}

.recording-info h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    line-height: 1.3;
}

.recording-subject {
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0 0 10px;
}

.recording-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.processing-status {
    color: #FF9800;
    font-weight: 500;
}

.draft-status {
    color: #2196F3;
    font-weight: 500;
}

/* Analytics */
.recording-analytics {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.analytics-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.analytics-label {
    color: var(--text-muted);
}

.analytics-value {
    font-weight: 500;
    color: var(--text-color);
}

/* Processing Details */
.processing-details {
    margin-bottom: 15px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background-color: var(--bg-light);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background-color: #FF9800;
    transition: width 0.3s ease;
}

.processing-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

/* Draft Checklist */
.draft-checklist {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.checklist-item.completed {
    color: #4CAF50;
}

.checklist-item.pending {
    color: var(--text-muted);
}

/* Student Feedback */
.student-feedback {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.student-feedback h4 {
    margin: 0 0 10px;
    font-size: 0.9rem;
}

.feedback-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px;
    background-color: var(--bg-light);
    border-radius: 6px;
}

.student-avatar {
    font-size: 20px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-content {
    flex: 1;
}

.student-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-color);
    display: block;
    margin-bottom: 2px;
}

.feedback-content p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
    font-style: italic;
}

/* Recording Actions */
.recording-actions {
    padding: 15px 20px;
    background-color: var(--bg-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.estimated-time {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Action Dropdown */
.action-dropdown {
    position: relative;
}

.dropdown-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.dropdown-toggle:hover {
    background-color: var(--border-color);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 150px;
    z-index: 100;
    display: none;
}

.action-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 10px 15px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.85rem;
    transition: background-color 0.2s;
}

.dropdown-menu a:hover {
    background-color: var(--bg-light);
}

.dropdown-menu .delete-link {
    color: #F44336;
}

.dropdown-menu .delete-link:hover {
    background-color: #FFEBEE;
}

/* Upload Modal */
.upload-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.upload-modal.show {
    opacity: 1;
    visibility: visible;
}

.upload-modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.close-modal-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-modal-btn:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
}

.modal-body {
    padding: 20px;
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 20px;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(var(--primary-color-rgb), 0.05);
}

.upload-placeholder svg {
    color: var(--text-muted);
    margin-bottom: 15px;
}

.upload-placeholder h4 {
    margin: 0 0 10px;
    color: var(--text-color);
}

.upload-placeholder p {
    margin: 0 0 5px;
    color: var(--text-muted);
}

.file-info {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.upload-progress {
    text-align: center;
}

.upload-progress .progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.upload-progress .progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--text-color);
}

.recording-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-color);
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 3px;
    margin-right: 10px;
    position: relative;
    transition: all 0.2s;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
}

/* Analytics Modal */
.analytics-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.analytics-modal.show {
    opacity: 1;
    visibility: visible;
}

.analytics-modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.analytics-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.analytics-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background-color: var(--bg-light);
    border-radius: 8px;
}

.analytics-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.analytics-icon.views {
    background-color: #2196F3;
}

.analytics-icon.engagement {
    background-color: #4CAF50;
}

.analytics-icon.completion {
    background-color: #FF9800;
}

.analytics-icon.rating {
    background-color: #9C27B0;
}

.analytics-data {
    display: flex;
    flex-direction: column;
}

.analytics-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 5px;
}

.analytics-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Viewer Demographics */
.viewer-demographics {
    margin-top: 30px;
}

.viewer-demographics h4 {
    margin: 0 0 15px;
    font-size: 1.1rem;
}

.demographics-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.demographic-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background-color: var(--bg-light);
    border-radius: 6px;
}

.student-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.student-avatar {
    font-size: 20px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.student-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
}

.engagement-stats {
    display: flex;
    gap: 15px;
    font-size: 0.8rem;
}

.watch-time {
    color: var(--text-muted);
}

.rating {
    color: #FF9800;
    font-weight: 500;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .recording-stats {
        justify-content: space-around;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .recordings-grid {
        grid-template-columns: 1fr;
    }
    
    .recording-actions {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .upload-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .analytics-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .recording-meta {
        font-size: 0.75rem;
    }
    
    .analytics-summary {
        grid-template-columns: 1fr;
    }
    
    .demographic-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .engagement-stats {
        align-self: flex-end;
    }
}
