/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow: hidden;
}

/* Video container - full screen */
#video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.15);
}

#video-container.hidden {
    display: none;
}

#video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#video-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    pointer-events: none;
    z-index: 1;
}

#video-wrapper iframe {
    position: relative;
    width: 100%;
    height: 100%;
    border: none;
    opacity: 0.85;
}

/* Concept Overlay Updates */
#concept-overlay {
    /* Remove fixed positioning, let Flexbox handle it */
    position: relative; 
    bottom: auto;
    left: auto;
    
    background: rgba(0, 0, 0, 0.8);
    padding: 20px 30px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 300px;
    
    /* Re-enable clicks on the actual content */
    pointer-events: auto; 
}

/* Timer display */
#timer-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

#timer-icon {
    width: 40px;
    height: 40px;
    position: relative;
}

/* Animated circular timer */
.timer-circle {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 4;
}

.timer-circle-progress {
    fill: none;
    stroke: #4CAF50;
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.3s linear;
}

#timer-text {
    font-size: 1rem;
    color: #ffffff;
    font-weight: 500;
}

/* Topic label and value */
#topic-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

#concept-text {
    font-size: 1.8rem;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
    font-style: italic;
}

#concept-text.placeholder {
    font-style: italic;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
}

/* Transcript Overlay Updates */
#transcript-overlay {
    /* Remove fixed positioning and transform hacks */
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    
    background: rgba(0, 0, 0, 0.6);
    padding: 12px 20px;
    border-radius: 10px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    max-width: 500px;
    min-width: 300px;
    
    /* Re-enable clicks */
    pointer-events: auto;
}

#transcript-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    margin-bottom: 8px;
}

#transcript-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
    /* UPDATED: Let it grow up to 30% of the screen height */
    max-height: 30vh; 
    font-style: italic;
}

#transcript-text:empty::before {
    content: "[Listening...]";
    color: rgba(255, 255, 255, 0.4);
}
/* ============================================================================
   INFO MODAL & ICON STYLES
   ============================================================================ */

.hidden {
    display: none !important;
}

/* Info Icon - Top Left */
#info-icon {
    position: fixed;
    top: 20px;
    left: 20px; /* Moved to Left */
    width: 44px;
    height: 44px;
    z-index: 2000;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.9); /* Brighter white */
    transition: all 0.2s ease;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    padding: 10px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

#info-icon:hover {
    color: #ffffff;
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

#info-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Modal Overlay */
#info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

/* Modal Box */
.modal-content {
    background: rgba(30, 30, 30, 0.9); /* Slightly darker background for contrast */
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    position: relative;
}

/* New Header Style */
.modal-header {
    text-transform: uppercase;
    color: #667eea; /* Matches your theme gradient */
    font-size: 0.85rem;
    letter-spacing: 2px;
    margin-bottom: 20px;
    font-weight: 700;
}

.modal-content h2 {
    color: #ffffff;
    font-size: 2rem;
    margin-bottom: 15px;
    line-height: 1.3;
    font-weight: 700;
}

.modal-content p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    margin-bottom: 30px;
    font-style: italic;
}

#dismiss-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 12px 35px;
    font-size: 1rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    outline: none;
}

#dismiss-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(118, 75, 162, 0.4);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 
   NEW CONTAINER: 
   This holds both overlays. It covers the bottom area of the screen.
   pointer-events: none ensures clicks pass through to the video behind it.
*/
#ui-layer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    padding: 30px;
    z-index: 1001;
    pointer-events: none;
    
    /* Flexbox Magic */
    display: flex;
    flex-direction: row; /* Desktop: Side by side */
    align-items: flex-end; /* Align to bottom */
    justify-content: space-between; /* Push them apart */
}


/* ============================================================================
   RESPONSIVE DESIGN (TABLETS & MOBILE)
   ============================================================================ */

@media (max-width: 900px) {
    #ui-layer {
        /* 
           Stack vertically. 
           column-reverse means: Start from bottom, go up.
           Item 1 (Concept) stays at bottom.
           Item 2 (Transcript) sits ON TOP of Concept.
        */
        flex-direction: column-reverse; 
        align-items: stretch; /* Make them full width */
        gap: 15px; /* Perfect space between them */
        padding: 15px;
    }

    #concept-overlay {
        min-width: unset;
        width: 100%;
    }

    #transcript-overlay {
        max-width: none;
        width: 100%;
        margin-top: 0;
    }

    /* Adjust font sizes for smaller screens */
    #concept-text {
        font-size: 1.4rem;
    }
    
    #timer-icon {
        width: 30px;
        height: 30px;
    }
}