/* AI Speech-to-Text Styles */
:root {
    --bg-gradient-dark: linear-gradient(135deg, #1e1e2f, #2a2a40);
    --bg-gradient-light: linear-gradient(135deg, #f8f9fa, #e9ecef);
    --text-color-dark: #e0e0e0;
    --text-color-light: #2c3e50;
    --container-bg-dark: rgba(40, 40, 60, 0.9);
    --container-bg-light: rgba(255, 255, 255, 0.95);
    --input-bg-dark: rgba(255, 255, 255, 0.1);
    --input-bg-light: rgba(248, 249, 250, 0.8);
    --border-color-dark: rgba(255, 255, 255, 0.2);
    --border-color-light: rgba(108, 117, 125, 0.2);
    --accent-color: #007bff;
    --accent-hover: #0056b3;
    --error-color: #ff4444;
    --warning-color: #ffc107;
    --success-color: #28a745;
    --info-color: #17a2b8;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-gradient-dark);
    color: var(--text-color-dark);
    line-height: 1.6;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

body.light-theme { 
    background: var(--bg-gradient-light); 
    color: var(--text-color-light); 
}

body.rtl { 
    direction: rtl; 
}

body.rtl .container { 
    direction: rtl; 
}

body.rtl label, 
body.rtl p, 
body.rtl h1, 
body.rtl summary, 
body.rtl button:not(.toggle-password):not(.theme-toggle):not(.language-toggle) { 
    text-align: right; 
}

body.rtl .api-key-container .toggle-password { 
    left: 10px; 
    right: auto; 
}

body.rtl .api-key-container input { 
    padding-left: 40px; 
    padding-right: 0.75rem; 
}

body.rtl #transcribed_text { 
    direction: rtl; 
}

body.rtl #submit-button {
    text-align: center;
}

.container {
    background: var(--container-bg-dark); 
    padding: 2rem; 
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); 
    max-width: 800px;
    width: 100%; 
    margin: 20px auto; 
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.light-theme .container { 
    background: var(--container-bg-light); 
    border: 1px solid var(--border-color-light); 
}

.top-bar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 1rem; 
}

.top-bar h1 { 
    margin-bottom: 0; 
    flex-grow: 1; 
    font-size: 2rem; 
    font-weight: 600; 
    text-align: center; 
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.2;
    max-width: 100%;
}

.top-bar button { 
    background: transparent; 
    border: none; 
    font-size: 1.5rem; 
    cursor: pointer; 
    padding: 0.5rem; 
    border-radius: 50%; 
    color: var(--text-color-dark);
    transition: color 0.3s ease;
}

.top-bar button:hover { 
    color: var(--accent-color); 
}

form { 
    display: flex; 
    flex-direction: column; 
    gap: 0.8rem; 
    width: 100%;
}

label { 
    font-weight: bold; 
    margin-bottom: 0.2rem; 
    display: block; 
}

textarea, 
input[type="text"], 
input[type="password"], 
input[type="number"], 
input[type="file"], 
select {
    padding: 0.75rem; 
    border: 1px solid var(--border-color-dark); 
    border-radius: 8px; 
    font-size: 1rem;
    width: 100%; 
    background: var(--input-bg-dark); 
    color: var(--text-color-dark);
    transition: border-color 0.3s ease, background 0.3s ease; 
    direction: ltr;
}

.light-theme textarea, 
.light-theme input[type="text"], 
.light-theme input[type="password"], 
.light-theme input[type="number"], 
.light-theme input[type="file"], 
.light-theme select {
    background: var(--input-bg-light); 
    color: var(--text-color-light); 
    border-color: var(--border-color-light);
}

input:focus, 
select:focus, 
textarea:focus { 
    border-color: var(--accent-color); 
    outline: none; 
}

