/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #1d1d1f;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 50px;
    padding: 40px 0;
}

.title {
    font-size: 3.2rem;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #1d1d1f 0%, #434344 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title .icon {
    margin-right: 20px;
    font-size: 3.5rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.subtitle {
    font-size: 1.3rem;
    color: #86868b;
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* Main Content */
.main-content {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    padding: 48px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.08),
        0 8px 16px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Input Section */
.input-section {
    margin-bottom: 48px;
}

.selectors-row {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
}

.selectors-row-2 {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
}

.language-selector {
    flex: 1;
}

.voice-tone-selector {
    flex: 1;
}

.device-profile-selector {
    flex: 1;
}

.language-select, .voice-tone-select, .device-profile-select {
    width: 100%;
    padding: 18px 24px;
    border: 1px solid #d2d2d7;
    border-radius: 16px;
    font-size: 1rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.8);
    color: #1d1d1f;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 20px center;
    background-size: 18px;
    padding-right: 50px;
    font-weight: 500;
}

.language-select:focus, .voice-tone-select:focus, .device-profile-select:focus {
    outline: none;
    border-color: #007aff;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
    background: white;
}

.language-select:hover, .voice-tone-select:hover, .device-profile-select:hover {
    border-color: #007aff;
    background: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.15);
}

.textarea-container {
    margin-bottom: 32px;
}

.audio-settings {
    display: flex;
    gap: 48px;
    margin-bottom: 32px;
    padding: 24px;
    background: rgba(248, 248, 250, 0.6);
    border-radius: 16px;
    border: 1px solid #e5e5e7;
}

.setting-group {
    flex: 1;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #d2d2d7;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007aff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
    transition: all 0.3s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007aff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.slider-value {
    min-width: 50px;
    text-align: center;
    font-weight: 600;
    color: #007aff;
    font-size: 0.9rem;
}

.label {
    display: block;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 12px;
    font-size: 1.1rem;
    letter-spacing: 0.01em;
}

.text-input {
    width: 100%;
    padding: 24px;
    border: 1px solid #d2d2d7;
    border-radius: 16px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 140px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: rgba(255, 255, 255, 0.8);
    color: #1d1d1f;
    line-height: 1.6;
}

.text-input:focus {
    outline: none;
    border-color: #007aff;
    background: white;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
    transform: translateY(-1px);
}

.text-input:hover {
    border-color: #007aff;
    background: white;
}

.char-counter {
    text-align: right;
    margin-top: 12px;
    font-size: 0.9rem;
    color: #86868b;
    font-weight: 500;
}

/* Convert Button */
.convert-btn {
    width: 100%;
    padding: 20px 32px;
    background: linear-gradient(135deg, #007aff 0%, #0056cc 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 
        0 8px 24px rgba(0, 122, 255, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.01em;
}

.convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 32px rgba(0, 122, 255, 0.4),
        0 8px 16px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #0056cc 0%, #004499 100%);
}

.convert-btn:active {
    transform: translateY(0);
}

.convert-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Audio Section */
.audio-section {
    background: rgba(248, 248, 250, 0.8);
    border-radius: 20px;
    padding: 36px;
    border: 1px solid #e5e5e7;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.audio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.audio-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #1d1d1f;
    letter-spacing: 0.01em;
}

.file-info {
    display: flex;
    gap: 16px;
    font-size: 0.9rem;
    color: #86868b;
}

.file-size, .file-duration, .file-language, .file-gender {
    background: rgba(255, 255, 255, 0.8);
    padding: 10px 16px;
    border-radius: 20px;
    border: 1px solid #e5e5e7;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

/* Audio Player */
.audio-player-container {
    margin-bottom: 28px;
}

audio {
    width: 100%;
    border-radius: 12px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

/* Audio Controls */
.audio-controls {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.control-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 130px;
    justify-content: center;
    letter-spacing: 0.01em;
}

.play-btn {
    background: linear-gradient(135deg, #34c759 0%, #28a745 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(52, 199, 89, 0.3);
}

.play-btn:hover {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(52, 199, 89, 0.4);
}

.pause-btn {
    background: linear-gradient(135deg, #ff9500 0%, #e67e00 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(255, 149, 0, 0.3);
}

.pause-btn:hover {
    background: linear-gradient(135deg, #e67e00 0%, #cc6f00 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 149, 0, 0.4);
}

.download-btn {
    background: linear-gradient(135deg, #007aff 0%, #0056cc 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
}

.download-btn:hover {
    background: linear-gradient(135deg, #0056cc 0%, #004499 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
}

.btn-icon {
    font-size: 1.2rem;
}

/* Error Section */
.error-section {
    background: rgba(255, 235, 235, 0.8);
    border: 1px solid #ff6b6b;
    border-radius: 16px;
    padding: 24px;
    margin-top: 24px;
    backdrop-filter: blur(10px);
}

.error-message {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #d63031;
    font-weight: 500;
}

.error-icon {
    font-size: 1.3rem;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 50px;
    padding: 24px 0;
    color: #86868b;
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }
    
    .main-content {
        padding: 32px 24px;
    }
    
    .title {
        font-size: 2.5rem;
    }
    
    .title .icon {
        font-size: 2.8rem;
    }
    
    .selectors-row, .selectors-row-2 {
        flex-direction: column;
        gap: 24px;
    }
    
    .audio-settings {
        flex-direction: column;
        gap: 24px;
    }
    
    .audio-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .file-info {
        width: 100%;
        justify-content: space-between;
    }
    
    .audio-controls {
        flex-direction: column;
    }
    
    .control-btn {
        width: 100%;
    }
    
    .language-select, .device-profile-select, .text-input {
        padding: 16px 20px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 30px 0;
        margin-bottom: 40px;
    }
    
    .title {
        font-size: 2.2rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .main-content {
        padding: 24px 20px;
    }
    
    .text-input {
        padding: 20px;
        font-size: 0.95rem;
    }
    
    .convert-btn {
        padding: 18px 24px;
        font-size: 1.1rem;
    }
    
    .audio-section {
        padding: 24px 20px;
    }
}
