/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
    height: 100vh;
    overflow: hidden !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    position: fixed; /* Prevent any body movement */
    width: 100%;
    top: 0;
    left: 0;
    /* iOS Safe Area Support */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Prevent background scrolling when modal is open, but allow modal scrolling */
body.modal-open {
    overflow: hidden !important;
}

/* Ensure lines container can always scroll regardless of modal state */
.lines-container {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

/* Mobile viewport fix for modals */
@media (max-width: 768px) {
    body.modal-open {
        position: fixed !important;
        width: 100% !important;
        height: 100vh !important;
        height: 100dvh !important;
        top: 0 !important;
        left: 0 !important;
    }
    
    .modal-content {
        max-height: 80vh;
        margin-top: 2rem;
        margin-bottom: 2rem;
    }
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 70px 20px 20px 20px; /* Reduced bottom padding */
    height: calc(100vh - 80px); /* Account for menu bar by default */
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    box-sizing: border-box;
    width: 100%;
    position: relative;
    /* Lock main container in place */
    transform: none !important;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: auto;
}

/* iOS Standalone Mode Safe Area Adjustments */
@media (display-mode: standalone) {
    .container {
        /* Keep original positioning - header handles safe area with margin-top */
        padding-top: 70px;
        height: calc(100vh - 200px - env(safe-area-inset-bottom)) !important;
        padding-bottom: 20px !important; /* Ensure bottom border is visible */
        /* Account for header (70px) and footer (80px) with larger 50px gap - significantly shorter */
    }
    
    .app-header-bar {
        /* Header moves down by safe area amount, no height change needed */
        top: env(safe-area-inset-top);
    }
}

/* Safari-specific container fixes */
@supports (-webkit-touch-callout: none) {
    .container {
        height: calc(100vh - 80px) !important; /* Force height calculation in Safari */
        height: calc(100dvh - 80px) !important;
        padding-bottom: 10px !important; /* Minimal bottom padding */
        max-height: none; /* Remove max-height conflicts */
    }
}

/* Override Safari rules specifically for standalone mode */
@supports (-webkit-touch-callout: none) {
    @media (display-mode: standalone) {
        .container {
            height: calc(100vh - 200px - env(safe-area-inset-bottom)) !important;
            padding-bottom: 20px !important; /* Ensure bottom border is visible in Safari standalone */
            /* Override Safari height - significantly shorter with large gap above footer */
        }
    }
    
    /* Ensure floating menu is visible in Safari */
    .floating-menu {
        bottom: env(safe-area-inset-bottom, 0);
        padding-bottom: env(safe-area-inset-bottom, 12px);
        height: 80px; /* Force specific height */
    }
    
    /* Ensure lines section reaches closer to menu in Safari */
    section.lines-section {
        flex: 1;
        min-height: 0;
        max-height: calc(100vh - 220px) !important; /* Match standalone container height */
        max-height: calc(100dvh - 220px) !important;
        overflow: hidden !important; /* Force container overflow handling - NO SCROLL */
        overflow-x: hidden !important;
        overflow-y: hidden !important;
        margin-bottom: 10px; /* Small margin from menu */
        /* Lock container position completely */
        position: relative;
        transform: none !important;
        scroll-behavior: auto;
        -webkit-overflow-scrolling: auto;
        overscroll-behavior: none;
    }
    
    /* Force body height calculation in Safari */
    body {
        height: 100vh !important;
        height: 100dvh !important;
    }
}

/* Header Styles */
/* Floating App Header */
.app-header-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(102, 126, 234, 0.8);
    backdrop-filter: blur(10px);
    color: white;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.2);
    z-index: 999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* iOS Safe Area Support */
    padding-top: 0.75rem;
    padding-left: calc(1.5rem + env(safe-area-inset-left));
    padding-right: calc(1.5rem + env(safe-area-inset-right));
    margin-top: env(safe-area-inset-top);
}

.app-name {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Section Styles */
section {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    flex-shrink: 0;
    margin-top: -20px; /* Move section up */
    position: relative;
    overflow: hidden;
    overflow-x: hidden;
    overflow-y: hidden;
    transition: all 0.3s ease;
}

/* Decorative corner frames for sections */
section::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    width: 25px;
    height: 25px;
    border-top: 3px solid #667eea;
    border-left: 3px solid #667eea;
    border-top-left-radius: 16px;
    opacity: 0.5;
}

section::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 25px;
    height: 25px;
    border-bottom: 3px solid #667eea;
    border-right: 3px solid #667eea;
    border-bottom-right-radius: 16px;
    opacity: 0.5;
}

section.lines-section {
    flex: 1;
    min-height: 0;
    margin-top: 15px; /* Move lines section down slightly */
    overflow: hidden !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    width: 100%;
    max-width: 100%;
    /* ABSOLUTE LOCK - NO MOVEMENT ALLOWED */
    position: relative !important;
    transform: none !important;
    scroll-behavior: auto !important;
    -webkit-overflow-scrolling: auto !important;
    overscroll-behavior: none !important;
    overscroll-behavior-y: none !important;
    overscroll-behavior-x: none !important;
    touch-action: none !important;
    pointer-events: auto;
    /* Prevent any type of scrolling or movement */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Input Section */
/* Removed Create Section - now in menu bar */

/* Input Section */
.input-section {
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    border: 2px solid #e8f0fe;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.input-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4285f4, #34a853, #fbbc05, #ea4335);
    border-radius: 16px 16px 0 0;
}

.input-container:focus-within {
    border-color: #4285f4;
    box-shadow: 0 25px 70px rgba(66, 133, 244, 0.2);
}

/* Close Button */
.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #6b7280;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #374151;
}

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

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

.input-section.hidden {
    display: none;
}

/* Modal Overlay Styles */
.input-section {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: manipulation;
    -webkit-overflow-scrolling: touch;
}

.input-container {
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 2px solid #e8f0fe;
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 500px;
    margin: 2rem auto;
    animation: slideDown 0.3s ease;
    min-height: auto;
    max-height: calc(100vh - 4rem);
}

