/* MasterStudy Custom Layout Styles */

/* Course Player Base Styles */
.stm-lms-course-player {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    min-height: 100vh;
}

/* Course Header Styles */
.stm-lms-course-player .course-header {
    background: #000000;
    padding: 1rem 2rem;
    border-bottom: 1px solid #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Course Navigation Styles */
.stm-lms-course-player .course-navigation {
    background: #1a1a1a;
    padding: 1rem 2rem;
    border-bottom: 1px solid #2a2a2a;
}

/* Course Curriculum Styles */
.stm-lms-course-player .course-curriculum {
    background: #0a0a0a;
    padding: 2rem;
    flex: 1;
}

/* Course Content Area Styles */
.stm-lms-course-player .course-content {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid #2a2a2a;
}

/* Stream Lesson Styles */
.masterstudy-course-player-lesson-stream {
    width: 100% !important;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.masterstudy-course-player-lesson-stream__wrapper {
    width: 100% !important;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.masterstudy-course-player-lesson-stream__countdown {
    text-align: center;
    color: #ffffff;
}

/* YouTube-Style Side-by-Side Layout */
.ms-stream-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100% !important;
    max-width: 100% !important;
    height: auto;
    background: #000000;
    position: relative;
}

/* LIVE Badge - Hotstar Style */
.ms-stream-live-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    padding: 8px 14px;
    border-radius: 4px;
    z-index: 100;
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 1.2px;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
    text-transform: uppercase;
}

.ms-live-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    animation: pulse-hotstar 1.2s infinite;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.ms-live-text {
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.5px;
}

@keyframes pulse-hotstar {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

/* Stream Ended - Hotstar Style */
.ms-stream-ended-wrapper {
    width: 100%;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    padding: 3rem;
}

.ms-stream-ended-content {
    text-align: center;
    max-width: 500px;
}

.ms-ended-icon {
    font-size: 4rem;
    color: #10b981;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.5s ease;
}

.ms-ended-title {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
    animation: fadeIn 0.7s ease;
}

.ms-ended-subtitle {
    font-size: 1.1rem;
    color: #a0a0a0;
    margin-bottom: 2rem;
    line-height: 1.6;
    animation: fadeIn 0.9s ease;
}

.ms-watch-highlights-btn {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #ffffff;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.3);
    animation: fadeIn 1.1s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ms-watch-highlights-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(220, 38, 38, 0.5);
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
}

.ms-watch-highlights-btn:active {
    transform: translateY(-1px);
}

.ms-watch-highlights-btn i {
    font-size: 1.2rem;
}

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

/* Highlights Player */
.ms-highlights-player {
    width: 100%;
    height: auto;
}

/* Video Player Container */
.masterstudy-course-player-lesson-stream__video {
    flex: 0 0 auto;
    min-width: 0;
    width: 100% !important;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000 !important;
    position: relative;
    overflow: hidden;
    height: auto;
    max-width: 100%;
}

.masterstudy-course-player-lesson-stream__video iframe,
.masterstudy-course-player-lesson-stream__video video {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    border-radius: 0;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Q&A Section (Below Video) */
.ms-stream-qa-section {
    width: 100%;
    background: #0f0f0f;
    border-top: 1px solid #2a2a2a;
    display: flex;
    flex-direction: column;
    max-height: 400px;
    overflow: hidden;
}

/* Q&A Header */
.ms-stream-qa-header {
    padding: 1rem 1.25rem;
    background: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.ms-stream-qa-header h4 {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Q&A Messages Area */
.ms-stream-qa-section .ms-stream-qa-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #0f0f0f;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Individual Q&A Message */
.ms-stream-qa-messages .chat-message {
    padding: 0.75rem 1rem;
    background: #1a1a1a;
    border-radius: 8px;
    border-left: 3px solid #4c6ef5;
    line-height: 1.5;
    word-wrap: break-word;
    animation: slideIn 0.3s ease;
}

.ms-stream-qa-messages .chat-message strong {
    color: #4c6ef5;
    font-weight: 600;
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

.ms-stream-qa-messages .chat-message .chat-timestamp {
    color: #666666;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

/* Empty State */
.ms-stream-qa-messages > div:only-child {
    text-align: center;
    color: #666666;
    padding: 2rem 1rem;
    font-size: 0.9rem;
}

/* Q&A Input Form */
.ms-stream-qa-section .ms-stream-qa-form {
    padding: 1rem 1.25rem;
    background: #1a1a1a;
    border-top: 1px solid #2a2a2a;
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.ms-stream-qa-section #ms-stream-qa-input {
    flex: 1;
    background: #0a0a0a;
    border: 1px solid #2a2a2a;
    border-radius: 20px;
    padding: 0.75rem 1rem;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.ms-stream-qa-section #ms-stream-qa-input:focus {
    outline: none;
    border-color: #4c6ef5;
}

.ms-stream-qa-section #ms-stream-qa-input::placeholder {
    color: #666666;
}

.ms-stream-qa-section #ms-stream-qa-send {
    background: #4c6ef5;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.ms-stream-qa-section #ms-stream-qa-send:hover {
    background: #5c7eff;
    transform: scale(1.05);
}

.ms-stream-qa-section #ms-stream-qa-send:active {
    transform: scale(0.95);
}

.ms-stream-qa-section #ms-stream-qa-send i {
    font-size: 0.9rem;
}

/* Scrollbar Styling for Q&A */
.ms-stream-qa-messages::-webkit-scrollbar {
    width: 8px;
}

.ms-stream-qa-messages::-webkit-scrollbar-track {
    background: #0f0f0f;
}

.ms-stream-qa-messages::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 4px;
}

.ms-stream-qa-messages::-webkit-scrollbar-thumb:hover {
    background: #3a3a3a;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .ms-stream-qa-section {
        max-height: 350px;
    }
}

@media (max-width: 968px) {
    .ms-stream-layout {
        flex-direction: column;
        height: auto;
    }
    
    .masterstudy-course-player-lesson-stream__video {
        aspect-ratio: 16 / 9;
        min-height: 300px;
    }
    
    .ms-stream-qa-section {
        width: 100%;
        max-height: 400px;
        border-left: none;
        border-top: 1px solid #2a2a2a;
    }
}

/* Zoom Conference Styles */
.masterstudy-course-player-lesson-zoom {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.masterstudy-course-player-lesson-zoom__wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.masterstudy-course-player-lesson-zoom iframe {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    border-radius: 0;
}

/* Ensure video section accommodates stream content */
.video-section .masterstudy-course-player-lesson-stream,
.video-section .masterstudy-course-player-lesson-zoom {
    width: 100% !important;
    height: 100%;
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Override gradient background when stream/zoom is active */
.video-section:has(.masterstudy-course-player-lesson-stream),
.video-section:has(.masterstudy-course-player-lesson-zoom) {
    background: #000000;
    padding: 0 !important;
}

/* Stream override wrap fills the video section */
.ms-stream-override-wrap {
    width: 100% !important;
    height: 100%;
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Stream layout fills full height */
.ms-stream-layout {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
}

/* Video player fills its container */
.masterstudy-course-player-lesson-stream__video {
    position: relative;
    overflow: hidden;
}

.masterstudy-course-player-lesson-stream__video video,
.masterstudy-course-player-lesson-stream__video iframe {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
}




