/* Reset and base styles */
* {
    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: #333333;
    background: linear-gradient(to bottom, #ffffff 0%, #f8f6ff 25%, #e8e3f5 50%, #d4c9e8 75%, #633369 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* Header */
header {
    background: white;
    color: #333333;
    padding: 20px 40px 30px;
    position: relative;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0px;
}

.logo-container {
    display: flex;
    align-items: center;
    background-color: white;
    padding: 8px 12px;
    border-radius: 8px;
}

.logo {
    height: 255px;
    width: auto;
}

.header-text {
    flex: 1;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

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

.header-tagline {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: #633369;
    margin-top: 15px;
    margin-bottom: 0;
}

/* Main content */
main {
    padding: 40px;
    color: #333333;
}

/* Form sections */
section {
    margin-bottom: 40px;
}

section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333333;
    border-bottom: 2px solid rgba(99, 51, 105, 0.2);
    padding-bottom: 10px;
}

/* Upload section */
.upload-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.upload-type {
    border: 2px solid rgba(99, 51, 105, 0.2);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.5);
}

.upload-type:has(input:checked) {
    border-color: #633369;
    background: rgba(99, 51, 105, 0.2);
}

.upload-type-disabled {
    opacity: 0.6;
    pointer-events: none;
    background: rgba(200, 200, 200, 0.2);
    border-color: rgba(150, 150, 150, 0.3);
}

.upload-type-disabled label {
    cursor: not-allowed;
    color: #888;
}

.coming-soon {
    font-size: 0.8rem;
    font-weight: 400;
    color: #999;
    font-style: italic;
}

.upload-type label {
    display: block;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333333;
    cursor: pointer;
}

.upload-area {
    border: 2px dashed rgba(99, 51, 105, 0.3);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.3);
}

.upload-area:hover:not(.disabled) {
    border-color: #633369;
    background: rgba(99, 51, 105, 0.2);
}

.upload-area.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.1);
}

.upload-area.active {
    border-color: #633369;
    background: rgba(99, 51, 105, 0.2);
}

.upload-content svg {
    margin-bottom: 15px;
    color: rgba(99, 51, 105, 0.7);
}

.upload-content p {
    font-size: 1.1rem;
    font-weight: 500;
    color: #333333;
    margin-bottom: 5px;
}

.file-types {
    font-size: 0.9rem;
    color: rgba(99, 51, 105, 0.7);
}

/* Selected files display */
.selected-files {
    margin-top: 20px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f3f4f6;
    border-radius: 8px;
    margin-bottom: 8px;
    gap: 15px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-info svg {
    color: #633369;
}

.file-name {
    font-weight: 500;
    color: #374151;
}

.file-size {
    font-size: 0.9rem;
    color: #6b7280;
}

/* Audio player controls */
.audio-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.play-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #633369 0%, #4a2455 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 51, 105, 0.3);
}

