/* CSS Variables */
:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --success: #48bb78;
    --error: #f56565;
    --warning: #ed8936;
    --background: #ffffff;
    --surface: #f7fafc;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --border: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.1);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #1a202c;
        --surface: #2d3748;
        --text-primary: #f7fafc;
        --text-secondary: #cbd5e0;
        --border: #4a5568;
        --shadow: rgba(0, 0, 0, 0.3);
    }
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 
                 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--background);
    border-radius: 16px;
    box-shadow: 0 20px 60px var(--shadow);
    overflow: hidden;
}

/* No header styles needed */

/* Main Content */
.main-content {
    padding: 16px;
}

/* Settings Panel */
.settings-panel {
    background: var(--surface);
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

.settings-header {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.settings-header h2 {
    font-size: 1rem;
    color: var(--text-primary);
}

.toggle-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.toggle-icon.rotated {
    transform: rotate(-180deg);
}

.settings-content {
    padding: 0 12px 8px;
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.settings-content.collapsed {
    max-height: 0;
    padding: 0 12px;
}

/* Control Group */
.control-group {
    margin-bottom: 0;
    min-height: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 1024px) {
    .settings-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .settings-content {
        grid-template-columns: 1fr;
    }
}

.control-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.value-display {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.8rem;
    font-family: 'Courier New', monospace;
}

/* Slider with labels (for speed control) */
.slider-with-labels {
    display: flex;
    align-items: center;
    gap: 8px;
}

.range-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 45px;
    text-align: center;
}

/* Help Icon Tooltip */
.help-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    line-height: 14px;
    text-align: center;
    background: var(--text-secondary);
    color: var(--background);
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    cursor: help;
    margin: 0 4px;
    position: relative;
    transition: all 0.2s ease;
}

.help-icon:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.help-icon::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: var(--text-primary);
    color: var(--background);
    border-radius: 6px;
    font-size: 12px;
    font-weight: normal;
    white-space: normal;
    width: 220px;
    text-align: left;
    line-height: 1.4;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.help-icon:hover::after {
    opacity: 1;
}

/* Slider */
.slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: var(--border);
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px var(--primary);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px var(--primary);
}

/* Input Controls */
.control-input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--background);
    color: var(--text-primary);
    transition: border-color 0.3s ease;
}

.control-input:focus {
    outline: none;
    border-color: var(--primary);
}

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

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.input-header label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.char-counter {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

.text-input {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    background: var(--background);
    color: var(--text-primary);
    transition: border-color 0.3s ease;
}

.text-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    width: 100%;
    font-size: 1rem;
    padding: 12px;
    margin: 8px 0;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--shadow);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

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

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-clear {
    margin-top: 12px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-clear:hover {
    background: var(--surface);
    color: var(--text-primary);
}

/* Loader removed */

/* Status Message */
.status-message {
    padding: 8px 10px;
    border-radius: 6px;
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    animation: slideIn 0.3s ease;
}

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

.status-message.success {
    background: #c6f6d5;
    color: #22543d;
    border: 2px solid var(--success);
}

.status-message.error {
    background: #fed7d7;
    color: #742a2a;
    border: 2px solid var(--error);
}

.status-message.loading {
    background: #bee3f8;
    color: #2c5282;
    border: 2px solid var(--primary);
}

.status-message.hidden {
    display: none;
}

/* Audio Player */
.audio-player {
    background: var(--surface);
    padding: 12px;
    border-radius: 8px;
    margin-top: 10px;
    border: 2px solid var(--border);
    animation: fadeIn 0.5s ease;
}

.audio-player h3 {
    font-size: 0.95rem;
    margin-bottom: 10px;
}

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

.audio-player.hidden {
    display: none;
}

.audio-player h3 {
    margin-bottom: 16px;
    color: var(--text-primary);
}

.audio-player audio {
    width: 100%;
    margin-bottom: 16px;
}

.audio-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

/* No footer styles needed */

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 12px;
    }

    .header {
        padding: 30px 20px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .main-content {
        padding: 20px;
    }

    .btn-primary {
        font-size: 1rem;
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .settings-header h2 {
        font-size: 1.1rem;
    }
}

