/* Chortle v5.2 - Clean Modern Design with New Color Palette */

/* Force light mode for form elements in Safari - aggressive approach */
:root {
    color-scheme: light only;
}

/* Ensure form elements stay consistent - override everything */
input, textarea, select, button, 
.step-input, .search-input, .link-input {
    color-scheme: light only !important;
    -webkit-color-scheme: light !important;
}

/* Disable automatic dark mode entirely */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: light only;
    }
    
    input, textarea, select, button {
        color-scheme: light only !important;
        -webkit-color-scheme: light !important;
    }
}

html {
    min-height: 100%;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-image: url('../assets/icons/chortle-background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: scroll;
    min-height: 100vh;
    color: #2D3748; /* Dark gray text */
}

/* Offline Indicator */
#offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: linear-gradient(135deg, #ff9800 0%, #ff6b00 100%);
    color: white;
    padding: 12px;
    text-align: center;
    z-index: 9999;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: none;
    animation: slideDown 0.3s ease-out;
}

#offline-indicator span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 500px;
    width: 90%;
    pointer-events: none;
}

#toast-container.toast-top {
    top: 20px;
}

#toast-container.toast-bottom {
    bottom: 20px;
}

.toast {
    background: white;
    color: #2D3748;
    padding: 16px;
    border-radius: 12px;
    font-size: 0.95em;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden; /* Hide toast completely when not shown - prevents ghost clicks */
    transform: translateY(-20px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid #4299e1;
}

.toast-show {
    opacity: 1;
    visibility: visible; /* Make toast fully visible when shown */
    transform: translateY(0);
}

.toast-hide {
    opacity: 0;
    visibility: hidden; /* Ensure toast is hidden when dismissed */
    transform: translateY(-20px) scale(0.9);
}

.toast-icon {
    font-size: 1.5em;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
    line-height: 1;
    flex-shrink: 0; /* Prevent icon from being compressed */
}

.toast-message {
    flex: 1;
    min-width: 0; /* Allow flex item to shrink below content size for proper wrapping */
    line-height: 1.5;
    word-wrap: break-word; /* Break long words if necessary */
    overflow-wrap: break-word; /* Modern alternative to word-wrap */
}

.toast-close {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 1.5em;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: opacity 0.2s;
    border-radius: 4px;
    flex-shrink: 0; /* Prevent close button from being compressed */
}

.toast-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
}

/* Toast Types */
.toast-success {
    background: #f0fdf4;
    color: #166534;
    border-left-color: #22c55e;
}

.toast-success .toast-icon {
    color: #22c55e;
}

.toast-error {
    background: #fef2f2;
    color: #991b1b;
    border-left-color: #ef4444;
}

.toast-error .toast-icon {
    color: #ef4444;
}

.toast-info {
    background: #eff6ff;
    color: #1e40af;
    border-left-color: #3b82f6;
}

.toast-info .toast-icon {
    color: #3b82f6;
}

.toast-warning {
    background: #fffbeb;
    color: #92400e;
    border-left-color: #f59e0b;
}

.toast-warning .toast-icon {
    color: #f59e0b;
}

/* Layout */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 20px;
    margin-top: 10px;
    color: white;
    animation: fadeInDown 0.8s ease-out;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.header.center-only {
    justify-content: center;
}

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

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

.header .logo {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

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

.header .wordmark {
    max-height: 60px;
    width: auto;
    margin-bottom: 10px;
}

/* Smaller wordmark when header has navigation */
.header:not(.center-only) .wordmark {
    max-height: 40px;
    margin-bottom: 0;
}

.header p {
    font-size: 1.1em;
    opacity: 0.95;
    font-weight: 400;
    color: white;
}

.simple-intro {
    text-align: center;
    color: white;
    font-size: 1em;
    opacity: 0.9;
    margin-bottom: 30px;
    font-weight: 400;
}

/* Page System */
.page {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 32px;
    padding: 40px;
    box-shadow: 0px 228px 20px 0px rgba(69, 25, 123, 0.01),
                0px 146px 58px 0px rgba(69, 25, 123, 0.04),
                0px 82px 49px 0px rgba(69, 25, 123, 0.14),
                0px 36px 36px 0px rgba(69, 25, 123, 0.23),
                0px 9px 20px 0px rgba(69, 25, 123, 0.27);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeInUp 0.8s ease-out;
    flex: none;
    display: none;
    position: relative;
}

.page.active {
    display: block;
}

.reading-view {
    display: none;
}

.reading-view.active {
    display: block;
}

/* Fill-in word highlighting (Task #6) */
.fill-word {
    font-weight: 700;
    color: #fc8181;
    background: rgba(252, 129, 129, 0.08);
    padding: 1px 4px;
    border-radius: 3px;
    transition: background 0.2s ease;
}

.fill-word:hover {
    background: rgba(252, 129, 129, 0.15);
}

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

/* Template Selection */
.template-selector h2 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #2D3748;
    font-size: 1.8em;
    font-weight: 700;
    text-align: center;
}

