/**
 * Live Class styles for Rajasthan Virtual Shiksha PWA
 */

/* Layout */
.live-class-page {
    background-color: var(--bg-dark);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.live-class-header {
    background-color: var(--bg-dark);
    color: white;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
}

.live-class-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.back-button {
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
    gap: 5px;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.back-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.class-info {
    display: flex;
    flex-direction: column;
}

.class-title {
    font-size: 1.2rem;
    margin: 0;
}

.class-meta {
    font-size: 0.8rem;
    opacity: 0.7;
    margin: 0;
}

/* Connection indicators */
#online-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

#online-status.online {
    background-color: #4CAF50;
    box-shadow: 0 0 5px #4CAF50;
}

#online-status.offline {
    background-color: #F44336;
    box-shadow: 0 0 5px #F44336;
}

.connection-quality {
    display: flex;
    align-items: center;
    color: white;
    opacity: 0.7;
}

.connection-quality.good {
    color: #4CAF50;
}

.connection-quality.medium {
    color: #FF9800;
}

.connection-quality.poor {
    color: #F44336;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    background-color: rgba(244, 67, 54, 0.2);
    color: #F44336;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #F44336;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.7);
    }
    70% {
        box-shadow: 0 0 0 5px rgba(244, 67, 54, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0);
    }
}

/* Main container */
.live-class-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Video container */
.video-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background-color: #000;
}

.video-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.video-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

.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); }
}

#video-stream {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none; /* Initially hidden until loaded */
}

/* Video controls */
.video-controls {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background-color: var(--bg-dark);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.control-group {
    display: flex;
    gap: 10px;
}

.control-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    color: white;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.control-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.control-button svg {
    margin-bottom: 5px;
}

.control-button span {
    font-size: 0.75rem;
}

.control-button.end-call {
    background-color: #F44336;
}

.control-button.end-call:hover {
    background-color: #D32F2F;
}

.control-button.muted svg,
.control-button.video-off svg {
    color: #F44336;
}

/* Sidebar */
.sidebar-container {
    width: 320px;
    background-color: var(--bg-light);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.tab-button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-button span {
    font-size: 0.75rem;
    margin-top: 5px;
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.tab-content {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.tab-content.active {
    display: flex;
}

/* Chat tab */
.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    background-color: white;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    max-width: 85%;
    align-self: flex-start;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

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

.message-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.message-text {
    margin: 0;
    font-size: 0.9rem;
}

.system-message {
    background-color: rgba(var(--primary-color-rgb), 0.1);
    border-left: 3px solid var(--primary-color);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: var(--text-color);
    align-self: center;
    width: 90%;
}

.chat-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid var(--border-color);
}

#message-input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    outline: none;
    font-size: 0.9rem;
}

#send-message {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#send-message:hover {
    background-color: var(--primary-dark);
}

/* Participants tab */
.participants-count {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 500;
}

.participants-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.participant {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.participant:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.participant-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 10px;
}

.participant-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.participant-info {
    flex: 1;
}

.participant-name {
    font-size: 0.9rem;
    font-weight: 500;
    display: block;
}

.participant-badge {
    font-size: 0.7rem;
    color: white;
    background-color: var(--primary-color);
    padding: 2px 6px;
    border-radius: 10px;
    display: inline-block;
    margin-top: 3px;
}

.participant.host .participant-badge {
    background-color: #FF9800;
}

.participant.hand-raised .participant-badge {
    background-color: #2196F3;
}

.participant-status {
    color: var(--text-muted);
}

/* Notes tab */
.notes-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 15px;
}

#notes-area {
    flex: 1;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    resize: none;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 15px;
}

.notes-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Resources tab */
.resources-list {
    padding: 15px;
    overflow-y: auto;
}

.resource-item {
    display: flex;
    align-items: center;
    background-color: white;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.resource-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 12px;
}

.resource-icon.pdf {
    background-color: #F44336;
}

.resource-icon.image {
    background-color: #4CAF50;
}

.resource-icon.doc {
    background-color: #2196F3;
}

.resource-info {
    flex: 1;
}

.resource-info h3 {
    margin: 0 0 5px;
    font-size: 0.95rem;
}

.resource-info p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.resource-actions {
    display: flex;
}

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

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

/* Notification Container */
.notification-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.notification {
    background-color: white;
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 20px;
    margin-top: 10px;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification.show {
    transform: translateX(0);
}

.notification-icon {
    color: var(--primary-color);
}

.notification-content {
    flex: 1;
}

.notification-title {
    margin: 0 0 5px;
    font-size: 1rem;
    font-weight: 500;
}

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

.notification-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .live-class-container {
        flex-direction: column;
    }
    
    .sidebar-container {
        width: 100%;
        height: 300px;
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
    
    .video-container {
        flex: 0 0 calc(100vh - 60px - 300px);
    }
}

@media (max-width: 768px) {
    .control-button span {
        display: none;
    }
    
    .control-button svg {
        margin-bottom: 0;
    }
    
    .class-title {
        font-size: 1rem;
    }
    
    .class-meta {
        font-size: 0.75rem;
    }
    
    .sidebar-container {
        height: 250px;
    }
    
    .video-container {
        flex: 0 0 calc(100vh - 60px - 250px);
    }
}

@media (max-width: 480px) {
    .back-button span {
        display: none;
    }
    
    .header-right {
        gap: 8px;
    }
    
    .connection-quality {
        display: none;
    }
}
