/* Chortle v5.3 - Page Styles */
/* Page-specific layouts and styles */

/* Video Components */
.completed-madlib {
    font-size: 1.3em;
    line-height: 1.6;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 15px;
    border-left: 4px solid #00BBF9;
    margin: 20px 0;
    color: #2D3748;
}

.filled-word {
    color: #FE5946; /* Red-orange for filled words */
    font-weight: 700;
    background: rgba(254, 89, 70, 0.1);
    padding: 3px 8px;
    border-radius: 6px;
}

.video-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    border-left: 4px solid #00BBF9;
}

.camera-setup, .recording-area, .playback-area {
    text-align: center;
}

.camera-setup h4, .playback-area h4 {
    color: #00BBF9;
    margin-bottom: 10px;
    font-weight: 600;
}

#camera-preview, #recorded-video {
    width: 100%;
    max-width: 400px;
    border-radius: 10px;
    margin: 20px 0;
    background: #000;
    object-fit: cover;
}

/* Mirror camera preview like selfie camera */
#camera-preview {
    transform: scaleX(-1); /* Horizontal flip for natural selfie view */
}

/* Recorded video should NOT be mirrored (normal for viewers) */
#recorded-video {
    transform: none;
}

/* Mobile-specific video sizing */
@media (max-width: 768px) {
    #camera-preview, #recorded-video {
        max-width: 100%;
        aspect-ratio: 3/4;
        max-height: 70vh;
    }
}

/* Desktop video sizing */
@media (min-width: 769px) {
    #camera-preview, #recorded-video {
        aspect-ratio: 16/9;
        max-width: 600px;
    }
}

/* REPLACE THE EXISTING CAPTION OVERLAY STYLES WITH: */

/* Caption Overlay Styles - UPDATED for karaoke/teleprompter with larger fonts */
.caption-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 10;
    pointer-events: none;

    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 15px 18px;
    border-radius: 12px;
    font-size: 1.1em; /* Increased from 0.95em */
    line-height: 1.3;
    text-align: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;

    transition: opacity 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    max-height: 140px; /* Increased for larger text */
    overflow: hidden;
    word-wrap: break-word;
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Karaoke line styles */
.caption-line {
    padding: 4px 0; /* Increased padding */
    transition: all 0.3s ease;
    font-size: 1em; /* Increased from 0.9em */
    line-height: 1.4;
    margin: 2px 0;
    word-wrap: break-word;
}

.caption-previous {
    opacity: 0.5;
    font-size: 0.85em; /* Increased from 0.8em */
    color: #ccc;
}

.caption-current {
    opacity: 1;
    font-weight: 700;
    transform: scale(1.05);
    font-size: 1.1em; /* Increased from 1em */
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.caption-next {
    opacity: 0.5;
    font-size: 0.85em; /* Increased from 0.8em */
    color: #ccc;
}

.caption-text {
    animation: captionFadeIn 0.4s ease-out;
}

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

/* Mobile caption overlay adjustments with larger fonts */
@media (max-width: 768px) {
    .caption-overlay {
        font-size: 1rem !important; /* Increased from 0.85rem */
        padding: 12px 15px !important;
        max-height: 120px !important;
        top: 8px !important;
        left: 8px !important;
        right: 8px !important;
        line-height: 1.3 !important;
    }

    .caption-line {
        font-size: 1rem; /* Increased from 0.85em */
        line-height: 1.3;
        margin: 1px 0;
    }

    .caption-previous,
    .caption-next {
        font-size: 0.85rem; /* Increased from 0.75em */
    }

    .caption-current {
        font-size: 1.1rem; /* Increased from 0.9em */
    }
}

.caption-next {
    opacity: 0.5;
    font-size: 0.8em;
    color: #ccc;
}

.caption-text {
    animation: captionFadeIn 0.4s ease-out;
}

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

.recording-controls, .playback-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.video-btn {
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 1.1em;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

#start-camera {
    background: #00BBF9;
    color: white;
    box-shadow: 5px 5px 0px #000000;
}

.record-btn {
    background: #dc3545;
    color: white;
    box-shadow: 3px 3px 0px #000000;
}

.stop-btn {
    background: #6c757d;
    color: white;
    box-shadow: 3px 3px 0px #000000;
}

.send-btn {
    background: #00BBF9;
    color: white;
    box-shadow: 5px 5px 0px #000000;
}

/* #re-record styling removed - now uses secondary-btn class styling */

.timer {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.3em;
    font-weight: 700;
    color: #dc3545;
    padding: 10px 18px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 8px;
    border: 2px solid #dc3545;
}

.watermark-notice {
    background: #fff3cd;
    border: 2px solid #FFDD04;
    border-radius: 12px;
    padding: 18px;
    margin: 18px 0;
    color: #856404;
}

.watermark-notice h5 {
    margin-bottom: 10px;
    color: #856404;
    font-weight: 600;
}

.upload-progress {
    margin: 20px 0;
    padding: 20px;
    background: rgba(0, 187, 249, 0.1);
    border-radius: 12px;
    border-left: 4px solid #00BBF9;
}

.upload-progress-bar {
    width: 100%;
    height: 10px;
    background: #ddd;
    border-radius: 5px;
    overflow: hidden;
    margin: 12px 0;
}

.upload-progress-fill {
    height: 100%;
    background: #00BBF9;
    transition: width 0.3s ease;
}

.video-sent {
    text-align: center;
    padding: 25px;
    background: #d4edda;
    border: 2px solid #c3e6cb;
    border-radius: 12px;
    color: #155724;
}

.video-sent h4 {
    color: #155724;
    font-weight: 700;
}

.create-new-btn {
    margin-top: 20px;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 1.1em;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

.error-message {
    background: #f8d7da;
    border: 2px solid #f5c6cb;
    border-radius: 12px;
    padding: 18px;
    margin: 18px 0;
    color: #721c24;
    font-weight: 500;
}

.video-playback-container {
    text-align: center;
}

.playback-video-area {
    margin: 20px 0;
}

/* Recording area improvements for caption overlay */
.recording-area {
    position: relative;
}

#camera-preview {
    position: relative;
    z-index: 1;
}

.recording-controls {
    position: relative;
    z-index: 11;
    margin-top: 10px;
}

/* Full-screen recording interface */
.fullscreen-recording {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 1000 !important;
    background: #000 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 0 !important;
    margin: 0 !important;
}

.fullscreen-recording #camera-preview {
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    border-radius: 0 !important;
    margin: 0 !important;
}