.play-btn.playing {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.audio-player {
    flex: 1;
    max-width: 200px;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.audio-progress {
    height: 100%;
    background: linear-gradient(135deg, #633369 0%, #4a2455 100%);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s ease;
}

.audio-time {
    font-size: 0.8rem;
    color: #6b7280;
    min-width: 45px;
    text-align: center;
}

/* Feature selection */
.feature-options {
    display: grid;
    gap: 15px;
}

.feature-option {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.feature-option:has(input:checked) {
    border-color: #633369;
    background: #f8faff;
}

.feature-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f9fafb;
}

.feature-option.model-unavailable {
    opacity: 0.7;
    background: #fef3c7;
    border-color: #f59e0b;
}

.feature-option.model-unavailable input[type="radio"] {
    cursor: not-allowed;
}

.feature-option input[type="radio"] {
    margin-right: 15px;
    transform: scale(1.2);
}

.feature-option label {
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.feature-option label.disabled-label {
    cursor: not-allowed;
}

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

.feature-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
}

.feature-desc {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 10px;
}

/* Model status indicators */
.model-status {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.status-checking {
    background: #e0e7ff;
    color: #4338ca;
}

.status-ready {
    background: #d1fae5;
    color: #065f46;
}

.status-warming {
    background: #fef3c7;
    color: #92400e;
    animation: pulse 1.5s infinite;
}

.status-cold {
    background: #dbeafe;
    color: #1e40af;
}

.status-unknown {
    background: #f3f4f6;
    color: #6b7280;
}

/* Wake up button */
.wakeup-btn {
    margin-top: 10px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wakeup-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.wakeup-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #9ca3af;
}

/* Model sub-options (dropdowns) */
.model-sub-options {
    margin-top: 15px;
    padding: 15px;
    background: rgba(99, 51, 105, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(99, 51, 105, 0.15);
}

.sub-option-group {
    margin-bottom: 12px;
}

.sub-option-group:last-child {
    margin-bottom: 0;
}

.sub-option-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.model-dropdown {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.95rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}

.model-dropdown:hover {
    border-color: #633369;
}

.model-dropdown:focus {
    outline: none;
    border-color: #633369;
    box-shadow: 0 0 0 3px rgba(99, 51, 105, 0.1);
}

/* Status incomplete style */
.status-incomplete {
    background: #f3f4f6;
    color: #9ca3af;
    font-style: italic;
}

/* Feature info link */
.feature-info-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.9rem;
    color: #633369;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.feature-info-link:hover {
    color: #4a2455;
    text-decoration: underline;
}

/* Info page styles */
.info-page {
    max-width: 800px;
    margin: 0 auto;
}

.info-page h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333333;
    margin-bottom: 15px;
}

.info-tagline {
    font-size: 1.3rem;
    color: #633369;
    font-weight: 500;
    margin-bottom: 40px;
}

.info-section {
    margin-bottom: 35px;
}

.info-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333333;
    margin-bottom: 15px;
    border-bottom: 2px solid rgba(99, 51, 105, 0.2);
    padding-bottom: 10px;
}

.info-list {
    margin-left: 20px;
    line-height: 1.8;
}

.info-list li {
    margin-bottom: 12px;
    color: #374151;
}

.info-list li strong {
    color: #633369;
}

.info-actions {
    margin-top: 40px;
    text-align: center;
}

.back-btn {
    display: inline-block;
    background: linear-gradient(135deg, #633369 0%, #4a2455 100%);
    color: white;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 51, 105, 0.3);
}

/* API Key section */
.api-key-section {
    margin-bottom: 40px;
}

.api-key-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.api-key-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    font-size: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: #374151;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
}

.api-key-input:focus {
    outline: none;
    border-color: #633369;
    box-shadow: 0 0 0 3px rgba(99, 51, 105, 0.1);
}

.toggle-api-key-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.toggle-api-key-btn:hover {
    background: rgba(99, 51, 105, 0.1);
    color: #633369;
}

.api-key-note {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 8px;
    font-style: italic;
}

/* Submit button */
.submit-section {
    text-align: center;
    margin-top: 40px;
}

.submit-btn {
    background: linear-gradient(135deg, #633369 0%, #4a2455 100%);
    color: white;
    border: 2px solid white;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 auto;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 51, 105, 0.3);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.spinner {
    animation: spin 1s linear infinite;
}

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

/* Results section */
.results-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid #e5e7eb;
}

/* Results summary */
.results-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8eeff 100%);
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.summary-stats {
    display: flex;
    align-items: center;
    gap: 20px;
}

.summary-progress {
    font-size: 1.2rem;
    font-weight: 700;
    color: #633369;
}

.summary-status {
    font-size: 0.95rem;
    color: #6b7280;
}

.summary-status.all-complete {
    color: #059669;
    font-weight: 600;
}

.summary-status.processing {
    color: #d97706;
}

.summary-status.failed {
    color: #dc2626;
    font-weight: 600;
}

.toggle-results-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #374151;
    transition: all 0.2s ease;
}

.toggle-results-btn:hover {
    background: #f9fafb;
    border-color: #633369;
    color: #633369;
}

.toggle-icon {
    transition: transform 0.2s ease;
}

.toggle-results-btn.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.results-container {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.results-container.collapsed {
    display: none;
}

.result-item {
    background: #f8faff;
    border: 1px solid #e0e7ff;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.result-item:hover {
    box-shadow: 0 4px 12px rgba(99, 51, 105, 0.1);
}

.result-header {
    display: flex;
    justify-content: between;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 20px;
}

.result-filename {
    font-weight: 600;
    color: #374151;
    font-size: 1.1rem;
    flex: 1;
}

.result-score {
    background: linear-gradient(135deg, #633369 0%, #4a2455 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 80px;
    text-align: center;
}

.result-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.result-detail {
    display: flex;
    flex-direction: column;
}

.result-detail-label {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 2px;
}

.result-detail-value {
    font-weight: 600;
    color: #374151;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-processing {
    background: #fef3c7;
    color: #92400e;
    animation: pulse 1.5s infinite;
}

.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

.result-failed {
    border-left: 4px solid #dc2626;
}

.result-processing {
    border-left: 4px solid #f59e0b;
}

.result-completed {
    border-left: 4px solid #10b981;
}

.result-error {
    margin-top: 10px;
    padding: 12px;
    background: #fee2e2;
    border-radius: 6px;
    color: #991b1b;
    font-size: 0.9rem;
}

/* Diarisation segments */
.diarisation-segments {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e7ff;
}

.diarisation-segments h4 {
    font-size: 1rem;
    color: #374151;
    margin-bottom: 12px;
    font-weight: 600;
}

.segments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
}

.segment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #633369;
    transition: all 0.2s ease;
}