.template-search {
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid rgba(45, 55, 72, 0.2);
    border-radius: 15px;
    font-size: 1em;
    font-family: 'Outfit', sans-serif;
    background: rgba(255, 255, 255, 0.9);
    color: #2D3748;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #00BBF9;
    box-shadow: 0 0 0 3px rgba(0, 187, 249, 0.1);
}

.template-categories {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    justify-content: center;
}

.category-btn {
    padding: 12px 20px;
    border: 2px solid rgba(0, 187, 249, 0.3);
    background: rgba(0, 187, 249, 0.2); /* Updated to blue instead of cream */
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9em;
    color: #2D3748;
    font-weight: 500;
}

.category-btn:hover {
    background: rgba(0, 187, 249, 0.3);
    transform: translateY(-2px);
}

.category-btn.active {
    background: #00BBF9;
    color: white;
    transform: translateY(-2px);
}

.template-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.template-btn {
    padding: 25px;
    border: 2px solid #00BBF9;
    background: rgba(0, 187, 249, 0.2); /* Sky blue with 20% opacity */
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
    font-size: 1em;
    text-align: left;
    color: #2D3748;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.template-btn:hover {
    background: rgba(0, 187, 249, 0.3); /* Slightly more opaque on hover */
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 187, 249, 0.15);
}

.template-btn-title {
    font-weight: 700;
    font-size: 1.2em;
    margin-bottom: 8px;
    color: #2D3748;
}

.template-btn-desc {
    font-size: 0.95em;
    opacity: 0.85;
    line-height: 1.4;
    color: #2D3748;
}

.templates-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

/* Wizard */
.wizard-header {
    text-align: center;
    margin-bottom: 15px;
    position: relative;
    padding-top: 30px;
}

.wizard-header h2 {
    display: none; /* Hide "Fill Out Your Chortle" */
}

.wizard-back-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    position: absolute;
    left: 20px;
    top: 10px;
    transition: all 0.2s ease;
}

.wizard-back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-2px);
}

.wizard-header .template-name {
    color: #667eea;
    font-weight: 600;
    font-size: 1.1em; /* Make it the main title */
    margin-bottom: 0;
}

.progress-fill {
    background: #00BBF9; /* Solid blue instead of gradient */
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
}

.wizard-step {
    display: none;
    animation: slideIn 0.4s ease-out;
}

.wizard-step.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.step-content {
    text-align: center;
    margin: 30px 0; /* Reduced from 40px 0 */
}

.step-question {
    font-size: 1.2em; /* Reduced from 1.4em */
    color: #4a5568;
    margin-bottom: 20px; /* Reduced from 25px */
    font-weight: 600;
}

.step-input {
    width: 100%;
    max-width: 400px;
    padding: 18px; /* Reduced from 20px */
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 15px;
    font-size: 1.1em; /* Reduced from 1.2em */
    font-family: inherit;
    text-align: center;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    box-sizing: border-box; /* Fix for margin issue */
}

.step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px; /* Reduced from 40px */
    gap: 15px; /* Reduced from 20px */
}

.nav-btn {
    padding: 12px 20px; /* Reduced from 15px 30px */
    border: none;
    border-radius: 12px;
    font-size: 1em; /* Reduced from 1.1em */
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-weight: 600;
}

.btn-back {
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%) !important;
    color: #2D3748 !important;
    border: 3px solid #cbd5e0 !important;
    padding: 15px 30px !important;
    border-radius: 50px !important;
    font-size: 1em !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-family: 'Outfit', sans-serif !important;
    box-shadow: 0 4px 0 #a0aec0, 0 6px 12px rgba(0, 0, 0, 0.15), inset 0 2px 0 rgba(255, 255, 255, 0.8) !important;
    text-shadow: none !important;
    flex: 0 0 25%; /* Take up 25% width */
}