.fullscreen-recording .recording-controls {
    position: absolute !important;
    bottom: 60px !important;
    left: 0 !important;
    right: 0 !important;
    background: rgba(0, 0, 0, 0.3) !important;
    padding: 20px !important;
    margin: 0 !important;
}

.fullscreen-recording .timer {
    position: absolute !important;
    top: 60px !important;
    right: 20px !important;
    background: rgba(0, 0, 0, 0.8) !important;
    color: white !important;
    padding: 8px 12px !important;
    border-radius: 20px !important;
    font-size: 1.1em !important;
    border: 2px solid white !important;
}

.fullscreen-recording .caption-overlay {
    position: absolute !important;
    bottom: 140px !important;
    left: 20px !important;
    right: 20px !important;
    background: rgba(0, 0, 0, 0.8) !important;
    color: white !important;
    padding: 15px !important;
    border-radius: 12px !important;
    font-size: 1rem !important;
    line-height: 1.3 !important;
    max-height: 120px !important;
    text-align: center !important;
}

/* Center align secondary buttons in reading view */
.reading-view .secondary-btn {
    display: block !important;
    margin: 20px auto !important;
}

/* Clean video section styling - no container styling */
.video-section {
    margin: 20px 0;
}

.camera-setup {
    text-align: center;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    gap: 10px;
}

/* Intro Page */
.intro-content {
    text-align: center;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    width: 100%;
    box-sizing: border-box;
}

.intro-tagline {
    margin-bottom: 40px;
}

.intro-tagline h2 {
    font-size: 2.2em;
    font-weight: 700;
    color: #2D3748;
    margin: 0;
}

.intro-illustration {
    margin-bottom: 50px;
    width: 100%;
    max-width: 300px;
}

.illustration-placeholder {
    background: rgba(0, 187, 249, 0.1);
    border: 2px dashed rgba(0, 187, 249, 0.3);
    border-radius: 20px;
    padding: 60px 20px;
    font-size: 1.2em;
    color: #00BBF9;
    font-weight: 500;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Mobile intro page adjustments */
@media (max-width: 768px) {
    .intro-content {
        padding: 10px 0;
        min-height: 300px;
    }

    .intro-wordmark {
        max-height: 70px;
    }

    .intro-tagline h2 {
        font-size: 1.8em;
    }

    .illustration-placeholder {
        padding: 40px 15px;
        min-height: 150px;
        font-size: 1em;
    }
}

/* ========================================
   SIGN-IN GATEWAY PAGE
   ======================================== */

.signin-gateway-content {
    text-align: center;
    padding: 40px 20px;
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.gateway-header {
    margin-bottom: 50px;
}

.gateway-header h2 {
    font-size: 2em;
    font-weight: 700;
    color: #2D3748;
    margin: 0 0 12px 0;
}

.gateway-subtitle {
    font-size: 1.1em;
    color: #718096;
    margin: 0;
    line-height: 1.5;
}

.gateway-benefits {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    justify-content: center;
}

.benefit-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 100px;
    max-width: 140px;
}

.benefit-icon {
    font-size: 2em;
}

.benefit-text {
    font-size: 0.9em;
    color: #4A5568;
    font-weight: 500;
}

.gateway-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gateway-btn {
    width: 100%;
    padding: 16px 24px;
    border-radius: 12px;
    border: 2px solid #E2E8F0;
    background: white;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: 'Quicksand', sans-serif;
}

.gateway-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gateway-btn:active {
    transform: translateY(0);
}

.gateway-btn .btn-icon {
    font-size: 1.2em;
    display: flex;
    align-items: center;
}

.gateway-btn.google-btn {
    border-color: #4285F4;
    color: #4285F4;
}

.gateway-btn.google-btn:hover {
    background: #4285F4;
    color: white;
}

.gateway-btn.apple-btn {
    border-color: #000000;
    color: #000000;
}

.gateway-btn.apple-btn:hover {
    background: #000000;
    color: white;
}

.gateway-btn.email-btn {
    border-color: #00BBF9;
    color: #00BBF9;
}

.gateway-btn.email-btn:hover {
    background: #00BBF9;
    color: white;
}

.gateway-btn.guest-btn {
    border-color: #CBD5E0;
    color: #4A5568;
    background: #F7FAFC;
    margin-top: 8px;
}

.gateway-btn.guest-btn:hover {
    border-color: #A0AEC0;
    background: #EDF2F7;
}

.gateway-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 12px 0;
    color: #A0AEC0;
    font-size: 0.9em;
    font-weight: 500;
}

