/* Morse Code Generator Specific Styles */

/* CodeMirror 6 Editor Styles */
.cm-editor {
    height: auto;
    min-height: 200px;
    border: 2px solid rgba(52, 152, 219, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    font-family: 'Courier New', monospace;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cm-editor:focus-within {
    border-color: rgba(52, 152, 219, 0.6);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.cm-scroller {
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
}

.cm-content {
    padding: 12px;
    color: #2C3E50 !important;  /* Dark gray/black - Radio Theme */
}

.cm-line {
    padding: 2px 0;
    color: #2C3E50 !important;  /* Dark gray/black - Radio Theme */
}

/* Morse code syntax highlighting - Radio Theme - use !important to override defaults */
.cm-comment { 
    color: #95A5A6 !important;  /* Gray - less prominent */
    font-weight: normal !important;
    font-style: italic !important;
}

.cm-operator { 
    background-color: #EBF5FB !important;  /* Light blue background - like radio display */
    color: #3498DB !important;  /* Lighter blue text */
    font-weight: normal !important;
    padding: 2px 4px !important;
    border-radius: 3px !important;
    display: inline-block !important;
}

.cm-callsign { 
    color: #4A90E2 !important;  /* Bright blue - like radio display */
    font-weight: bold !important;
}

.cm-frequency { 
    color: #F39C12 !important;  /* Amber/gold */
    font-weight: 500 !important;
}

.cm-report { 
    color: #E67E22 !important;  /* Orange */
    font-weight: 500 !important;
}

.cm-prosign { 
    color: #E91E63 !important;  /* Pink/Magenta - for prosigns */
    font-weight: bold !important;
}

.cm-qcode { 
    color: #9C27B0 !important;  /* Purple - for Q-codes */
    font-weight: bold !important;
}

.cm-abbreviation { 
    color: #FF9800 !important;  /* Amber/Orange - for abbreviations */
    font-weight: 600 !important;
}

.cm-morse { 
    color: #4A90E2 !important;  /* Same bright blue as callsigns */
    font-weight: 600 !important;
    font-family: monospace;
}

/* Cursor and selection */
.cm-cursor {
    border-left: 2px solid #fff;
}

.cm-selectionBackground {
    background: rgba(100, 150, 255, 0.3) !important;
}

/* Gutters (line numbers) */
.cm-gutters {
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
}

.cm-activeLineGutter {
    background: rgba(255, 255, 255, 0.05);
}

/* WaveSurfer.js Audio Player Styles */
.waveform-container {
    margin-top: 15px;
    margin-left: -25px;
    margin-right: -25px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 2px solid rgba(52, 152, 219, 0.3);
    backdrop-filter: blur(10px);
    width: calc(100% + 50px);
    box-sizing: border-box;
}

#waveform {
    margin-bottom: 12px;
    cursor: pointer;
}

.waveform-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.waveform-btn {
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    font-weight: 500;
    font-size: 14px;
}

/* Desktop: Full buttons with text */
@media (min-width: 768px) {
    .waveform-btn {
        padding: 10px 20px;
        border-radius: 8px;
        min-width: 120px;
    }
    
    .waveform-btn svg {
        flex-shrink: 0;
    }
    
    .waveform-btn .btn-text {
        display: inline;
    }
}

/* Mobile: Icon-only circular buttons */
@media (max-width: 767px) {
    .waveform-btn {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        padding: 0;
    }
    
    .waveform-btn .btn-text {
        display: none;
    }
}

.waveform-btn-play {
    background: #007bff;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.waveform-btn-play:hover {
    background: #0056b3;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4);
}

.waveform-btn-play:active {
    transform: scale(0.95);
}

.waveform-btn-download {
    background: rgba(255, 255, 255, 0.95);
    color: #2c3e50;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.waveform-btn-download:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.waveform-btn-download:active {
    transform: scale(0.95);
}

.waveform-time {
    font-size: 14px;
    color: #2c3e50;
    font-weight: 500;
    font-family: 'Courier New', monospace;
    text-align: center;
    flex-grow: 1;
}

.container {
    max-width: min(95%, 1400px);
    margin: 0 auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    margin-top: 20px;
}


.subtitle {
    color: #7f8c8d;
    font-size: 1.2em;
    margin: 0;
}

/* Input Section */
.input-section {
    margin-bottom: 30px;
}

.input-section h2 {
    color: #34495e;
    font-size: 1.2em;
    margin-bottom: 20px;
    border-left: 4px solid #3498db;
    padding-left: 15px;
}

.text-input-container {
    margin-bottom: 25px;
}

.transcript-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.transcript-header .glass-button {
    margin-left: 10px;
}

.ai-section-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ai-section-inline label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    white-space: nowrap;
}

/* Custom Dropdown Container */
.custom-dropdown {
    position: relative;
    display: inline-block;
    min-width: 180px;
}

/* Custom Dropdown Button */
.custom-dropdown-button {
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    min-width: 180px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    color: #2c3e50;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    font-family: inherit;
    outline: none;
    border: none;
}

.custom-dropdown-button:hover {
    border-color: rgba(52, 152, 219, 0.3);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.custom-dropdown-button:focus {
    border-color: rgba(52, 152, 219, 0.5);
    box-shadow: 0 8px 32px rgba(52, 152, 219, 0.25);
    transform: translateY(-1px);
}

/* Custom Dropdown Arrow */
.custom-dropdown-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
    color: #007bff;
}

.custom-dropdown.open .custom-dropdown-arrow {
    transform: rotate(180deg);
}

/* Custom Dropdown Menu */
.custom-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 4px;
}