.btn-back:hover {
    background: linear-gradient(180deg, #f7fafc 0%, #e2e8f0 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 0 #a0aec0, 0 10px 18px rgba(0, 0, 0, 0.2), inset 0 2px 0 rgba(255, 255, 255, 0.9) !important;
}

.btn-back:active {
    transform: translateY(1px) !important;
    box-shadow: 0 2px 0 #a0aec0, 0 3px 8px rgba(0, 0, 0, 0.15), inset 0 2px 0 rgba(255, 255, 255, 0.8) !important;
}

.btn-next {
    flex: 1; /* Take up remaining 75% width */
}

/* Primary CTA Button */
.primary-btn {
    background: linear-gradient(180deg, #00D4FF 0%, #00BBF9 50%, #0099CC 100%) !important;
    color: white !important;
    border: 3px solid #0088BB !important;
    padding: 15px 30px !important;
    border-radius: 50px !important;
    font-size: 1em !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 6px 0 #0077AA, 0 8px 15px rgba(0, 0, 0, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.4) !important;
    font-family: 'Outfit', sans-serif !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

.primary-btn:hover {
    background: linear-gradient(180deg, #00E6FF 0%, #00D4FF 50%, #00BBF9 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 0 #0077AA, 0 12px 20px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.5) !important;
}

.primary-btn:active {
    transform: translateY(2px) !important;
    box-shadow: 0 2px 0 #0077AA, 0 4px 8px rgba(0, 0, 0, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.4) !important;
}

/* Secondary CTA Button */
.secondary-btn {
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%) !important;
    color: #2D3748 !important;
    border: 3px solid #cbd5e0 !important;
    padding: 15px 30px !important;
    border-radius: 50px !important;
    font-size: 1em !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-family: 'Outfit', sans-serif !important;
    box-shadow: 0 4px 0 #a0aec0, 0 6px 12px rgba(0, 0, 0, 0.15), inset 0 2px 0 rgba(255, 255, 255, 0.8) !important;
    text-shadow: none !important;
}

.secondary-btn:hover {
    background: linear-gradient(180deg, #f7fafc 0%, #e2e8f0 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 0 #a0aec0, 0 10px 18px rgba(0, 0, 0, 0.2), inset 0 2px 0 rgba(255, 255, 255, 0.9) !important;
}

.secondary-btn:active {
    transform: translateY(1px) !important;
    box-shadow: 0 2px 0 #a0aec0, 0 3px 8px rgba(0, 0, 0, 0.15), inset 0 2px 0 rgba(255, 255, 255, 0.8) !important;
}

/* Apply primary button styles to existing CTA buttons */
.btn-next,
.share-btn,
.video-btn.primary-btn,
.copy-btn,
.create-new-btn {
    background: linear-gradient(180deg, #00D4FF 0%, #00BBF9 50%, #0099CC 100%) !important;
    color: white !important;
    border: 3px solid #0088BB !important;
    padding: 15px 30px !important;
    border-radius: 50px !important;
    font-size: 1em !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 6px 0 #0077AA, 0 8px 15px rgba(0, 0, 0, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.4) !important;
    font-family: 'Outfit', sans-serif !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
    display: block !important;
    margin: 0 auto !important;
}

.btn-next:hover,
.share-btn:hover,
.video-btn.primary-btn:hover,
.copy-btn:hover,
.create-new-btn:hover {
    background: linear-gradient(180deg, #00E6FF 0%, #00D4FF 50%, #00BBF9 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 0 #0077AA, 0 12px 20px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.5) !important;
}

.btn-next:active,
.share-btn:active,
.video-btn.primary-btn:active,
.copy-btn:active,
.create-new-btn:active {
    transform: translateY(2px) !important;
    box-shadow: 0 2px 0 #0077AA, 0 4px 8px rgba(0, 0, 0, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.4) !important;
}

.template-btn-icon {
    text-align: center;
    margin-bottom: 15px;
    display: block;
}

.template-icon-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: opacity(0.8);
    transition: all 0.3s ease;
    margin-top: 2px; /* Slight offset to align with title */
}

.template-btn:hover .template-icon-img {
    filter: opacity(1);
    transform: scale(1.05);
}

/* Disabled State */
.primary-btn:disabled,
.secondary-btn:disabled,
.btn-next:disabled,
.share-btn:disabled,
.video-btn.primary-btn:disabled,
.copy-btn:disabled,
.create-new-btn:disabled {
    background: linear-gradient(180deg, #e2e8f0 0%, #cbd5e0 50%, #a0aec0 100%) !important;
    color: #718096 !important;
    border: 3px solid #9ca3af !important;
    cursor: not-allowed !important;
    transform: none !important;
    transition: none !important;
    box-shadow: 0 3px 0 #9ca3af, 0 4px 8px rgba(0, 0, 0, 0.1), inset 0 2px 0 rgba(255, 255, 255, 0.3) !important;
    text-shadow: none !important;
    opacity: 0.7 !important;
}

.primary-btn:disabled:hover,
.secondary-btn:disabled:hover,
.btn-next:disabled:hover,
.share-btn:disabled:hover,
.video-btn.primary-btn:disabled:hover,
.copy-btn:disabled:hover,
.create-new-btn:disabled:hover {
    transform: none !important;
    box-shadow: 0 3px 0 #9ca3af, 0 4px 8px rgba(0, 0, 0, 0.1), inset 0 2px 0 rgba(255, 255, 255, 0.3) !important;
}

/* Share Page */
.ready-content {
    text-align: center;
}

.ready-content h2 {
    color: #2D3748;
    font-size: 1.8em;
    margin-bottom: 20px;
    font-weight: 700;
}

.success-icon {
    font-size: 4em;
    margin-bottom: 20px;
    animation: bounce 0.6s ease-out;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.share-instructions {
    background: rgba(0, 187, 249, 0.1);
    border-radius: 20px;
    padding: 15px 25px;
    margin: 25px 0;
    border-left: none;
}

.share-step {
    display: flex;
    align-items: flex-start;
    margin: 15px 0;
    font-size: 1em;
    font-weight: 500;
    gap: 15px;
    text-align: left;
}

.share-step-text {
    flex: 1;
    line-height: 1.4;
    padding-top: 2px; /* Align with number circle */
    text-align: left;
}

.share-step-number {
    background: #00BBF9;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-weight: 700;
    font-size: 0.9em;
    box-shadow: none;
}

.share-btn {
    padding: 20px 40px;
    border-radius: 15px;
    font-size: 1.3em;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    width: 100%;
    margin: 20px 0;
}

.link-section {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    display: none;
}

.link-section.active {
    display: block;
}

.link-box {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 15px;
}

.link-input {
    flex: 1;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
    background: white;
    color: #2D3748;
}

.copy-btn {
    padding: 15px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
}

/* Loading States */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-left: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 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;
}

/* Single-Screen Playback Area Styles */
.playback-video-preview {
    margin-bottom: 15px;
    text-align: center;
}

.playback-video-preview video {
    display: block; /* Remove inline spacing */
    margin: 0 auto; /* Center horizontally */
    width: auto; /* Don't stretch to full width */
    max-width: 200px;
    max-height: 150px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    object-fit: contain; /* Maintain aspect ratio */
}

.playback-heading {
    color: #2D3748;
    font-size: 1.3em;
    margin: 15px 0 10px 0;
    font-weight: 600;
}

.sent-indicator-section {
    margin: 12px 0;
    padding: 12px;
    background: #d4edda;
    border: 2px solid #c3e6cb;
    border-radius: 10px;
}

.sent-indicator {
    color: #155724;
    font-weight: 600;
    font-size: 0.95em;
}

.playback-friend-selector {
    margin-bottom: 15px;
}

.playback-link-section {
    margin: 25px 0 15px 0;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.playback-link-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2D3748;
    font-size: 0.9em;
}

.link-box {
    display: flex;
    gap: 8px;
    align-items: center;
}

.link-input {
    flex: 1;
}

.share-icon-btn {
    padding: 10px 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2em;
    transition: background 0.2s ease;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-icon-btn:hover {
    background: #5568d3;
}

.share-icon-btn:active {
    background: #4451b8;
}

.playback-actions {
    margin-top: 20px;
}

.full-width-btn {
    width: 100%;
    margin-bottom: 15px;
}

.full-width-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.secondary-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.secondary-actions button {
    flex: 1;
}

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

/* Mobile caption overlay adjustments */
@media (max-width: 768px) {
    .caption-overlay {
        font-size: 0.85rem !important;
        padding: 10px 12px !important;
        max-height: 100px !important;
        top: 8px !important;
        left: 8px !important;
        right: 8px !important;
        line-height: 1.2 !important;
    }
    
    .caption-line {
        font-size: 0.85em;
        line-height: 1.2;
        margin: 0.5px 0;
    }
    
    .caption-previous,
    .caption-next {
        font-size: 0.75em;
    }
    
    .caption-current {
        font-size: 0.9em;
    }
}

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

/* Success Screen Components */
.success-video-preview {
    margin-bottom: 20px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.success-video-preview video {
    width: 100%;
    max-height: 250px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.success-message {
    margin-bottom: 20px;
}

.success-message h4 {
    margin-bottom: 8px;
    font-size: 1.5em;
}

.success-message p {
    font-size: 1em;
    opacity: 0.9;
}

.sent-list-section {
    margin-bottom: 20px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
}

.sent-indicator {
    font-weight: 600;
    color: #155724;
    font-size: 0.95em;
}

.sent-indicator span {
    font-weight: 500;
}

.success-friend-selector {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    border: 1px solid #c3e6cb;
}

.success-friend-selector h4 {
    font-size: 1.1em;
    margin-bottom: 12px;
    color: #155724;
}

.success-friend-selector .friend-selector-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 12px;
    padding: 10px;
    background: white;
    border-radius: 6px;
}

#send-to-more-friends {
    width: 100%;
    margin-top: 10px;
}

#send-to-more-friends:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.video-link-section {
    margin-bottom: 20px;
}

.video-link-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #155724;
}

.success-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}

.success-actions button {
    flex: 1;
    min-width: 200px;
}

.warning-btn {
    background: #ffc107 !important;
    color: #000 !important;
    border-color: #e0a800 !important;
}

.warning-btn:hover {
    background: #e0a800 !important;
}

.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 */
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.modal-open {
    opacity: 1;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.modal.modal-open .modal-content {
    transform: translateY(0);
}

.modal-close {
    color: #cbd5e0;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 20px;
    right: 25px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #2D3748;
}

.modal h2 {
    color: #2D3748;
    text-align: center;
    margin-bottom: 30px;
    font-weight: 600;
    font-size: 1.8em;
}

/* Confirmation Modal */
.confirm-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.confirm-modal.active {
    display: flex !important;
}

.confirm-modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.confirm-modal-content h3 {
    color: #2D3748;
    font-size: 1.5em;
    margin-bottom: 15px;
    font-weight: 600;
}

.confirm-modal-content p {
    color: #4A5568;
    font-size: 1em;
    margin-bottom: 25px;
    line-height: 1.6;
}

.confirm-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-modal-actions button {
    flex: 1;
    padding: 12px 24px;
    font-size: 1em;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    transition: all 0.2s ease;
}

/* How to Play Steps */
.how-to-play-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.step {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    position: relative;
}

.step:not(:last-child)::after {
    content: "↓";
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    color: #cbd5e0;
    font-size: 16px;
    font-weight: bold;
    z-index: 1;
}

.step-image {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.step-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.step-content h3 {
    color: #2D3748;
    font-weight: 700;
    font-size: 1.3em;
    margin: 0 0 6px 0;
}

.step-content h3::first-letter {
    color: #FE5946;
    font-size: 1.2em;
    font-weight: 800;
}

.step-content p {
    color: #4a5568;
    margin: 0;
    font-size: 1em;
    line-height: 1.5;
}

/* Horizontal layout for wider screens */
@media (min-width: 768px) {
    .modal-content {
        max-width: 700px;
    }

    .how-to-play-steps {
        flex-direction: row;
        gap: 20px;
        align-items: stretch;
    }

    .step {
        flex: 1;
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 20px 16px;
    }

    .step:not(:last-child)::after {
        content: "→";
        bottom: 50%;
        left: auto;
        right: -30px;
        transform: translateY(50%);
        font-size: 18px;
    }

    .step-image {
        align-self: center;
        margin-bottom: 4px;
    }

    .step-content h3 {
        margin-bottom: 8px;
    }
}

/* Game Demo Animation */
.game-demo {
    width: 100%;
    max-width: 500px;
    margin: 0 auto 20px auto;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    border: 2px solid rgba(254, 89, 70, 0.1);
    box-sizing: border-box;
    overflow: hidden;
}

.sentence {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8em;
    font-weight: 600;
    line-height: 1.5;
    text-align: center !important;
    color: #2D3748;
    opacity: 0;
    position: absolute !important;
    width: calc(100% - 40px) !important;
    left: 20px !important;
    right: 20px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    transition: opacity 0.5s ease;
}

.sentence.active {
    opacity: 1;
}

.sentence .text {
    margin: 0 4px;
}

.sentence .blank {
    display: inline-block;
    margin: 0 4px;
    min-width: 80px;
    text-align: center;
    position: relative;
    color: #cbd5e0;
    font-weight: 400;
}

.sentence .blank.filled {
    color: #FE5946;
    font-weight: 700;
    animation: fillIn 0.6s ease-out;
}

@keyframes sentenceLoop {
    0% { opacity: 0; transform: translateY(10px); }
    4% { opacity: 1; transform: translateY(0); }
    75% { opacity: 1; transform: translateY(0); }
    85% { opacity: 0; transform: translateY(-10px); }
    100% { opacity: 0; transform: translateY(-10px); }
}

/* Typewriter effect */
.sentence .blank.typewriter {
    border-right: 2px solid #FE5946;
    animation: blink 1s infinite;
}

.sentence .blank.typewriter:not(:empty) {
    border-right: none;
    animation: none;
}

@keyframes blink {
    0%, 50% { border-color: #FE5946; }
    51%, 100% { border-color: transparent; }
}

/* Bounce effect when word is complete */
.sentence .blank.bounce {
    animation: bounceIn 0.8s ease-out;
    animation-fill-mode: both;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0.7;
    }
    20% {
        transform: scale(1.1);
    }
    40% {
        transform: scale(0.9);
    }
    60% {
        transform: scale(1.03);
    }
    80% {
        transform: scale(0.97);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Sparkle effect */
.sentence .blank.sparkle {
    animation: sparkle 1.0s ease-out;
    animation-fill-mode: both;
}

@keyframes sparkle {
    0% {
        text-shadow: none;
    }
    25% {
        text-shadow: 0 0 10px rgba(254, 89, 70, 0.4);
    }
    50% {
        text-shadow: 0 0 15px rgba(254, 89, 70, 0.6);
        transform: scale(1.05);
    }
    100% {
        text-shadow: none;
        transform: scale(1);
    }
}

/* Demo subtitle */
.demo-subtitle {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1em;
    font-weight: 500;
    color: #667eea;
    text-align: center;
    margin: 0 0 15px 0;
    opacity: 0.9;
}

/* Removed duplicate - centering handled by main .intro-content rule above */

.intro-content .primary-btn {
    margin-top: 15px;
    margin-bottom: 16px;
}

.how-to-play-buttons {
    margin-top: 15px;
}

/* Recording Indicator */
.recording-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-family: 'Outfit', sans-serif;
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: rotate(-8deg);
}

.recording-indicator.visible {
    opacity: 1;
    animation: badgePulse 2s ease-in-out infinite;
}

.recording-text {
    font-size: 0.8em;
    font-weight: 600;
    color: #2D3748;
    white-space: nowrap;
}

@keyframes badgePulse {
    0% {
        transform: rotate(-8deg) scale(1);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    50% {
        transform: rotate(-8deg) scale(1.02);
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
    }
    100% {
        transform: rotate(-8deg) scale(1);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
}

/* ========================================
   AUTHENTICATION & PROFILE STYLES
   ======================================== */

/* Auth Buttons in Header */
.header {
    position: relative;
}

.auth-buttons {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 10px;
}

.auth-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 6px;
}

.auth-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Profile Button in Pages */
.page-profile-btn {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: 700;
}

.page-profile-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    border-color: #cbd5e0;
}

/* Auth Modal */
.auth-modal-content {
    max-width: 450px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.auth-input {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1em;
    font-family: 'Outfit', sans-serif;
    transition: border-color 0.3s ease;
    background: white;
    color: #2d3748;
}

.auth-input:focus {
    outline: none;
    border-color: #667eea;
}

.auth-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.auth-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.auth-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-error {
    color: #e53e3e;
    font-size: 0.9em;
    margin-top: -10px;
    padding: 8px 12px;
    background: #fff5f5;
    border-radius: 6px;
    border-left: 3px solid #e53e3e;
}

.auth-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.auth-divider span {
    background: white;
    padding: 0 15px;
    color: #a0aec0;
    font-size: 0.9em;
    position: relative;
    z-index: 1;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
}

/* Social Auth Buttons */
.social-auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.social-btn:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    transform: translateY(-2px);
}

.email-btn {
    color: #2D3748;
    border-color: #667eea;
}

.email-btn:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.email-btn .social-icon {
    font-size: 1.2em;
}

.google-btn {
    color: #4285f4;
}

.google-btn .social-icon {
    font-weight: 700;
    font-size: 1.2em;
}

.apple-btn {
    color: #000;
}

.apple-btn .social-icon::before {
    content: '';
    font-size: 1.2em;
}

/* Back link */
.back-link {
    background: none;
    border: none;
    color: #667eea;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 15px;
    text-align: left;
    transition: all 0.2s ease;
}

.back-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Auth Toggle */
.auth-toggle {
    text-align: center;
    margin-top: 20px;
}

.auth-toggle p {
    color: #2D3748;
    font-size: 1.05em;
    font-weight: 500;
}

.auth-toggle a {
    color: #667eea;
    font-weight: 700;
    text-decoration: underline;
    font-size: 1.1em;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
    display: inline-block;
}

.auth-toggle a:hover {
    background: rgba(102, 126, 234, 0.1);
    text-decoration: underline;
    color: #764ba2;
}

/* Guest Mode Link */
.guest-mode {
    text-align: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.guest-mode a {
    color: #a0aec0;
    font-size: 0.9em;
    text-decoration: none;
}

.guest-mode a:hover {
    color: #718096;
    text-decoration: underline;
}

/* Profile Modal */
.profile-modal-content {
    max-width: 500px;
}

.profile-info {
    margin-bottom: 30px;
}

.profile-field {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.profile-field:last-child {
    border-bottom: none;
}

.profile-field label {
    display: block;
    font-size: 0.85em;
    font-weight: 600;
    color: #718096;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-field span {
    font-size: 1.1em;
    color: #2d3748;
    font-weight: 500;
}

.username-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.edit-btn {
    background: #e2e8f0;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
}

.edit-btn:hover {
    background: #cbd5e0;
}

#username-edit-form {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#username-edit-form input {
    flex: 1;
}

#username-edit-form button {
    padding: 8px 16px;
}

.small-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.small-btn:not(.secondary) {
    background: #667eea;
    color: white;
}

.small-btn.secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.small-btn:hover {
    transform: translateY(-1px);
}

/* Profile Stats */
.profile-stats {
    background: #f7fafc;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.profile-stats h3 {
    margin: 0 0 15px 0;
    color: #2d3748;
    font-size: 1.1em;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
}

.stat-value {
    font-size: 2em;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.85em;
    color: #718096;
    font-weight: 500;
}

/* =======================
   PHASE 2: FRIENDS SYSTEM
   ======================= */

/* Friends Button */
.page-action-btn {
    position: relative;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.page-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: #667eea;
}

.page-action-btn .action-icon {
    font-size: 20px;
}

/* Friends Button Badge */
.action-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #fc8181;
    color: white;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-shadow: 0 2px 4px rgba(252, 129, 129, 0.3);
}

/* Friends Modal */
.friends-modal-content {
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 30px;
}

.friends-modal-content h2 {
    margin: 0 0 20px 0;
    font-size: 1.8em;
    font-weight: 700;
    color: #2d3748;
}

/* Friends Tabs */
.friends-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.friends-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 12px 16px;
    font-size: 1em;
    font-weight: 600;
    color: #718096;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    position: relative;
}

.friends-tab:hover {
    color: #667eea;
    background: #f7fafc;
}

.friends-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-badge {
    display: inline-block;
    background: #fc8181;
    color: white;
    font-size: 0.75em;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    padding: 0 6px;
    margin-left: 6px;
    line-height: 20px;
}

/* Friends Tab Content */
.friends-tabs-container {
    position: relative;
    min-height: 400px;
}

.friends-tab-content {
    display: none;
}

.friends-tab-content.active {
    display: block;
}

/* Search Section */
.search-section {
    margin-bottom: 20px;
}

.friend-search-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1em;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
    transition: all 0.2s ease;
    font-family: 'Outfit', sans-serif;
}

.friend-search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Search Results, Friends List, Requests List */
.search-results,
.friends-list-container,
.requests-list-container {
    min-height: 300px;
}

.users-list,
.friends-list,
.requests-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* User/Friend/Request Cards */
.user-card,
.friend-card,
.request-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.user-card:hover,
.friend-card:hover,
.request-card:hover {
    border-color: #cbd5e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 1.05em;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 2px;
}

.user-username {
    font-size: 0.9em;
    color: #718096;
    margin-bottom: 4px;
}

.user-stats {
    font-size: 0.85em;
    color: #a0aec0;
}

.request-time {
    font-size: 0.85em;
    color: #a0aec0;
    margin-top: 4px;
}

/* Friend Actions */
.user-actions,
.friend-actions,
.request-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Friend Action Buttons */
.btn-add-friend,
.btn-accept-request,
.btn-decline-request,
.btn-remove-friend,
.btn-friend-status {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-add-friend,
.btn-accept-request {
    background: #667eea;
    color: white;
}

.btn-add-friend:hover,
.btn-accept-request:hover {
    background: #5568d3;
    transform: translateY(-1px);
}

.btn-decline-request,
.btn-remove-friend {
    background: #f7fafc;
    color: #718096;
    border: 1px solid #e2e8f0;
}

.btn-decline-request:hover,
.btn-remove-friend:hover {
    background: #fc8181;
    color: white;
    border-color: #fc8181;
}

.btn-friend-status {
    background: #f7fafc;
    color: #718096;
    cursor: default;
}

.btn-friend-status.accepted {
    background: #48bb78;
    color: white;
}

.btn-friend-status.pending {
    background: #edf2f7;
    color: #a0aec0;
}

/* Button States */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #a0aec0;
}

.empty-state p {
    margin: 0 0 8px 0;
    font-size: 1.1em;
}

.empty-state-hint {
    font-size: 0.9em;
    color: #cbd5e0;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: #a0aec0;
    font-size: 1em;
}

/* Error State */
.error {
    text-align: center;
    padding: 40px 20px;
    color: #fc8181;
    font-size: 1em;
}

/* =======================
   PHASE 2: FRIEND SELECTOR (Share Page)
   ======================= */

.friend-selector-section {
    margin-bottom: 25px;
}

.friend-selector-section h3 {
    margin: 0 0 16px 0;
    font-size: 1.4em;
    font-weight: 700;
    color: #2d3748;
    text-align: left;
}

/* Playback friend selector (User B) */
#playback-friend-selector {
    margin-bottom: 25px;
}

#playback-friend-selector h3 {
    margin: 0 0 16px 0;
    font-size: 1.4em;
    font-weight: 700;
    color: #2d3748;
    text-align: left;
}

#playback-send-to-friends-btn {
    width: 100%;
    margin-top: 12px;
}

#playback-send-to-friends-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #cbd5e0;
    color: #718096;
}