.input-section h2 {
    margin: 0 0 1.5rem 0;
    color: #1a202c;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-fields-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .input-fields-row {
        grid-template-columns: 1fr;
    }
    
    .input-section {
        padding: 0.5rem;
        align-items: center;
    }
    
    .input-container {
        margin: 1rem auto;
        padding: 1.5rem;
        max-height: calc(100vh - 2rem);
        max-width: calc(100vw - 1rem);
    }
    
    /* Adjust for virtual keyboard on mobile */
    @supports (-webkit-touch-callout: none) {
        .input-section {
            height: 100vh;
            height: 100dvh; /* Dynamic viewport height for mobile browsers */
        }
        
        .input-container {
            max-height: calc(100dvh - 2rem);
        }
    }
}

.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.button-group .btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 10px;
    font-weight: 600;
    min-width: 140px;
    justify-content: center;
}

.number-field {
    min-width: 80px;
}

.number-input {
    width: 100%;
    text-align: center;
    font-weight: 600;
    padding: 0.75rem 0.5rem;
}

.input-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-field label {
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-field input {
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.input-field input:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 4px rgba(66, 133, 244, 0.1);
    background: white;
}

.input-field input::placeholder {
    color: #9ca3af;
    font-style: italic;
}

.input-field label {
    font-weight: 500;
    color: #4a5568;
}

.input-field input {
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #f7fafc;
}

.input-field input:focus {
    outline: none;
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Label with Toggle Container */
.label-with-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.label-with-toggle label {
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* Reader Toggle Container */
.reader-toggle-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Reader Toggle Button */
.reader-toggle-btn {
    position: relative;
    width: 40px;
    height: 20px;
    background: #e5e7eb;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.reader-toggle-btn:hover {
    background: #d1d5db;
}

.reader-toggle-btn.active {
    background: #667eea;
}

.toggle-switch {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.reader-toggle-btn.active .toggle-switch {
    transform: translateX(20px);
}

/* Reader Designation Text */
.reader-designation {
    font-size: 0.9rem;
    font-weight: 600;
    color: #4a5568;
    min-width: 50px;
}

/* Line Item Reader Toggle */
.line-reader-toggle {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    z-index: 2;
}

.line-reader-toggle-btn {
    position: relative;
    width: 32px;
    height: 16px;
    background: #e5e7eb;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.line-reader-toggle-btn:hover {
    background: #d1d5db;
}

.line-reader-toggle-btn.active {
    background: #667eea;
}

.line-reader-toggle-btn .toggle-switch {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.line-reader-toggle-btn.active .toggle-switch {
    transform: translateX(16px);
}

.line-reader-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: #4a5568;
    min-width: 40px;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    background: #e2e8f0;
    color: #4a5568;
}

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

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #38a169;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.btn-danger {
    background: #f56565;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #e53e3e;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.3);
}

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

.btn-secondary:hover:not(:disabled) {
    background: #cbd5e0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(226, 232, 240, 0.3);
}

/* Lines Container */
.lines-section {
    height: calc(100vh - 180px); /* Account for header + footer */
    display: flex;
    flex-direction: column;
    margin-bottom: 60px; /* End at footer top */
    overflow: hidden !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    position: relative;
    /* Completely prevent any scrolling or movement */
    scroll-behavior: auto;
    -webkit-overflow-scrolling: auto;
    overscroll-behavior: none;
    overscroll-behavior-y: none;
    overscroll-behavior-x: none;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-shrink: 0;
    position: relative;
    overflow: hidden !important;
    /* LOCK HEADER - prevent any movement or scroll triggers */
    width: 100% !important;
    max-width: 100% !important;
    touch-action: none !important;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    pointer-events: auto;
}

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

.status-display .status-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f7fafc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.status-display .status-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: #4a5568;
    min-width: 80px;
    transition: all 0.3s ease;
}

/* Status Display Animations */
.status-display .status-icon.listening {
    background: rgba(72, 187, 120, 0.95);
    color: white;
    animation: pulse-gentle 2s infinite;
}

.status-display .status-icon.speaking {
    background: rgba(237, 137, 54, 0.95);
    color: white;
    animation: bounce-gentle 1s infinite;
}

.status-display .status-icon.stopped {
    background: #f7fafc;
    color: #4a5568;
}

.section-header h2 {
    margin: 0;
}

.mode-toggle-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mode-toggle-btn {
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.2rem;
}

.mode-toggle-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: scale(1.05);
}

.mode-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: #4a5568;
    min-width: 110px;
}

/* Voice Selector Styles */
.voice-selector-container {
    text-align: left;
    max-width: 500px;
    margin: 0 auto;
}

.voice-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.voice-selector-header h3 {
    margin: 0;
    color: #2d3748;
}

.voice-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #718096;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.voice-close-btn:hover {
    background: rgba(113, 128, 150, 0.1);
    color: #4a5568;
}

.voice-line-preview {
    background: #f7fafc;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-style: italic;
    color: #4a5568;
    border-left: 4px solid #667eea;
}

.voice-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.voice-option {
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    text-align: left;
}

.voice-option:hover {
    border-color: #667eea;
    background: #f7fafc;
}

.voice-option.selected {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.test-voice-btn {
    background: #48bb78;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s ease;
    width: 100%;
}

.test-voice-btn:hover {
    background: #38a169;
}

/* Delay Selector Styles */
.delay-selector-container {
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
}

.delay-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.delay-selector-header h3 {
    margin: 0;
    color: #2d3748;
}

.delay-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #718096;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.delay-close-btn:hover {
    background: rgba(113, 128, 150, 0.1);
    color: #4a5568;
}

.delay-line-preview {
    background: #f7fafc;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-style: italic;
    color: #4a5568;
    border-left: 4px solid #ed8936;
}

.delay-control {
    margin-bottom: 1.5rem;
}

.delay-control label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2d3748;
}

.delay-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.delay-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ed8936;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.delay-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ed8936;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.delay-buttons {
    display: flex;
    gap: 0.75rem;
}

.delay-save-btn {
    background: #ed8936;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s ease;
    flex: 1;
}

.delay-save-btn:hover {
    background: #dd7724;
}

.delay-cancel-btn {
    background: #718096;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s ease;
    flex: 1;
}

.delay-cancel-btn:hover {
    background: #4a5568;
}