.custom-dropdown.open .custom-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Custom Dropdown Items */
.custom-dropdown-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    color: #2c3e50;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
    margin: 2px;
}

.custom-dropdown-item:hover {
    background: rgba(52, 152, 219, 0.1);
    color: #007bff;
    transform: translateX(2px);
}

.custom-dropdown-item.selected {
    background: rgba(52, 152, 219, 0.15);
    color: #007bff;
    font-weight: 600;
}

.custom-dropdown-item:first-child {
    margin-top: 4px;
}

.custom-dropdown-item:last-child {
    margin-bottom: 4px;
}

/* Hide the original select - use !important to override any inline styles */
.ai-section-inline select {
    display: none !important;
}

/* Ensure custom dropdown is visible */
.custom-dropdown {
    display: inline-block !important;
}

/* Main Actions Section */
.main-actions {
    display: flex;
    gap: var(--space-lg);
    justify-content: center;
    align-items: center;
    margin: var(--space-3xl) 0;
    padding: var(--space-xl);
}

@media (max-width: 768px) {
    .main-actions {
        flex-direction: column;
        gap: var(--space-md);
    }
}

/* Parameters Header */
.parameters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--glass-border);
}

.parameters-header h2 {
    margin: 0;
    color: var(--color-text-primary);
}

/* Configuration Actions */
.config-actions {
    display: flex;
    justify-content: center;
    margin: var(--space-3xl) 0;
    padding: var(--space-xl);
}

/* Glass Button Enhancements */
.glass-button svg {
    flex-shrink: 0;
}

.glass-button--large {
    padding: var(--space-md) var(--space-2xl);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
}

.glass-button--secondary {
    background: var(--glass-bg-light);
    color: var(--color-text-primary);
    border-color: var(--glass-border);
}


/* All buttons now use glass-button system - old styles removed */

/* Ensure all buttons have consistent height */
.glassui-btn {
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    padding: 0 20px !important;
    line-height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
}

/* Dynamic Layout - Override common.css for main page */
body {
    margin: 0 !important;
    padding: 65px 10px 10px 10px !important; /* Top and bottom padding */
    min-height: auto !important; /* Remove viewport height requirement */
    display: block !important; /* Change from flex to block */
}

.glassui-container {
    margin: 0 auto 20px auto !important; /* Center with bottom margin */
    max-width: 95% !important; /* Use most of the screen width */
    width: 95% !important;
}

.container {
    display: flex !important;
    flex-direction: column !important;
    position: relative; /* Enable absolute positioning for config panel */
}

.content {
    flex: 0 1 auto; /* Don't grow, allow shrink, auto size */
    display: flex !important;
    flex-direction: column !important;
    min-height: 0; /* Allow flex child to shrink */
}

.input-section {
    flex: 0 1 auto; /* Don't grow, allow shrink, auto size */
    display: flex !important;
    flex-direction: column !important;
    min-height: 0; /* Allow flex child to shrink */
}