.friend-selector-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
}

.friend-selector-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.friend-selector-item:hover {
    background: #f7fafc;
}

.friend-selector-item.selected {
    background: #ebf4ff;
    border: 2px solid #667eea;
}

.friend-selector-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.friend-selector-item.selected .friend-selector-checkbox {
    background: #667eea;
    border-color: #667eea;
}

.friend-selector-checkbox::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: 700;
    display: none;
}

.friend-selector-item.selected .friend-selector-checkbox::after {
    display: block;
}

.friend-selector-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.friend-selector-info {
    flex: 1;
    min-width: 0;
}

.friend-selector-name {
    font-size: 1em;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 2px;
}

.friend-selector-username {
    font-size: 0.85em;
    color: #718096;
}

#send-to-friends-btn {
    width: 100%;
    margin-top: 12px;
}

#send-to-friends-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #cbd5e0;
    color: #718096;
}

/* Link share section styling */
.link-share-section {
    margin-top: 25px;
    text-align: center;
}

.share-link-toggle {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    font-size: 0.95em;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.share-link-toggle:hover {
    background: #f7fafc;
    color: #5568d3;
}

/* =======================
   PHASE 2: NOTIFICATIONS SYSTEM
   ======================= */

/* Notifications Modal */
.notifications-modal-content {
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 30px;
}

.notifications-modal-content h2 {
    margin: 0 0 20px 0;
    font-size: 1.8em;
    font-weight: 700;
    color: #2d3748;
}

/* Notifications Feed Container */
.notifications-feed-container {
    min-height: 400px;
}

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

/* Notification Cards */
.notification-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: all 0.2s ease;
    position: relative;
}