.delay-btn {
    background: rgba(237, 137, 54, 0.1);
    border: 2px solid #ed8936;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.delay-btn:hover {
    background: rgba(237, 137, 54, 0.2);
    transform: scale(1.05);
}

.lines-container {
    flex: 1;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05), 0 4px 6px rgba(0, 0, 0, 0.05);
    /* ONLY this container is allowed to scroll - vertical only */
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
    width: 100% !important;
    max-width: 100% !important;
    /* Force proper scroll behavior - contained within locked parent */
    -webkit-overflow-scrolling: touch !important;
    scroll-behavior: smooth !important;
    min-height: 0 !important;
    height: auto !important;
    /* Prevent parent container scrolling */
    overscroll-behavior: contain !important;
    overscroll-behavior-y: contain !important;
    overscroll-behavior-x: none !important;
    /* Allow only internal scrolling */
    touch-action: pan-y !important;
}

/* Decorative corner frames for lines container */


.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #a0aec0;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.line-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    margin: 0.75rem 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    border: 2px solid transparent;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Decorative corner frames */
.line-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    border-top: 3px solid #667eea;
    border-left: 3px solid #667eea;
    border-top-left-radius: 12px;
    opacity: 0.7;
}

.line-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    border-bottom: 3px solid #667eea;
    border-right: 3px solid #667eea;
    border-bottom-right-radius: 12px;
    opacity: 0.7;
}

.drag-handle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    cursor: grab;
    color: #667eea;
    font-weight: bold;
    user-select: none;
    transition: all 0.2s ease;
    background: #f7fafc;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.drag-handle:hover {
    color: #667eea;
    transform: scale(1.1);
}

.drag-handle:active {
    cursor: grabbing;
}

.line-item.dragging {
    opacity: 0.9;
    transform: rotate(2deg) scale(1.05);
    z-index: 1000;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), 0 5px 15px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-color: #667eea;
    border-width: 2px;
}

.line-item.drag-over {
    background: rgba(72, 187, 120, 0.15);
    border-color: #48bb78;
    border-style: dashed;
    border-width: 2px;
    box-shadow: inset 0 0 10px rgba(72, 187, 120, 0.2);
    position: relative;
}

/* Visual drop indicator */
.line-item.drag-over::before {
    content: '↓ Drop here ↓';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: #48bb78;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    white-space: nowrap;
    z-index: 1001;
}

/* Smooth shift animations for other items during drag */
.line-item.drag-shift-up,
.line-item.drag-shift-down {
    transition: transform 0.2s ease-out;
}

.line-item:hover {
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
    border-color: #667eea;
    box-shadow: 0 8px 15px rgba(102, 126, 234, 0.15), 0 3px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.line-item:hover::before,
.line-item:hover::after {
    opacity: 1;
}

.line-item.selected {
    background: linear-gradient(135deg, #edf2f7 0%, #e6fffa 100%);
    border-color: #667eea;
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.line-item.selected::before {
    border-color: #4c51bf;
}

.line-item.selected::after {
    border-color: #4c51bf;
}

.line-item.selected .line-number {
    background: #4c51bf;
    transform: scale(1.05);
}

.line-item.playing {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.line-item.playing .cue-text {
    color: rgba(255, 255, 255, 0.9);
}

.line-item.playing .drag-handle {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.line-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.line-item:last-child {
    border-bottom: none;
}

.line-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    overflow: hidden;
}

.line-text {
    font-size: 1rem;
    color: #2d3748;
    font-weight: 500;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    max-width: 100%;
}

.cue-text {
    font-size: 0.875rem;
    color: #667eea;
    font-weight: 500;
    background: rgba(102, 126, 234, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
    max-width: fit-content;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.line-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.play-line-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #10b981;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.play-line-btn:hover {
    background: #059669;
    transform: scale(1.1);
}

.play-line-btn:disabled {
    background: #9ca3af !important;
    color: #6b7280 !important;
    cursor: not-allowed !important;
    transform: none !important;
    opacity: 0.6;
}

.edit-btn, .remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
}

.edit-btn {
    color: #319795;
}

.edit-btn:hover {
    background: rgba(49, 151, 149, 0.1);
    color: #2c7a7b;
}

.remove-btn {
    color: #f56565;
}

.remove-btn:hover {
    background: rgba(245, 101, 101, 0.1);
    color: #e53e3e;
}

/* Controls Section */
.controls-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e2e8f0;
    color: #4a5568;
    transition: all 0.3s ease;
}

.status-icon.listening {
    background: #48bb78;
    color: white;
    animation: pulse 2s infinite;
}

.status-icon.speaking {
    background: #ed8936;
    color: white;
    animation: bounce 1s infinite;
}

.status-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: #4a5568;
}

.control-buttons {
    display: flex;
    gap: 1rem;
}

/* Warning Styles */
.warning {
    background: #fed7d7;
    color: #c53030;
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid #feb2b2;
}

/* Director Instructions - Center Screen */
.director-instructions-center {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    transition: all 0.3s ease;
}

.director-instructions-center.hidden {
    display: none;
}

.director-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 40px;
    border-radius: 25px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    min-width: 300px;
}

.director-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    animation: pulse 2s infinite;
}

.director-text {
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

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

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 10000;
    overflow-y: auto;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
}

.modal-content {
    background: white;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 800px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f7fafc;
}

.modal-header h3 {
    margin: 0;
    color: #2d3748;
    font-size: 1.25rem;
    flex: 1;
}

.modal-header i {
    color: #f56565;
}

.modal-header .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: scroll;
    flex: 1;
    -webkit-overflow-scrolling: touch;
    white-space: pre-wrap;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    background: #f8fafc;
    max-height: 70vh;
    word-break: break-word;
}

.record-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.record-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 40vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: #f7fafc;
}