.api-key-container { 
    position: relative; 
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.api-key-container input { 
    padding-right: 40px; 
}

.toggle-password { 
    position: absolute; 
    right: 10px; 
    top: 50%; 
    transform: translateY(-50%); 
    background: none; 
    border: none; 
    cursor: pointer; 
    font-size: 1.2rem; 
    color: var(--text-color-dark);
}

.remember-me { 
    display: flex; 
    align-items: center; 
    gap: 0.5rem; 
}

.remember-me input[type="checkbox"] { 
    width: auto; 
    margin: 0; 
}

.remember-me label { 
    font-weight: normal; 
    margin-bottom: 0; 
}

button#submit-button {
    padding: 1rem 2rem; 
    background: linear-gradient(135deg, var(--accent-color), #00d4ff);
    color: white; 
    border: none; 
    border-radius: 12px; 
    font-size: 1.2rem; 
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    margin-top: 1.5rem;
}

button#submit-button:hover:not(:disabled) { 
    transform: translateY(-3px); 
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    background: linear-gradient(135deg, var(--accent-hover), #00b8e6);
}

button#submit-button:disabled { 
    background: linear-gradient(135deg, #6c757d, #5a6268);
    cursor: not-allowed; 
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.output-container { 
    margin-top: 1.5rem; 
}

#transcribed_text { 
    min-height: 200px; 
    resize: vertical;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.2rem;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-color-dark);
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

#transcribed_text:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 0 0 3px rgba(0, 123, 255, 0.1);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
}

body.light-theme #transcribed_text {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.03) 0%, rgba(0, 0, 0, 0.01) 100%);
    border: 2px solid rgba(0, 0, 0, 0.1);
    color: var(--text-color-light);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

body.light-theme #transcribed_text:focus {
    border-color: var(--accent-color);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.05),
        0 0 0 3px rgba(0, 123, 255, 0.1);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.02) 100%);
}

/* Transcribed Text Label */
#transcribed-text-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#transcribed-text-label::before {
    content: '📝';
    font-size: 1.2rem;
}

body.light-theme #transcribed-text-label {
    color: var(--accent-color);
}

.error-message { 
    text-align: center; 
    margin-top: 1rem; 
    font-weight: bold; 
    color: var(--error-color); 
    background-color: rgba(255, 68, 68, 0.1); 
    border: 1px solid rgba(255, 68, 68, 0.3); 
    padding: 0.75rem; 
    border-radius: 8px; 
    display: none; 
}

.progress-container { 
    text-align: center; 
    margin-top: 1rem; 
    font-weight: bold; 
    display: none; 
}

.advanced-settings { 
    margin-top: 1rem; 
    border: 1px solid var(--border-color-dark); 
    border-radius: 8px; 
    padding: 1rem; 
}

.light-theme .advanced-settings { 
    border-color: var(--border-color-light); 
}

.advanced-settings summary { 
    cursor: pointer; 
    font-weight: bold; 
    user-select: none; 
}

.unlock-section {
    border-top: 1px solid var(--border-color-dark);
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.light-theme .unlock-section { 
    border-top-color: var(--border-color-light); 
}

.unlock-warning {
    font-size: 0.85rem;
    color: var(--warning-color);
    background-color: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.2);
    padding: 0.75rem;
    border-radius: 8px;
    margin-top: 0.75rem;
}

/* Audio Splitting Styles */
.split-section {
    border: 1px solid var(--border-color-dark);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    background: rgba(0, 123, 255, 0.05);
}

.light-theme .split-section { 
    border-color: var(--border-color-light); 
    background: rgba(0, 123, 255, 0.02);
}

.split-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
}

.split-controls label {
    margin-bottom: 0;
    white-space: nowrap;
}

.split-controls input[type="number"] {
    width: 100px;
    min-width: 80px;
}

.split-results {
    margin-top: 1rem;
    display: none;
}