.notification-card:hover {
    border-color: #cbd5e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.notification-card.unread {
    background: #f0f4ff;
    border-color: #667eea;
}

/* Notification Avatar */
.notification-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

/* Notification Content */
.notification-content {
    flex: 1;
    min-width: 0;
    position: relative;
}

.notification-message {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.notification-username {
    font-size: 1em;
    font-weight: 600;
    color: #2d3748;
    margin-right: 4px;
}

.notification-text {
    font-size: 0.95em;
    color: #718096;
}

.notification-status {
    margin-bottom: 8px;
}

.notification-time {
    position: absolute;
    bottom: 8px;
    right: 0;
    font-size: 0.8em;
    color: #a0aec0;
}

/* Notification Actions */
.notification-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
}

.btn-view-chortle {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    background: #667eea;
    color: white;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-view-chortle:hover {
    background: #5568d3;
    transform: translateY(-1px);
}

/* Notification Badge Dot (for unread) */
.notification-badge-dot {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* In-App Notification Toast */
.notification-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border: 2px solid #667eea;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    max-width: 350px;
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

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

.notification-toast-content {
    flex: 1;
}

.notification-toast-title {
    font-size: 1em;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 4px;
}

.notification-toast-body {
    font-size: 0.9em;
    color: #718096;
}

.notification-toast-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #a0aec0;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.notification-toast-close:hover {
    color: #2d3748;
}

/* Notification Status Badges */
.notification-status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    margin-left: 8px;
}