.modal-footer .btn {
    min-width: 80px;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Debug Modal Styles */
.debug-modal-content {
    max-width: 800px;
    max-height: 80vh;
}

.debug-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.debug-logs-container {
    background: #1a202c;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.debug-log-entry {
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid #2d3748;
}

.debug-log-entry:last-child {
    border-bottom: none;
}

.debug-log-timestamp {
    color: #718096;
    font-size: 0.75rem;
}

.debug-log-level-info {
    color: #63b3ed;
}

.debug-log-level-warn {
    color: #f6e05e;
}

.debug-log-level-error {
    color: #fc8181;
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Responsive Design */
@media (max-width: 640px) {
    .container {
        padding: 10px;
    }
    
    header {
        padding: 1.5rem 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    section {
        padding: 1.5rem;
    }
    
    .controls-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-buttons {
        justify-content: center;
    }
    
    .status-indicator {
        justify-content: center;
    }
    
    .line-item {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .input-group {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .number-field {
        grid-column: 1;
        justify-self: start;
        min-width: 60px;
    }
    
    .line-item {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .line-number {
        min-width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .line-content {
        flex: 1;
        min-width: 200px;
    }
    
    .line-actions {
        gap: 0.25rem;
    }
    
    .edit-btn, .remove-btn {
        min-width: 32px;
        height: 32px;
        padding: 0.4rem;
    }
    
    .floating-indicator {
        bottom: 80px;
        left: 10px;
        padding: 10px 12px;
        font-size: 0.8rem;
    }
    
    .indicator-text {
        font-size: 0.8rem;
    }
    
    /* Menu Status Indicator Mobile */
    .menu-status-indicator {
        padding: 6px 10px;
        gap: 0.4rem;
    }
    
    .menu-status-icon {
        font-size: 0.9rem;
    }
    
    .menu-status-text {
        font-size: 0.7rem;
    }
    
    /* Adjust container padding for mobile */
    .container {
        padding-bottom: 90px;
    }
    
    /* Mobile Header */
    .app-header-bar {
        padding: 0.5rem 1rem;
    }
    
    .app-name {
        font-size: 1rem;
        letter-spacing: 1px;
    }
    
    /* Adjust container padding for mobile */
    .container {
        padding-top: 50px;
    }
}

/* Settings Modal Styles */
.settings-section {
    padding: 0;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.setting-icon {
    font-size: 1.5rem;
    margin-right: 1rem;
}

.setting-text {
    display: flex;
    flex-direction: column;
}

.setting-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.setting-desc {
    font-size: 0.875rem;
    color: #64748b;
}

.setting-toggle {
    position: relative;
    width: 48px;
    height: 24px;
    background: #e2e8f0;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.setting-toggle.active {
    background: #3b82f6;
}

.setting-toggle .toggle-switch {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.setting-toggle.active .toggle-switch {
    transform: translateX(24px);
}

.setting-button {
    padding: 0.5rem 1rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #334155;
    font-weight: 500;
}

.setting-button:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

.setting-button.danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.setting-button.danger:hover {
    background: #fee2e2;
}

/* Menu Modal Styles */
.menu-modal {
    z-index: 2000;
}

.menu-content {
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.menu-content .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.menu-content .modal-header h3 {
    margin: 0;
    color: #2d3748;
    font-size: 1.25rem;
    font-weight: 600;
}

.menu-content .close-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #64748b;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    position: static; /* Override absolute positioning */
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #64748b;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #f1f5f9;
    color: #475569;
}

.menu-body {
    padding: 1.5rem 0 0.5rem 0;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    justify-items: center;
}

.menu-item-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.75rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 80px;
    width: 100%;
    max-width: 120px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.menu-item-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-color: #cbd5e1;
}

.menu-item-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.menu-icon {
    font-size: 1.5rem;
    display: block;
}

.menu-text {
    font-size: 0.75rem;
    font-weight: 500;
    color: #475569;
    text-align: center;
    line-height: 1.2;
}

/* Mobile adjustments for menu */
@media (max-width: 768px) {
    .menu-content {
        width: 95%;
        max-height: 70vh;
    }
    
    .menu-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.75rem;
    }
    
    .menu-item-btn {
        padding: 0.75rem 0.5rem;
        min-height: 70px;
        max-width: 100px;
    }
    
    .menu-icon {
        font-size: 1.25rem;
    }
    
    .menu-text {
        font-size: 0.7rem;
    }
}

/* Conflict Dialog removed - using automatic numbering */

/* Floating Menu Bar */
.floating-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    padding: 12px 20px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    min-height: 80px; /* Ensure consistent height across browsers */
}



.menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: #f7fafc;
    color: #4a5568;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.menu-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.create-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white !important;
}

.create-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    transform: translateY(-2px) !important;
}

.create-btn:disabled {
    background: #9ca3af !important;
    color: #6b7280 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.record-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    color: white !important;
}

.record-btn:hover {
    background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%) !important;
    transform: translateY(-2px) !important;
}

.record-btn:disabled {
    background: #9ca3af !important;
    color: #6b7280 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.play-btn {
    background: #667eea;
    color: white;
    width: 56px;
    height: 56px;
    font-size: 1.4rem;
}

.play-btn:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.play-btn.stop-btn {
    background: #f56565;
}

.play-btn.stop-btn:hover {
    background: #e53e3e;
}

.settings-btn {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%) !important;
    color: white !important;
}

.settings-btn:hover {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%) !important;
    transform: translateY(-2px) !important;
}

.placeholder-btn {
    opacity: 0.6;
    cursor: not-allowed;
}

.placeholder-btn:hover {
    background: #f7fafc;
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Add padding to main content to avoid overlap with floating elements */
.container {
    padding-bottom: 80px; /* Space for status bar */
    padding-top: 60px; /* Space for floating header */
}

/* Menu Status Indicator */
.menu-status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(247, 250, 252, 0.9);
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, 0.6);
    backdrop-filter: blur(5px);
    margin-left: auto;
}

.menu-status-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.menu-status-text {
    font-size: 0.8rem;
    font-weight: 500;
    color: #4a5568;
    margin: 0;
    white-space: nowrap;
}