.split-result-item {
    background: var(--input-bg-dark);
    border: 1px solid var(--border-color-dark);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.light-theme .split-result-item {
    background: var(--input-bg-light);
    border-color: var(--border-color-light);
}

.split-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.split-result-title {
    font-weight: bold;
    color: var(--accent-color);
}

.split-result-text {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

.copy-btn {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

/* Export buttons */
#download_combined_btn,
#download_all_parts_btn {
    background: var(--info-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Recording UI */
#record_start_btn, #record_stop_btn, #send_recording_btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
}
#record_stop_btn { background: #dc3545; }
#send_recording_btn { background: #28a745; }
#record_start_btn:disabled,
#record_stop_btn:disabled,
#send_recording_btn:disabled { opacity: .6; cursor: not-allowed; }

#download_combined_btn:hover,
#download_all_parts_btn:hover {
    background: #138496;
}

.copy-btn:hover {
    background: #218838;
}

.file-info {
    background: var(--input-bg-dark);
    border: 1px solid var(--border-color-dark);
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    display: none;
}

.light-theme .file-info {
    background: var(--input-bg-light);
    border-color: var(--border-color-light);
}

.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-processing { 
    background: var(--warning-color); 
    animation: pulse 1.5s infinite; 
}

.status-success { 
    background: var(--success-color); 
}

.status-error { 
    background: var(--error-color); 
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 8px;
    }
    
    .container {
        padding: 1.2rem;
        margin: 8px;
        max-width: none;
        width: calc(100% - 16px);
    }
    
    .top-bar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .top-bar h1 {
        font-size: 1.5rem;
        white-space: normal;
        word-wrap: break-word;
        line-height: 1.2;
        max-width: 100%;
    }
    
    .split-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .split-result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    /* Make form elements wider on mobile */
    form {
        gap: 1rem;
    }
    
    input[type="text"], 
    input[type="password"], 
    input[type="number"], 
    input[type="file"],
    select,
    textarea {
        min-width: auto;
        width: 100%;
    }
    
    /* File input container */
    .file-input-container {
        min-height: 100px;
    }
    
    /* Output container */
    .output-container {
        padding: 1rem;
        margin: 0.8rem 0;
    }
    
    /* Split sections */
    .split-section {
        padding: 1rem;
        margin: 0.8rem 0;
    }
    
    /* Advanced settings */
    .advanced-settings {
        padding: 1rem;
        margin: 0.8rem 0;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    .container {
        padding: 1rem;
        margin: 5px;
        width: calc(100% - 10px);
        border-radius: 12px;
    }
    
    .top-bar h1 {
        font-size: 1.3rem;
        white-space: normal;
        word-wrap: break-word;
        line-height: 1.2;
        max-width: 100%;
    }
    
    /* Even more compact on small screens */
    form {
        gap: 0.8rem;
    }
    
    .file-input-container {
        min-height: 90px;
    }
    
    .file-upload-icon {
        font-size: 2rem;
    }
    
    .file-input-text {
        font-size: 1rem;
    }
    
    .file-input-subtext {
        font-size: 0.8rem;
    }
    
    /* Button adjustments */
    button#submit-button {
        padding: 0.8rem 1.5rem;
        font-size: 1.1rem;
    }
    
    /* Recording buttons */
    #record_start_btn,
    #record_stop_btn,
    #transcribe_recording_btn,
    #record_again_btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
        margin: 0.2rem;
    }
    
    /* Output textarea */
    #transcribed_text {
        min-height: 150px;
        padding: 1rem;
    }
    
    /* Tutorial section */
    .tutorial-section {
        margin: 1.5rem 0;
    }
    
    .tutorial-header {
        padding: 0.8rem 1rem;
    }
    
    .tutorial-content {
        padding: 1rem;
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    .container {
        padding: 0.8rem;
        margin: 3px;
        width: calc(100% - 6px);
    }
    
    .top-bar h1 {
        font-size: 1.2rem;
        white-space: normal;
        word-wrap: break-word;
        line-height: 1.2;
        max-width: 100%;
    }
    
    form {
        gap: 0.6rem;
    }
    
    .file-input-container {
        min-height: 80px;
    }
    
    .file-upload-icon {
        font-size: 1.8rem;
    }
    
    button#submit-button {
        padding: 0.7rem 1.2rem;
        font-size: 1rem;
    }
}

/* Recording buttons */
#record_start_btn,
#record_stop_btn,
#transcribe_recording_btn,
#record_again_btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    margin: 0.25rem;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

#record_start_btn:hover:not(:disabled),
#record_stop_btn:hover:not(:disabled),
#transcribe_recording_btn:hover:not(:disabled),
#record_again_btn:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

#record_start_btn:disabled,
#record_stop_btn:disabled,
#transcribe_recording_btn:disabled,
#record_again_btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

