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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    font-weight: 300;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Paste Transcript Section */
.paste-transcript-section {
    margin-top: 30px;
}

.divider {
    text-align: center;
    margin: 30px 0 20px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
}

.divider span {
    background: white;
    padding: 0 20px;
    color: #666;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.paste-transcript-panel {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 25px;
    border: 2px dashed #e2e8f0;
    transition: border-color 0.3s ease;
}

.paste-transcript-panel:hover {
    border-color: #667eea;
}

.paste-transcript-panel h3 {
    margin-bottom: 10px;
    color: #333;
    font-size: 1.2rem;
}

.paste-transcript-panel p {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

#paste-transcript-textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    margin-bottom: 20px;
    transition: border-color 0.3s ease;
}

#paste-transcript-textarea:focus {
    outline: none;
    border-color: #667eea;
}

#paste-transcript-textarea::placeholder {
    color: #999;
}

/* Upload Section - Two Column Layout */
.upload-container {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.upload-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.upload-right {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.upload-area {
    border: 3px dashed #ddd;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 300px;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-2px);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.upload-area h3 {
    margin-bottom: 10px;
    color: #333;
}

.upload-area p {
    color: #666;
    margin-bottom: 20px;
}

.file-info {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.file-details {
    display: flex;
    flex-direction: column;
}

.file-details span:first-child {
    font-weight: 600;
    margin-bottom: 5px;
}

.file-details span:last-child {
    color: #666;
    font-size: 0.9rem;
}

/* Options Panel */
.options-panel {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 25px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.options-panel h3 {
    margin-bottom: 20px;
    color: #333;
}

.option-group {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.option-group label {
    font-weight: 500;
    color: #555;
    min-width: 140px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

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

.option-group select,
.option-group input[type="number"] {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
    min-width: 0;
}

.option-group select:focus,
.option-group input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

/* Special handling for checkbox groups */
.option-group.checkbox-group {
    justify-content: flex-start;
}

.option-group.checkbox-group label {
    min-width: auto;
    flex-shrink: 1;
}

/* Speaker group - single line layout */
.option-group.speaker-group {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.option-group.speaker-group label {
    min-width: auto;
    flex-shrink: 0;
}

.option-group.speaker-group .speakers-label {
    margin-left: auto;
    font-weight: 500;
    color: #555;
}

.option-group.speaker-group .speakers-number {
    width: 50px;
    padding: 6px 8px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 0.95rem;
    text-align: center;
    transition: border-color 0.3s ease;
}

.option-group.speaker-group .speakers-number:focus {
    outline: none;
    border-color: #667eea;
}

/* Tooltips */
.info-tooltip {
    color: #667eea;
    cursor: help;
    margin-left: 5px;
    font-size: 0.9rem;
}

.info-tooltip[title]:hover::after {
    content: attr(title);
    position: absolute;
    z-index: 1000;
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-left: 10px;
    white-space: pre-wrap;
    max-width: 250px;
}

/* Temperature Slider - Special Layout */
.option-group.slider-group {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.option-group.slider-group .slider-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.option-group.slider-group .slider-header label {
    min-width: 140px;
    flex-shrink: 0;
}

.option-group input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e1e5e9;
    outline: none;
    margin: 0;
}

.option-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.option-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
}

#temperature-value {
    font-weight: 600;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    min-width: 35px;
    text-align: center;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-outline {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.2rem;
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Progress Section */
.progress-container {
    text-align: center;
}

.progress-container h3 {
    margin-bottom: 30px;
    color: #333;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

.progress-text {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.loading-animation {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.dot {
    width: 12px;
    height: 12px;
    background: #667eea;
    border-radius: 50%;
    animation: pulse 1.4s ease-in-out infinite both;
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes pulse {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.7;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Results Section */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.results-header h2 {
    color: #333;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.result-card {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
}

.result-card h4 {
    margin-bottom: 10px;
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-card p {
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 5px;
}

.result-card small {
    opacity: 0.8;
    font-size: 0.8rem;
}

/* Transcript Section */
.transcript-section {
    margin-bottom: 40px;
}

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

.transcript-panel {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.transcript-content {
    max-height: 400px;
    overflow-y: auto;
    padding: 25px;
    background: #f8f9fa;
    line-height: 1.8;
    font-size: 1.1rem;
}

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

.transcript-content::-webkit-scrollbar-track {
    background: #e2e8f0;
}

.transcript-content::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.transcript-content::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.transcript-actions {
    padding: 20px;
    background: white;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Speaker Section */
.speaker-section {
    margin-bottom: 40px;
}

.speaker-section h3 {
    margin-bottom: 10px;
    color: #333;
}

.speaker-section p {
    color: #666;
    margin-bottom: 20px;
}

.speaker-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.speaker-control {
    padding: 20px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.speaker-control.single-speaker {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background: rgba(102, 126, 234, 0.1);
}

.speaker-control.multi-speaker {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.speaker-header {
    margin-bottom: 10px;
}

.speaker-label {
    font-weight: 600;
    color: #667eea;
    font-size: 1.1rem;
}

.speaker-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.radio-option:hover {
    background: rgba(102, 126, 234, 0.1);
}

.radio-option input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.radio-option span {
    color: #333;
    font-weight: 500;
}

.custom-name-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.custom-name-input:focus {
    outline: none;
    border-color: #667eea;
}

.custom-name-input:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

/* Legacy styles for compatibility */
.speaker-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 1rem;
}

.speaker-input:focus {
    outline: none;
    border-color: #667eea;
}

.role-buttons {
    display: flex;
    gap: 8px;
}

.role-btn {
    padding: 6px 12px;
    font-size: 0.9rem;
    border: 1px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.role-btn:hover,
.role-btn.active {
    background: #667eea;
    color: white;
}

/* Transcript Formatting */
.transcript-line {
    display: flex;
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 6px;
    background: rgba(102, 126, 234, 0.02);
    border-left: 3px solid #667eea;
}

.transcript-line:nth-child(even) {
    background: rgba(118, 75, 162, 0.02);
    border-left-color: #764ba2;
}

.timecode {
    color: #666;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    min-width: 60px;
    margin-right: 15px;
    flex-shrink: 0;
}

.speaker {
    color: #667eea;
    font-weight: 600;
    min-width: 80px;
    margin-right: 15px;
    flex-shrink: 0;
}

.transcript-line:nth-child(even) .speaker {
    color: #764ba2;
}

.text {
    flex: 1;
    line-height: 1.6;
    color: #333;
}

/* Analysis Section */
.analysis-section h3 {
    margin-bottom: 20px;
    color: #333;
}

.analysis-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.analysis-result {
    background: #f8f9fa;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 25px;
    line-height: 1.8;
}

/* Analysis Loading and Results */
.analysis-loading {
    text-align: center;
    padding: 30px;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #e2e8f0;
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
    margin-top: 15px;
}

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

.analysis-complete h4 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.analysis-content {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.analysis-error {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    padding: 20px;
}

.analysis-error h4 {
    color: #dc2626;
    margin-bottom: 10px;
}

.copy-analysis-btn {
    font-size: 0.9rem;
    padding: 8px 16px;
}

/* New Analysis Output Sections */
.advanced-analysis {
    margin-top: 30px;
    border-top: 2px solid #e2e8f0;
    padding-top: 30px;
}

.advanced-analysis h3 {
    color: #764ba2;
    margin-bottom: 20px;
}

.analysis-output {
    margin-top: 20px;
}

.analysis-content-wrapper {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.analysis-textarea {
    width: 100%;
    min-height: 300px;
    padding: 20px;
    border: none;
    resize: vertical;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    background: #f8f9fa;
    color: #333;
}

.analysis-textarea:focus {
    outline: none;
    background: white;
}

.analysis-actions {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.analysis-actions .btn {
    font-size: 0.9rem;
    padding: 8px 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .section {
        padding: 20px;
    }
    
    /* Stack upload columns on mobile */
    .upload-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .upload-area {
        padding: 40px 15px;
        min-height: 200px;
    }
    
    .results-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .transcript-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .transcript-actions {
        flex-direction: column;
    }
    
    .analysis-buttons {
        flex-direction: column;
    }
}

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

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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