/* Floating Status Indicator */
.floating-indicator {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(102, 126, 234, 0.95);
    color: white;
    padding: 12px 16px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    z-index: 1000;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.floating-indicator.listening {
    background: rgba(72, 187, 120, 0.95);
    animation: pulse-gentle 2s infinite;
}

.floating-indicator.speaking {
    background: rgba(237, 137, 54, 0.95);
    animation: bounce-gentle 1s infinite;
}

.indicator-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.indicator-text {
    font-size: 0.875rem;
    white-space: nowrap;
}

/* Gentle animations for floating indicator */
@keyframes pulse-gentle {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

@keyframes bounce-gentle {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

/* Dark Mode Styles */
body.dark-mode {
    background-color: #1a202c;
    color: #e2e8f0;
}

body.dark-mode .container {
    background-color: #1a202c;
}

body.dark-mode .main-content {
    background-color: #1a202c;
}

body.dark-mode .section-header {
    background-color: #2d3748;
    border-color: #4a5568;
}

body.dark-mode .content-area {
    background-color: #1a202c;
}

body.dark-mode .app-container {
    background-color: #1a202c;
}

body.dark-mode main {
    background-color: #1a202c;
}

body.dark-mode .lines-section {
    background-color: #1a202c;
}

body.dark-mode .warning {
    background-color: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .floating-indicator {
    background: rgba(26, 32, 44, 0.95);
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .indicator-text {
    color: #e2e8f0;
}

body.dark-mode .toggle-switch {
    background-color: #4a5568;
}

body.dark-mode .reader-toggle-btn.active .toggle-switch {
    background-color: #48bb78;
}

body.dark-mode .reader-designation {
    color: #e2e8f0;
}

body.dark-mode .status-text {
    color: #ffffff;
}

body.dark-mode .mode-text {
    color: #ffffff;
}

body.dark-mode .line-reader-designation {
    color: #ffffff;
}

body.dark-mode .reader-me-toggle {
    color: #ffffff;
}

body.dark-mode .modal {
    background-color: rgba(0, 0, 0, 0.8);
}

body.dark-mode .menu-modal {
    background-color: rgba(0, 0, 0, 0.8);
}

body.dark-mode .settings-modal {
    background-color: rgba(0, 0, 0, 0.8);
}

body.dark-mode .alert-modal {
    background-color: rgba(0, 0, 0, 0.8);
}

body.dark-mode .create-choice-modal {
    background-color: rgba(0, 0, 0, 0.8);
}

body.dark-mode .record-modal {
    background-color: rgba(0, 0, 0, 0.8);
}

body.dark-mode .menu-text {
    color: #ffffff;
}

body.dark-mode .menu-icon {
    color: #ffffff;
}

body.dark-mode .setting-title {
    color: #ffffff;
}

body.dark-mode .setting-desc {
    color: #a0aec0;
}

body.dark-mode .close-btn {
    color: #ffffff;
}

body.dark-mode .director-text {
    color: #ffffff;
}

body.dark-mode .line-reader-text {
    color: #ffffff;
}

body.dark-mode .delay-modal,
body.dark-mode .voice-modal,
body.dark-mode .conflict-modal {
    background-color: rgba(0, 0, 0, 0.8) !important;
}

body.dark-mode .delay-content,
body.dark-mode .voice-content,
body.dark-mode .conflict-content {
    background: #2d3748 !important;
    color: #e2e8f0;
}

/* Ensure all modal containers are dark */
body.dark-mode .modal > .modal-content {
    background: #2d3748 !important;
}

body.dark-mode .settings-modal .modal-content {
    background: #2d3748 !important;
}

/* Specific fix for settings modal */
body.dark-mode #settingsModal {
    background-color: rgba(0, 0, 0, 0.8) !important;
}

body.dark-mode #settingsModal .modal-content {
    background: #2d3748 !important;
    color: #e2e8f0 !important;
}

body.dark-mode #settingsModal .modal-body {
    background: #2d3748 !important;
}

body.dark-mode #settingsModal .settings-section {
    background: #2d3748 !important;
}

/* Specific fix for menu modal */
body.dark-mode #menuModal {
    background-color: rgba(0, 0, 0, 0.8) !important;
}

body.dark-mode #menuModal .modal-content {
    background: #2d3748 !important;
    color: #e2e8f0 !important;
}

body.dark-mode #menuModal .menu-content {
    background: #2d3748 !important;
    color: #e2e8f0 !important;
}

body.dark-mode #menuModal .modal-body {
    background: #2d3748 !important;
}

body.dark-mode #menuModal .menu-body {
    background: #2d3748 !important;
}

body.dark-mode #menuModal .menu-grid {
    background: #2d3748 !important;
}

body.dark-mode #menuModal .menu-item-btn {
    background: #374151 !important;
    border-color: #4a5568 !important;
    color: #e2e8f0 !important;
}

body.dark-mode #menuModal .menu-item-btn:hover {
    background: #4b5563 !important;
}

/* Fix all other modal dialogs for dark mode */
body.dark-mode .alert-modal,
body.dark-mode .create-choice-modal,
body.dark-mode .record-modal,
body.dark-mode .delay-modal,
body.dark-mode .voice-modal,
body.dark-mode .conflict-modal {
    background-color: rgba(0, 0, 0, 0.8) !important;
}

body.dark-mode .alert-modal .modal-content,
body.dark-mode .create-choice-modal .modal-content,
body.dark-mode .record-modal .modal-content,
body.dark-mode .delay-modal .modal-content,
body.dark-mode .voice-modal .modal-content,
body.dark-mode .conflict-modal .modal-content {
    background: #2d3748 !important;
    color: #e2e8f0 !important;
}

/* Specific fix for alert modal (used by Directions, About, Privacy, Terms, Help, Feedback) */
body.dark-mode #alertModal {
    background-color: rgba(0, 0, 0, 0.8) !important;
}

body.dark-mode #alertModal .modal-content {
    background: #2d3748 !important;
    color: #e2e8f0 !important;
}

body.dark-mode #alertModal .modal-body {
    background: #2d3748 !important;
    color: #e2e8f0 !important;
}

body.dark-mode #alertMessage {
    color: #ffffff !important;
}

body.dark-mode #alertModal .modal-footer {
    background: #1a202c !important;
    border-top-color: #4a5568 !important;
}

body.dark-mode #alertModal .modal-footer .btn {
    color: #e2e8f0 !important;
}

body.dark-mode #alertModal .modal-footer .btn-primary {
    background: #667eea !important;
    border-color: #667eea !important;
}

body.dark-mode #alertModal .modal-footer .btn-primary:hover {
    background: #5a67d8 !important;
    border-color: #5a67d8 !important;
}