.segment-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(99, 51, 105, 0.15);
}

.segment-speaker {
    font-weight: 600;
    color: #633369;
    font-size: 0.9rem;
}

.segment-time {
    font-size: 0.85rem;
    color: #6b7280;
    font-family: 'Courier New', monospace;
}

.more-segments {
    text-align: center;
    padding: 8px;
    color: #6b7280;
    font-size: 0.9rem;
    font-style: italic;
}

/* Download section */
.download-section {
    text-align: center;
}

.download-btn {
    background: #059669;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.download-btn:hover {
    background: #047857;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.3);
}

/* Error states */
.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
}

.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
}

/* Recording controls */
.recording-controls {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.record-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.record-btn.start {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.record-btn.start:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.record-btn.stop {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.record-btn.stop:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
}

.recording-status {
    font-size: 0.9rem;
    font-weight: 600;
    color: #633369;
    text-align: center;
}

.recording-status.recording {
    color: #ef4444;
    animation: pulse 1.5s infinite;
}

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

.logo-spacer {
    width: 60px; /* Same width as logo container for balance */
}

/* Navigation */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 15px 40px;
    background: linear-gradient(135deg, #f8f6ff 0%, #f0ecf8 100%);
    border-bottom: 1px solid rgba(99, 51, 105, 0.1);
}

.nav-link {
    padding: 10px 25px;
    text-decoration: none;
    color: #633369;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: white;
    border: 2px solid transparent;
}

.nav-link:hover {
    background: rgba(99, 51, 105, 0.1);
    border-color: rgba(99, 51, 105, 0.2);
}

.nav-link.active {
    background: linear-gradient(135deg, #633369 0%, #4a2455 100%);
    color: white;
    border-color: transparent;
}

/* Home page styles */
.home-content {
    text-align: center;
}

.intro-section {
    margin-bottom: 50px;
}

.intro-gif {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(99, 51, 105, 0.15);
}

.services-section h2 {
    font-size: 2rem;
    color: #633369;
    margin-bottom: 30px;
    border-bottom: none;
    padding-bottom: 0;
}

.service-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.service-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 30px;
    background: white;
    border: 2px solid rgba(99, 51, 105, 0.15);
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(99, 51, 105, 0.2);
    border-color: #633369;
}

.service-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f6ff 0%, #e8e3f5 100%);
    border-radius: 50%;
    margin-bottom: 20px;
    color: #633369;
}

.service-card h3 {
    font-size: 1.5rem;
    color: #633369;
    margin-bottom: 8px;
}

.service-subtitle {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 15px;
    font-style: italic;
}

.service-desc {
    color: #374151;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: center;
}

.service-cta {
    display: inline-block;
    padding: 10px 25px;
    background: linear-gradient(135deg, #633369 0%, #4a2455 100%);
    color: white;
    font-weight: 600;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.service-card:hover .service-cta {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(99, 51, 105, 0.3);
}

/* Single feature option styling */
.feature-options-single {
    display: flex;
    justify-content: center;
}

.feature-options-single .feature-option {
    max-width: 400px;
    width: 100%;
}

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

    .container {
        margin: 0;
        border-radius: 8px;
    }

    header, main {
        padding: 20px;
    }

    header h1 {
        font-size: 2rem;
    }

    .upload-options {
        grid-template-columns: 1fr;
    }

    .result-header {
        flex-direction: column;
        gap: 10px;
    }

    .result-details {
        grid-template-columns: 1fr;
    }

    .main-nav {
        flex-direction: column;
        padding: 15px 20px;
    }

    .nav-link {
        text-align: center;
    }

    .service-cards {
        grid-template-columns: 1fr;
    }
}