#record_stop_btn {
    background: var(--error-color);
}

#record_stop_btn:hover:not(:disabled) {
    background: #c82333;
}

#transcribe_recording_btn {
    background: var(--success-color);
}

#transcribe_recording_btn:hover:not(:disabled) {
    background: #1e7e34;
}

#record_again_btn {
    background: var(--warning-color);
    color: #212529;
}

#record_again_btn:hover:not(:disabled) {
    background: #e0a800;
}

/* Main copy button */
#copy_main_text_btn {
    background: var(--info-color);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

#copy_main_text_btn:hover {
    background: #138496;
    transform: translateY(-1px);
}

/* PDF Download Button */
#download_pdf_btn {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

#download_pdf_btn:hover {
    background: linear-gradient(135deg, #c82333, #d63031);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* Modern Checkboxes */
input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    border: 2px solid var(--border-color-dark) !important;
    border-radius: 4px !important;
    background: var(--input-bg-dark) !important;
    cursor: pointer !important;
    position: relative !important;
    transition: all 0.3s ease !important;
    margin-right: 0.5rem !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
    box-sizing: border-box !important;
}

input[type="checkbox"]:checked {
    background: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
}

input[type="checkbox"]:checked::after {
    content: '✓' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    color: white !important;
    font-size: 12px !important;
    font-weight: bold !important;
}

input[type="checkbox"]:hover {
    border-color: var(--accent-color) !important;
    transform: scale(1.05) !important;
}

input[type="checkbox"]:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25) !important;
}

body.light-theme input[type="checkbox"] {
    border-color: var(--border-color-light) !important;
    background: var(--input-bg-light) !important;
}

body.light-theme input[type="checkbox"]:checked {
    background: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
}

/* Checkbox Labels */
.remember-me {
    display: flex;
    align-items: center;
    margin: 0.2rem 0;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 0.5rem;
}

.remember-me:hover {
    transform: translateX(2px);
}

.remember-me label {
    cursor: pointer;
    user-select: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.remember-me:hover label {
    color: var(--accent-color);
}

/* Modern Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s ease-in-out infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Progress Container with Spinner */
.progress-container {
    background: var(--container-bg-dark);
    border: 1px solid var(--border-color-dark);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

/* Success State */
.progress-container.success {
    background: rgba(40, 167, 69, 0.1);
    border-color: rgba(40, 167, 69, 0.3);
    color: var(--success-color);
}

.progress-container.success::before {
    content: '✅';
    font-size: 1.2rem;
    animation: none;
    border: none;
    width: auto;
    height: auto;
    margin-right: 0.5rem;
}

body.light-theme .progress-container {
    background: var(--container-bg-light);
    border-color: var(--border-color-light);
}

body.light-theme .progress-container.success {
    background: rgba(40, 167, 69, 0.1);
    border-color: rgba(40, 167, 69, 0.3);
    color: var(--success-color);
}

/* Enhanced Progress Messages - Removed duplicate spinner */

/* Modern Input Fields */
input[type="text"], 
input[type="password"], 
input[type="number"], 
input[type="file"],
select,
textarea {
    background: var(--input-bg-dark);
    border: 2px solid var(--border-color-dark);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-color-dark);
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
    min-width: 200px;
    box-sizing: border-box;
}

input[type="text"]:focus, 
input[type="password"]:focus, 
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    transform: translateY(-1px);
}

input[type="text"]:hover, 
input[type="password"]:hover, 
input[type="number"]:hover,
select:hover,
textarea:hover {
    border-color: var(--accent-color);
}

body.light-theme input[type="text"], 
body.light-theme input[type="password"], 
body.light-theme input[type="number"],
body.light-theme select,
body.light-theme textarea {
    background: var(--input-bg-light);
    border-color: var(--border-color-light);
    color: var(--text-color-light);
}

/* File Input Container */
.file-input-container {
    position: relative;
    width: 100%;
    min-height: 120px;
    border: 2px dashed var(--border-color-dark);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.3s ease;
    overflow: hidden;
}