body.dark-mode #alertModal .modal-footer .btn-secondary {
    background: #4a5568 !important;
    border-color: #4a5568 !important;
}

body.dark-mode #alertModal .modal-footer .btn-secondary:hover {
    background: #2d3748 !important;
    border-color: #2d3748 !important;
}

/* Dark mode styles for license modal */
body.dark-mode #licenseModal {
    background-color: rgba(0, 0, 0, 0.8) !important;
}

body.dark-mode #licenseModal .modal-content {
    background: #2d3748 !important;
    color: #e2e8f0 !important;
}

body.dark-mode #licenseModal .modal-body {
    background: #2d3748 !important;
    color: #e2e8f0 !important;
}

body.dark-mode #licenseMessage {
    color: #ffffff !important;
}

body.dark-mode #licenseModal .modal-footer {
    background: #1a202c !important;
    border-top-color: #4a5568 !important;
}

body.dark-mode #licenseModal .modal-footer .btn {
    color: #e2e8f0 !important;
}

body.dark-mode #licenseModal .modal-footer .btn-primary {
    background: #667eea !important;
    border-color: #667eea !important;
}

body.dark-mode #licenseModal .modal-footer .btn-primary:hover {
    background: #5a67d8 !important;
    border-color: #5a67d8 !important;
}

body.dark-mode #licenseModal .modal-footer .btn-secondary {
    background: #4a5568 !important;
    border-color: #4a5568 !important;
}

body.dark-mode #licenseModal .modal-footer .btn-secondary:hover {
    background: #2d3748 !important;
    border-color: #2d3748 !important;
}

/* Dark mode styles for upgrade modal */
body.dark-mode #alertModal4 {
    background-color: rgba(0, 0, 0, 0.8) !important;
}

body.dark-mode #alertModal4 .modal-content {
    background: #2d3748 !important;
    color: #e2e8f0 !important;
}

body.dark-mode #alertModal4 .modal-header {
    background: #2d3748 !important;
    border-bottom-color: #4a5568 !important;
    color: #ffffff !important;
}

body.dark-mode #alertModal4 .modal-header h3 {
    color: #ffffff !important;
}

body.dark-mode #alertModal4 .modal-body {
    background: #2d3748 !important;
    color: #e2e8f0 !important;
}

body.dark-mode #alertModal4 .upgrade-content {
    background: #2d3748 !important;
    color: #e2e8f0 !important;
}

body.dark-mode #alertModal4 .upgrade-content p {
    color: #e2e8f0 !important;
}

body.dark-mode #alertModal4 .upgrade-option {
    background: #1a202c !important;
    border-color: #4a5568 !important;
    color: #e2e8f0 !important;
}

body.dark-mode #alertModal4 .upgrade-option h4 {
    color: #ffffff !important;
}

body.dark-mode #alertModal4 .upgrade-divider {
    color: #a0aec0 !important;
}

body.dark-mode #alertModal4 .license-input {
    background: #1a202c !important;
    border-color: #4a5568 !important;
    color: #ffffff !important;
}

body.dark-mode #alertModal4 .license-input::placeholder {
    color: #a0aec0 !important;
}

body.dark-mode #alertModal4 .btn {
    color: #e2e8f0 !important;
}

body.dark-mode #alertModal4 .btn-primary {
    background: #667eea !important;
    border-color: #667eea !important;
}

body.dark-mode #alertModal4 .btn-primary:hover {
    background: #5a67d8 !important;
    border-color: #5a67d8 !important;
}

body.dark-mode #alertModal4 .btn-secondary {
    background: #4a5568 !important;
    border-color: #4a5568 !important;
}

body.dark-mode #alertModal4 .btn-secondary:hover {
    background: #2d3748 !important;
    border-color: #2d3748 !important;
}

/* Dark mode styles for Alert Modal 2 */
body.dark-mode #alertModal2 {
    background-color: rgba(0, 0, 0, 0.8) !important;
}

body.dark-mode #alertModal2 .modal-content {
    background: #2d3748 !important;
    color: #e2e8f0 !important;
}

body.dark-mode #alertModal2 .modal-body {
    background: #2d3748 !important;
    color: #e2e8f0 !important;
}

body.dark-mode #alertMessage2 {
    color: #ffffff !important;
}

body.dark-mode #alertModal2 .modal-footer {
    background: #1a202c !important;
    border-top-color: #4a5568 !important;
}

body.dark-mode #alertModal2 .modal-footer .btn {
    color: #e2e8f0 !important;
}

body.dark-mode #alertModal2 .modal-footer .btn-primary {
    background: #667eea !important;
    border-color: #667eea !important;
}

body.dark-mode #alertModal2 .modal-footer .btn-primary:hover {
    background: #5a67d8 !important;
    border-color: #5a67d8 !important;
}

body.dark-mode #alertModal2 .modal-footer .btn-secondary {
    background: #4a5568 !important;
    border-color: #4a5568 !important;
}

body.dark-mode #alertModal2 .modal-footer .btn-secondary:hover {
    background: #2d3748 !important;
    border-color: #2d3748 !important;
}

/* Delete Scene Button in Menu */
.menu-btn.delete-scene-btn {
    background: #ef4444 !important;
    color: white !important;
}

.menu-btn.delete-scene-btn:hover {
    background: #dc2626 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(239, 68, 68, 0.3);
}

.menu-btn.delete-scene-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

/* Dark mode styles for delete button */
body.dark-mode .menu-btn.delete-scene-btn {
    background: #ef4444 !important;
    color: white !important;
}

body.dark-mode .menu-btn.delete-scene-btn:hover {
    background: #dc2626 !important;
}

/* Dark mode styles for modal headers */
body.dark-mode .modal-header {
    background: #1a202c !important;
    border-bottom-color: #4a5568 !important;
}

body.dark-mode .modal-header h3 {
    color: #e2e8f0 !important;
}

body.dark-mode .modal-header .btn {
    color: #e2e8f0 !important;
}

body.dark-mode .modal-header .btn-secondary {
    background: #4a5568 !important;
    border-color: #4a5568 !important;
}

body.dark-mode .modal-header .btn-secondary:hover {
    background: #2d3748 !important;
    border-color: #2d3748 !important;
}