.text-input-container {
    flex: 0 1 auto; /* Don't grow, allow shrink, auto size */
    display: flex !important;
    flex-direction: column !important;
    min-height: 0; /* Allow flex child to shrink */
}

/* Transcript Display - Dynamic height with large max constraint */
.transcript-display {
    width: 100%;
    flex: 0 0 auto; /* Don't grow or shrink */
    height: auto !important; /* Auto height based on content */
    min-height: 300px !important; /* Minimum height to prevent shrinking */
    max-height: none !important; /* No maximum - show all content */
    padding: 15px;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    background-color: #f8f9fa;
    overflow-y: visible !important; /* No scrolling - show all content */
    overflow-x: hidden; /* Prevent horizontal scroll */
    white-space: pre-wrap;
    word-wrap: break-word;
    box-sizing: border-box;
    margin: 0; /* Remove any default pre margin */
}

/* Reduce font size for transcript text in desktop view only */
@media (min-width: 768px) {
    .transcript-display {
        font-size: 12px;
    }
}

.transcript-display code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    color: inherit;
}

/* Transcript Editor - Dynamic height with large max constraint */
.transcript-editor {
    width: 100%;
    flex: 0 0 auto; /* Don't grow or shrink */
    height: auto !important; /* Auto height based on content */
    min-height: 300px !important; /* Reasonable minimum for editing */
    max-height: none !important; /* No maximum - show all content */
    padding: 15px;
    border: 2px solid #3498db;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    background-color: #f8f9fa;
    resize: vertical;
    overflow-y: visible !important; /* No scrolling - show all content */
    transition: border-color 0.3s ease;
    box-sizing: border-box;
    margin: 0; /* Remove any default textarea margin */
}

.transcript-editor:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Transcript Controls */
.transcript-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.transcript-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.character-count {
    color: #7f8c8d;
    font-size: 0.9em;
}

.estimate-info {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
    color: #7f8c8d;
}

.edit-controls {
    display: flex;
    gap: 10px;
}

/* Old save/cancel button styles removed - now using glass-button system */

/* AI Section */
.ai-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.ai-section h3 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 15px;
}

.ai-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.ai-controls label {
    font-weight: 600;
    color: #2c3e50;
}

.ai-controls select {
    padding: 8px 12px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 14px;
    min-width: 180px;
}

.ai-status {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
}

.ai-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ai-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.ai-status.loading {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Parameters Section */
.parameters-section {
    margin-bottom: 30px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
}

.parameters-section h2 {
    color: #34495e;
    font-size: 1.2em;
    margin-bottom: 20px;
    border-left: 4px solid #e67e22;
    padding-left: 15px;
}

.parameters-container {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.parameter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.parameter-group {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.parameter-group h3 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 18px;
    font-size: 1.1em;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 8px;
}

.parameter-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.parameter-item:last-child {
    margin-bottom: 0;
}

.parameter-item label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 14px;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slider-container input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider-container input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider-value {
    min-width: 50px;
    text-align: center;
    font-weight: 600;
    color: #2c3e50;
    background: #ecf0f1;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
}

.parameter-item select {
    padding: 8px 12px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.parameter-item input[type="checkbox"] {
    margin-right: 8px;
}

.parameter-note {
    margin-top: 15px;
    padding: 10px;
    background: rgba(52, 152, 219, 0.1);
    border-left: 3px solid #3498db;
    border-radius: 4px;
}

.parameter-note small {
    color: #555;
    font-style: italic;
}

/* Remove advanced settings styles since we eliminated them */

/* Generation Section */
.generation-section {
    margin-bottom: 30px;
    text-align: center;
}

.generation-info {
    margin-bottom: 20px;
}

.estimate-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #7f8c8d;
}

/* Old generate-button styles removed - now using glass-button system */

.button-icon {
    font-size: 20px;
}
.generation-status {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

.generation-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.generation-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.generation-status.loading {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #ecf0f1;
    border-radius: 3px;
    margin-top: 15px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2980b9);
    width: 0%;
    transition: width 0.3s ease;
    animation: progress-animation 2s infinite;
}

@keyframes progress-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Result Section */
.result-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.result-section h2 {
    color: #34495e;
    margin-top: 0;
    margin-bottom: 20px;
    border-left: 4px solid #007bff;
    padding-left: 15px;
    font-size: 1.1em;
}

.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.file-details {
    flex: 1;
}

.file-name {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
    margin-bottom: 5px;
}

.file-meta {
    display: block;
    color: #7f8c8d;
    font-size: 14px;
}

.file-controls {
    display: flex;
    gap: 10px;
}

/* Old control-button, play-button, download-button styles removed - now using glass-button system */

.audio-player {
    width: 100%;
    margin-top: 15px;
}

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

/* Responsive Design */
@media (max-width: 1200px) {
    .parameter-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .container {
        margin-top: 15px;
        padding: 15px;
    }
    
    .header h1 {
        font-size: 1.3em;
    }
    
    .parameter-grid {
        grid-template-columns: 1fr;
    }
    
    .ai-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ai-controls select {
        min-width: auto;
    }
    
    .estimate-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .file-info {
        flex-direction: column;
        align-items: stretch;
    }
    
    .file-controls {
        justify-content: center;
    }
}

/* Prism.js overrides for transcript display */
.transcript-display {
    margin: 0;
    padding: 15px;
}

.transcript-display code {
    background: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    font-size: inherit !important;
    color: inherit !important;
    font-family: inherit !important;
}

/* Settings Page Styles */
.settings-page {
    max-width: 900px;
    margin: 0 auto;
}

.settings-header {
    text-align: center;
    margin-bottom: 30px;
}

.settings-header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.settings-description {
    color: #7f8c8d;
    font-size: 16px;
}

.settings-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.settings-info {
    margin-top: 30px;
    padding: 15px;
    background: rgba(52, 152, 219, 0.1);
    border-left: 3px solid #3498db;
    border-radius: 4px;
    text-align: center;
}

.settings-info p {
    margin: 0;
    color: #555;
}

/* Desktop layout - Generate Morse button on the right */
@media (min-width: 769px) {
    .transcript-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
    }
    
    .ai-section-inline {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 0 1 auto;
    }
    
    /* Generate Morse button stays on the right */
    #generateMorseBtn {
        flex: 0 0 auto;
    }
}