.file-input-container:hover {
    border-color: var(--accent-color);
    background: rgba(0, 123, 255, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.1);
}

.file-input-container.dragover {
    border-color: var(--accent-color);
    background: rgba(0, 123, 255, 0.1);
    border-style: solid;
}

/* File Input */
input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

/* File Input Overlay */
.file-input-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1;
}

.file-input-content {
    text-align: center;
    padding: 1rem;
}

.file-upload-icon {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.file-input-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color-dark);
    margin: 0 0 0.3rem 0;
}

.file-input-subtext {
    font-size: 0.85rem;
    color: var(--text-color-dark);
    opacity: 0.7;
    margin: 0;
}

/* Light Theme */
body.light-theme .file-input-container {
    background: rgba(0, 0, 0, 0.02);
    border-color: var(--border-color-light);
}

body.light-theme .file-input-container:hover {
    background: rgba(0, 123, 255, 0.05);
}

body.light-theme .file-input-container.dragover {
    background: rgba(0, 123, 255, 0.1);
}

body.light-theme .file-input-text {
    color: var(--text-color-light);
}

body.light-theme .file-input-subtext {
    color: var(--text-color-light);
}

/* Select Dropdown Styling */
select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.2em 1.2em;
    padding-right: 2.5rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Textarea Styling */
textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    line-height: 1.5;
}

/* Labels */
label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color-dark);
    transition: color 0.3s ease;
}

body.light-theme label {
    color: var(--text-color-light);
}

label:hover {
    color: var(--accent-color);
}

/* Enhanced Container */
.container {
    background: var(--container-bg-dark);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    max-width: 800px;
    width: 100%;
}

body.light-theme .container {
    background: var(--container-bg-light);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(108, 117, 125, 0.15);
}

/* Enhanced Sections */
.split-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.8rem;
    margin: 0.6rem 0;
    transition: all 0.3s ease;
}

.split-section:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(0, 123, 255, 0.3);
    transform: translateY(-2px);
}

body.light-theme .split-section {
    background: rgba(248, 249, 250, 0.6);
    border: 1px solid rgba(108, 117, 125, 0.15);
}

body.light-theme .split-section:hover {
    background: rgba(248, 249, 250, 0.8);
    border-color: rgba(0, 123, 255, 0.3);
}

/* Enhanced Advanced Settings */
.advanced-settings {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.6rem;
    margin: 0.6rem 0;
}

.advanced-settings summary {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.advanced-settings summary:hover {
    background: rgba(0, 123, 255, 0.1);
    color: var(--accent-color);
}

body.light-theme .advanced-settings {
    background: rgba(248, 249, 250, 0.6);
    border: 1px solid rgba(108, 117, 125, 0.15);
}

/* Enhanced Output Container */
.output-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 2px solid var(--accent-color);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.output-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), #00d4ff, var(--accent-color));
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 200% 0; }
    50% { background-position: -200% 0; }
}

.output-container:hover {
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
    border-color: #00d4ff;
}

body.light-theme .output-container {
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.8) 0%, rgba(248, 249, 250, 0.6) 100%);
    border: 2px solid var(--accent-color);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(108, 117, 125, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

body.light-theme .output-container:hover {
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(108, 117, 125, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-color: #00d4ff;
}

/* Enhanced Split Results */
.split-results {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    transition: all 0.3s ease;
}

.split-results:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(0, 123, 255, 0.3);
}

body.light-theme .split-results {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-theme .split-results:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 123, 255, 0.3);
}

/* Enhanced Error Messages */
.error-message {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    color: var(--error-color);
    font-weight: 500;
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.error-message::before {
    content: '⚠️';
    font-size: 1.2rem;
}

/* Enhanced File Info */
.file-info {
    background: rgba(0, 123, 255, 0.1);
    border: 1px solid rgba(0, 123, 255, 0.3);
    border-radius: 8px;
    padding: 0.75rem;
    margin: 0.5rem 0;
    color: var(--accent-color);
    font-size: 0.9rem;
    display: none;
}

.file-info::before {
    content: '📁';
    margin-right: 0.5rem;
}

/* Tutorial Section */
.tutorial-section {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 12px;
    margin: 2rem 0;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.2);
}