/* Dark mode styles for Alert Modal 3 */
body.dark-mode #alertModal3 .modal-content {
    background: #1a202c !important;
    border-color: #4a5568 !important;
}

body.dark-mode #alertModal3 .modal-body {
    background: #1a202c !important;
    color: #e2e8f0 !important;
}

body.dark-mode #alertModal3 .modal-footer {
    background: #1a202c !important;
    border-color: #4a5568 !important;
}

body.dark-mode #alertModal3 .modal-footer .btn-primary {
    background: #ef4444 !important;
    border-color: #ef4444 !important;
    color: white !important;
}

body.dark-mode #alertModal3 .modal-footer .btn-primary:hover {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
}

body.dark-mode #alertModal3 .modal-footer .btn-secondary {
    background: #4a5568 !important;
    border-color: #4a5568 !important;
    color: #e2e8f0 !important;
}

body.dark-mode #alertModal3 .modal-footer .btn-secondary:hover {
    background: #2d3748 !important;
    border-color: #2d3748 !important;
}

/* Enhanced Dark Mode Line Item Styling */
body.dark-mode .line-item {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border-color: transparent;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.4);
}

body.dark-mode .line-item::before {
    border-color: #667eea;
}

body.dark-mode .line-item::after {
    border-color: #667eea;
}

body.dark-mode .line-item:hover {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    border-color: #667eea;
    box-shadow: 0 8px 15px rgba(102, 126, 234, 0.3), 0 3px 6px rgba(0, 0, 0, 0.4);
}

body.dark-mode .line-item.selected {
    background: linear-gradient(135deg, #2d3748 0%, #1e3a3a 100%);
    border-color: #667eea;
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

body.dark-mode .line-item.dragging {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    border-color: #667eea;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 5px 15px rgba(102, 126, 234, 0.5);
}

body.dark-mode .line-item.drag-over {
    background: rgba(72, 187, 120, 0.2);
    border-color: #48bb78;
    border-style: dashed;
    border-width: 2px;
    box-shadow: inset 0 0 10px rgba(72, 187, 120, 0.3);
}

body.dark-mode .line-item.drag-over::before {
    background: #48bb78;
    color: white;
}

body.dark-mode .line-text {
    color: #e2e8f0;
}

body.dark-mode .cue-text {
    color: #90cdf4;
    background: rgba(102, 126, 234, 0.2);
}

body.dark-mode .drag-handle {
    background: #4a5568;
    border-color: #4a5568;
    color: #90cdf4;
}

body.dark-mode .menu-modal .modal-content {
    background: #2d3748 !important;
}

body.dark-mode .alert-modal .modal-content {
    background: #2d3748 !important;
}

body.dark-mode .create-choice-modal .modal-content {
    background: #2d3748 !important;
}

body.dark-mode .record-modal .modal-content {
    background: #2d3748 !important;
}

/* Force all modal backgrounds and content to be dark */
body.dark-mode .modal .modal-content,
body.dark-mode .modal-content,
body.dark-mode .menu-content,
body.dark-mode .input-container {
    background: #2d3748 !important;
    color: #e2e8f0 !important;
}

body.dark-mode .app-header-bar {
    background: rgba(26, 32, 44, 0.95);
    border-bottom-color: #4a5568;
}

body.dark-mode .floating-menu {
    background: rgba(26, 32, 44, 0.95);
    border-top-color: #4a5568;
}

body.dark-mode .modal-content {
    background: #2d3748 !important;
    color: #e2e8f0;
}

body.dark-mode .menu-content {
    background: #2d3748 !important;
    color: #e2e8f0;
}

body.dark-mode .input-container {
    background: #2d3748 !important;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .modal-header {
    border-bottom-color: #4a5568;
}

body.dark-mode .setting-item {
    border-bottom-color: #4a5568;
}

body.dark-mode .setting-title {
    color: #e2e8f0;
}

body.dark-mode .setting-desc {
    color: #a0aec0;
}

body.dark-mode .section-header h2 {
    color: #e2e8f0;
}

body.dark-mode .line-item {
    background: #2d3748;
    border-color: #4a5568;
}

body.dark-mode .line-item:hover {
    background: #374151;
}

body.dark-mode .empty-state {
    color: #a0aec0;
}

body.dark-mode .line-to-speak {
    color: #ffffff !important;
}

body.dark-mode .line-text {
    color: #e2e8f0;
}

body.dark-mode .cue-text {
    color: #a0aec0;
}

body.dark-mode .line-number {
    color: #cbd5e0;
}

body.dark-mode .scene-container {
    background: #2d3748;
    border-color: #4a5568;
}

body.dark-mode .lines-container {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border-color: #4a5568;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 4px 6px rgba(0, 0, 0, 0.4);
}

body.dark-mode .lines-container::before,
body.dark-mode .lines-container::after {
    border-color: #90cdf4;
    opacity: 0.8;
}

/* Dark Mode Section Styling */
body.dark-mode section {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border-color: transparent;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.4);
}

body.dark-mode section::before,
body.dark-mode section::after {
    border-color: #90cdf4;
    opacity: 0.7;
}

body.dark-mode .alert-modal .modal-content {
    background: #2d3748;
    border-color: #4a5568;
}

body.dark-mode .alert-message {
    color: #e2e8f0;
}

body.dark-mode .input-section {
    background: rgba(0, 0, 0, 0.8) !important;
}

body.dark-mode .input-section .input-container {
    background: #2d3748 !important;
    border-color: #4a5568;
}

body.dark-mode .input-group label {
    color: #e2e8f0;
}

body.dark-mode .input-group input,
body.dark-mode .input-group textarea {
    background: #374151;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .input-group input::placeholder,
body.dark-mode .input-group textarea::placeholder {
    color: #9ca3af;
}

body.dark-mode .add-btn,
body.dark-mode .cancel-btn {
    background: #374151;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .add-btn:hover {
    background: #4b5563;
}

body.dark-mode .cancel-btn:hover {
    background: #4b5563;
}

body.dark-mode .menu-modal .modal-content {
    background: #2d3748;
    color: #e2e8f0;
}

body.dark-mode .menu-title {
    color: #e2e8f0;
    border-bottom-color: #4a5568;
}

body.dark-mode .menu-item {
    color: #e2e8f0;
    border-bottom-color: #4a5568;
}

body.dark-mode .menu-item:hover {
    background: #374151;
}

body.dark-mode .create-choice-modal .modal-content,
body.dark-mode .record-modal .modal-content {
    background: #2d3748;
    color: #e2e8f0;
}

body.dark-mode .choice-btn {
    background: #374151;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .choice-btn:hover {
    background: #4b5563;
}

body.dark-mode .record-controls {
    background: #374151;
    border-color: #4a5568;
}

body.dark-mode .record-btn {
    background: #374151;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .record-btn:hover {
    background: #4b5563;
}

body.dark-mode .audio-playback {
    background: #374151;
    border-color: #4a5568;
}

body.dark-mode .delay-modal .modal-content,
body.dark-mode .voice-modal .modal-content,
body.dark-mode .conflict-modal .modal-content {
    background: #2d3748;
    color: #e2e8f0;
}

body.dark-mode .delay-slider {
    background: #374151;
}

body.dark-mode .delay-slider::-webkit-slider-thumb {
    background: #e2e8f0;
}

body.dark-mode .voice-option {
    background: #374151;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .voice-option:hover {
    background: #4b5563;
}

body.dark-mode .conflict-actions button {
    background: #374151;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .conflict-actions button:hover {
    background: #4b5563;
}

/* Custom Scrollbar */
.lines-container::-webkit-scrollbar {
    width: 8px;
}

.lines-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

body.dark-mode .lines-container::-webkit-scrollbar-track {
    background: #2d3748;
}

.lines-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

body.dark-mode .lines-container::-webkit-scrollbar-thumb {
    background: #4a5568;
}

.lines-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

body.dark-mode .lines-container::-webkit-scrollbar-thumb:hover {
    background: #718096;
}

/* Create Choice Modal Styles */
.choice-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.5rem 0;
}

.choice-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.choice-btn:hover {
    border-color: #667eea;
    background: #edf2f7;
}

.choice-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.choice-text {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #2d3748;
}

.choice-desc {
    font-size: 0.9rem;
    color: #718096;
}

/* Record Modal Styles */
.record-section {
    margin-bottom: 2rem;
}

.record-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.record-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    width: 120px;
    height: 120px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.record-button:hover {
    background: #5a67d8;
    transform: scale(1.05);
}

.record-button.recording {
    background: #dc3545 !important;
    animation: pulse 1.5s infinite;
}

.record-button:not(.recording) {
    animation: none !important;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

#recordIcon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

#recordText {
    font-size: 1rem;
    font-weight: 600;
}

.recording-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #dc3545;
    font-weight: 600;
}