/* Additional responsive updates for new layout */
@media (max-width: 768px) {
    .transcript-header {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: stretch;
        gap: 12px;
    }
    
    .ai-section-inline {
        display: contents; /* Makes children participate in parent's flex layout */
    }
    
    /* Hide the CW conversation style label on mobile */
    .ai-section-inline label {
        display: none;
    }
    
    /* Make dropdown full width on mobile - first row */
    .ai-section-inline .glassui-dropdown {
        width: 100%;
        order: 1;
        flex: 0 0 100%;
    }
    
    /* Generate AI button (red) - half width, second row left */
    .ai-section-inline #generateAI {
        order: 2;
        width: calc(50% - 6px);
        flex: 0 0 calc(50% - 6px);
    }
    
    /* Generate Morse button (blue) - half width, second row right */
    .transcript-header > #generateMorseBtn {
        order: 3;
        width: calc(50% - 6px);
        flex: 0 0 calc(50% - 6px);
    }
    
    .transcript-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .edit-controls {
        justify-content: center;
    }
    
    .parameter-group {
        margin-bottom: 20px;
    }
    
    /* Improve text wrapping in transcript display on mobile */
    .transcript-display {
        font-size: 13px;
        word-break: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    /* Better wrapping for all token elements on mobile */
    .transcript-display .token {
        word-break: break-word;
        overflow-wrap: break-word;
        white-space: pre-wrap;
    }
    
    .settings-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ===== CodeMirror Synchronized Highlighting ===== */

/* Active word - currently playing (bright yellow highlight) */
.cm-morse-active {
    background-color: #fbbf24 !important; /* Amber/yellow */
    color: #000 !important;
    font-weight: bold !important;
    padding: 2px 4px;
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

/* Current line words - subtle background */
.cm-morse-line {
    background-color: rgba(251, 191, 36, 0.15) !important;
    border-radius: 2px;
}

/* Upcoming words (next 2-3 words) - light preview */
.cm-morse-upcoming {
    background-color: rgba(251, 191, 36, 0.2) !important;
    border-bottom: 2px solid rgba(251, 191, 36, 0.6);
    border-radius: 2px;
}

/* Past words - dimmed/grayed out */
.cm-morse-past {
    opacity: 0.6;
}

/* ===== End Synchronized Highlighting ===== */
