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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

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

header h1 {
    color: white;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 10px;
}

main {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.input-section {
    margin-bottom: 30px;
}

.input-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #555;
    font-size: 1.1rem;
}

#textInput {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
    background: #f8f9fa;
}

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

.controls-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
}

.voice-selection, .speed-control {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.voice-selection label, .speed-control label {
    font-weight: 600;
    color: #555;
    font-size: 1rem;
}

#voiceSelect {
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

#voiceSelect:focus {
    outline: none;
    border-color: #667eea;
}

.warning {
    background: #fff3cd;
    color: #856404;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ffeaa7;
    font-size: 14px;
    margin-top: 10px;
}

.warning.hidden {
    display: none;
}

#speedRange {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #e1e5e9;
    outline: none;
    -webkit-appearance: none;
}

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

#speedRange::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.playback-controls {
    grid-column: 1 / -1;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}

.btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    justify-content: center;
}

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

.btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

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

.btn-icon {
    font-size: 18px;
}

.status-section {
    margin-bottom: 30px;
    text-align: center;
}

.status {
    font-size: 1.1rem;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 15px;
}

.progress {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
}

.progress.hidden {
    display: none;
}

.progress-bar {
    width: 200px;
    height: 8px;
    background: #e1e5e9;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
}

#progressText {
    font-weight: 600;
    color: #667eea;
    min-width: 40px;
}

.text-display {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    border: 2px solid #e1e5e9;
}

.text-display h3 {
    margin-bottom: 15px;
    color: #555;
    font-size: 1.2rem;
}

.text-content {
    line-height: 1.8;
    font-size: 16px;
    color: #333;
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
    background: white;
    border-radius: 10px;
    border: 1px solid #e1e5e9;
}

.text-content::-webkit-scrollbar {
    width: 8px;
}

.text-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.text-content::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 5px;
}

.text-content::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}

.highlight {
    background: linear-gradient(120deg, #a8edea 0%, #fed6e3 100%);
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.clickable {
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
}

.clickable:hover {
    background: linear-gradient(120deg, #e3f2fd 0%, #f3e5f5 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.clickable:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(102, 126, 234, 0.3);
}

.clickable::after {
    content: '🔊';
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.clickable:hover::after {
    opacity: 1;
}

.tooltip {
    font-size: 0.9rem;
    color: #667eea;
    font-weight: normal;
    opacity: 0.8;
    margin-left: 10px;
}

@media (max-width: 768px) {
    .tooltip {
        display: block;
        margin-left: 0;
        margin-top: 5px;
        font-size: 0.8rem;
    }
}

.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    main {
        padding: 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .controls-section {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .playback-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    main {
        padding: 15px;
    }
    
    .controls-section {
        padding: 15px;
    }
} 