.recording-indicator {
    font-size: 1.2rem;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

.recorded-audio {
    text-align: center;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
}

.recorded-audio h4 {
    margin-bottom: 0.5rem;
    color: #2d3748;
}

.recorded-audio audio {
    width: 100%;
    max-width: 300px;
}

.record-inputs {
    margin-top: 1rem;
}

.reader-toggle-section {
    margin: 1.5rem 0;
}

.reader-toggle-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2d3748;
}

.toggle-container {
    display: flex;
    gap: 0.5rem;
}

.reader-toggle-btn {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    background: #f7fafc;
    color: #2d3748;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reader-toggle-btn.active {
    border-color: #667eea;
    background: #edf2f7;
    color: #667eea;
}

/* Recorded Audio Button Styling */
.recorded-audio-btn {
    background: rgba(72, 187, 120, 0.1);
    border: 2px solid #48bb78;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.recorded-audio-btn:hover {
    background: rgba(72, 187, 120, 0.2);
    transform: scale(1.05);
}

.recorded-audio-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.recorded-audio-btn:disabled:hover {
    transform: none;
    background: #e2e8f0;
}

/* Tap to Skip Button */
.tap-to-skip-btn {
    position: absolute;
    right: 8px;
    top: 0;
    bottom: 0;
    width: 35px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    z-index: 100;
    margin: 2px 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.tap-to-skip-btn:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #553c9a 100%);
    transform: translateX(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.tap-to-skip-btn:active {
    transform: translateX(0) scale(0.98);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.skip-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.skip-text span {
    display: block;
    height: auto;
    line-height: 1;
}

/* Ensure the lines section is positioned relative for absolute positioning */
.lines-section {
    position: relative;
}

/* Dark mode styles for tap-to-skip */
body.dark-mode .tap-to-skip-btn {
    background: linear-gradient(135deg, #4c51bf 0%, #553c9a 100%);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(76, 81, 191, 0.4);
}

body.dark-mode .tap-to-skip-btn:hover {
    background: linear-gradient(135deg, #434190 0%, #4c1d95 100%);
    box-shadow: 0 4px 12px rgba(76, 81, 191, 0.5);
}

/* Upgrade Modal Styles */
.upgrade-modal {
    max-width: 500px;
    width: 90%;
}

.upgrade-content {
    text-align: center;
    padding: 10px 0;
}

.upgrade-content p {
    margin: 10px 0;
    line-height: 1.5;
}

.upgrade-options {
    margin-top: 20px;
}

.upgrade-option {
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
}

.dark-mode .upgrade-option {
    background: #2a2a2a;
    border-color: #404040;
}

.upgrade-option h4 {
    margin: 0 0 8px 0;
    color: #333;
}

.dark-mode .upgrade-option h4 {
    color: #e0e0e0;
}

.upgrade-divider {
    text-align: center;
    margin: 20px 0;
    font-weight: bold;
    color: #666;
}

.dark-mode .upgrade-divider {
    color: #999;
}

.upgrade-btn {
    font-size: 16px;
    padding: 12px 24px;
    margin: 10px 0;
}

.license-input-section {
    margin-top: 15px;
}

.license-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
    text-align: center;
    text-transform: uppercase;
    margin-bottom: 10px;
    background: white;
    color: #333;
}

.dark-mode .license-input {
    background: #333;
    border-color: #555;
    color: #e0e0e0;
}

.license-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.license-buttons .btn {
    flex: 1;
    max-width: 120px;
}