.tutorial-header {
    background: rgba(255, 193, 7, 0.15);
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 193, 7, 0.3);
}

.tutorial-header:hover {
    background: rgba(255, 193, 7, 0.25);
}

.tutorial-header.active {
    background: rgba(255, 193, 7, 0.2);
    border-bottom-color: rgba(255, 193, 7, 0.4);
}

.tutorial-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tutorial-icon {
    font-size: 1.2rem;
}

.tutorial-text {
    color: #856404;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tutorial-arrow {
    color: #856404;
    font-size: 0.9rem;
    transition: transform 0.3s ease;
    font-weight: bold;
}

.tutorial-content {
    display: none;
    padding: 1.5rem;
    background: rgba(255, 193, 7, 0.05);
}

.tutorial-steps h3 {
    margin: 0 0 1rem 0;
    color: #856404;
    font-size: 1.1rem;
    font-weight: 600;
}

.tutorial-steps ol {
    margin: 0 0 1rem 0;
    padding-left: 1.5rem;
    color: var(--text-color-dark);
}

.tutorial-steps li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.tutorial-steps a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

.tutorial-steps a:hover {
    text-decoration: underline;
}

.tutorial-note {
    margin: 1rem 0;
    padding: 0.8rem;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 6px;
    font-style: italic;
    color: #856404;
    font-size: 0.9rem;
}

.tutorial-link {
    background: rgba(0, 123, 255, 0.1);
    border: 1px solid rgba(0, 123, 255, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.tutorial-link p {
    margin: 0;
    color: var(--accent-color);
    font-weight: 500;
}

.tutorial-link a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 700;
    border-bottom: 1px dotted var(--accent-color);
}

.tutorial-link a:hover {
    text-decoration: none;
    border-bottom: 1px solid var(--accent-color);
}

/* Light Theme */
body.light-theme .tutorial-section {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
}

body.light-theme .tutorial-header {
    background: rgba(255, 193, 7, 0.15);
    border-bottom-color: rgba(255, 193, 7, 0.3);
}

body.light-theme .tutorial-header:hover {
    background: rgba(255, 193, 7, 0.25);
}

body.light-theme .tutorial-header.active {
    background: rgba(255, 193, 7, 0.2);
    border-bottom-color: rgba(255, 193, 7, 0.4);
}

body.light-theme .tutorial-content {
    background: rgba(255, 193, 7, 0.05);
}

body.light-theme .tutorial-steps ol {
    color: var(--text-color-light);
}

body.light-theme .tutorial-note {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
    color: #856404;
}


/* Enhanced Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.top-bar h1 {
    background: linear-gradient(135deg, var(--accent-color), #00d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.top-bar > div {
    display: flex;
    gap: 0.5rem;
}

.top-bar button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 0.75rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.top-bar button:hover {
    background: rgba(0, 123, 255, 0.2);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

body.light-theme .top-bar {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .top-bar button {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .top-bar button:hover {
    background: rgba(0, 123, 255, 0.1);
    border-color: var(--accent-color);
}

/* Force checkbox dimensions - Override any conflicting styles */
input[type="checkbox"] {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    flex: 0 0 20px !important;
}

/* API Key Help Text */
.api-key-help {
    margin: 0.2rem 0;
    padding: 0;
    background: none;
    border: none;
    font-size: 0.8rem;
}

.api-key-help small {
    color: var(--warning-color);
    font-weight: 500;
}

.help-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border-bottom: 1px dotted var(--accent-color);
}

.help-link:hover {
    color: var(--accent-hover);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-hover);
}

body.light-theme .api-key-help {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
}

body.light-theme .api-key-help small {
    color: #856404;
}

/* Smooth scroll for help links */
html {
    scroll-behavior: smooth;
}

/* Proxy Warning - Only the warning text is red */
#use-proxy-label {
    color: var(--text-color-dark);
}

#use-proxy-label .proxy-warning {
    color: #ff4444;
    font-weight: 600;
}

body.light-theme #use-proxy-label {
    color: var(--text-color-light);
}

body.light-theme #use-proxy-label .proxy-warning {
    color: #ff4444;
}