.status-new {
    background: #e3f2fd;
    color: #1976d2;
}

.status-viewed {
    background: #f5f5f5;
    color: #757575;
}

.status-responded {
    background: #e8f5e9;
    color: #388e3c;
}

.status-dismissed {
    background: #fafafa;
    color: #9e9e9e;
}

/* Dismiss Button */
.btn-dismiss-notification {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #cbd5e0;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 10;
}

.btn-dismiss-notification:hover {
    background: #f7fafc;
    color: #718096;
    transform: scale(1.1);
}

/* Dismissed Notification State */
.notification-card.dismissed {
    opacity: 0.6;
    background: #fafafa !important;
    border-color: #e2e8f0 !important;
}

.notification-card.dismissed .notification-avatar {
    opacity: 0.7;
}

.notification-card.dismissed .notification-content {
    opacity: 0.8;
}

.notification-card.dismissed .btn-view-chortle {
    opacity: 0.6;
    pointer-events: none;
}

/* Notification Toast Animation */
@keyframes slideIn {
    from {
        transform: translateX(400px);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(400px);
    }
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .notification-toast {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100px);
    }

    .notification-toast.show {
        transform: translateY(0);
    }

    .notifications-modal-content {
        padding: 20px;
        max-height: 90vh;
    }

    .notification-card {
        padding: 12px;
    }

    .notification-avatar {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}