.gateway-divider::before,
.gateway-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #E2E8F0;
}

.gateway-divider span {
    padding: 0 12px;
}

.guest-note {
    font-size: 0.85em;
    color: #A0AEC0;
    margin: 8px 0 0 0;
    line-height: 1.4;
}

/* Mobile adjustments for gateway */
@media (max-width: 768px) {
    .signin-gateway-content {
        padding: 20px 15px;
        min-height: 350px;
    }

    .gateway-header h2 {
        font-size: 1.6em;
    }

    .gateway-subtitle {
        font-size: 1em;
    }

    .gateway-benefits {
        gap: 15px;
        margin-bottom: 30px;
    }

    .benefit-item {
        min-width: 80px;
        max-width: 100px;
    }

    .benefit-icon {
        font-size: 1.6em;
    }

    .benefit-text {
        font-size: 0.85em;
    }

    .gateway-btn {
        padding: 14px 20px;
        font-size: 0.95em;
    }
}

/* Receiver Gateway Specific Styles */
.receiver-note {
    text-align: center;
    font-size: 1em;
    color: #667eea;
    font-weight: 600;
    margin-top: 20px;
    line-height: 1.4;
}

/* Template Selection Page - Hero Layout */
.template-hero {
    text-align: center;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.template-hero-image {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.template-hero-image img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.template-hero-image img:hover {
    transform: scale(1.05);
}

.template-hero-label {
    font-size: 0.9em;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

.template-hero-title {
    font-size: 2.5em;
    font-weight: 700;
    color: #2D3748;
    margin: 0;
    line-height: 1.2;
}

.template-hero-description {
    font-size: 1.2em;
    color: #4A5568;
    margin: 0;
    max-width: 450px;
    line-height: 1.5;
}

/* Larger Start button on template selection page */
#start-template-btn {
    font-size: 1.3em;
    padding: 18px 50px;
    font-weight: 700;
    margin-top: 10px;
}

/* Mobile template hero adjustments */
@media (max-width: 768px) {
    .template-hero {
        padding: 30px 15px;
        gap: 20px;
    }

    .template-hero-image {
        max-width: 250px;
    }

    .template-hero-title {
        font-size: 2em;
    }

    .template-hero-description {
        font-size: 1.1em;
    }
}

/* Suggestion Pills */
.suggestion-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 15px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.suggestion-pill {
    background: rgba(0, 187, 249, 0.1);
    border: 2px solid rgba(0, 187, 249, 0.3);
    color: #00BBF9;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.suggestion-pill:hover {
    background: rgba(0, 187, 249, 0.2);
    border-color: rgba(0, 187, 249, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 187, 249, 0.15);
}

.suggestion-pill:active {
    transform: translateY(0) scale(0.95);
    background: rgba(0, 187, 249, 0.3);
}

/* Countdown Overlay Styles */
.countdown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.countdown-number,
.countdown-go {
    font-size: 8rem;
    font-weight: 900;
    color: #FFDD04;
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.8);
    animation: countdownPulse 0.8s ease-out;
    font-family: 'Outfit', sans-serif;
}

.countdown-go {
    color: #00BBF9;
    font-size: 6rem;
}

@keyframes countdownPulse {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mobile countdown adjustments */
@media (max-width: 768px) {
    .countdown-number,
    .countdown-go {
        font-size: 6rem;
    }

    .countdown-go {
        font-size: 4rem;
    }
}

/* Desktop recording styles */
.desktop-recording {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
}

.desktop-recording #camera-preview,
.desktop-recording #recorded-video {
    width: 100%;
    max-width: 500px;
    aspect-ratio: 16/9;
    border-radius: 10px;
    margin: 15px auto;
    display: block;
}

.desktop-recording .caption-overlay {
    bottom: 80px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: 400px !important;
    height: 120px !important;
    font-size: 1.1rem !important;
}

.desktop-recording .recording-controls,
.desktop-recording .playback-controls {
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

/* How to Play Buttons */
.how-to-play-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 60px;
}

.how-to-play-buttons .secondary-btn {
    /* Remove fixed width to hug contents */
}
