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

[hidden] {
    display: none !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #2d5a27 0%, #4a7c43 50%, #6b9b64 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    padding: 40px;
}

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

.logo {
    max-width: 120px;
    height: auto;
    margin-bottom: 16px;
}

h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.subtitle {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

#upload-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.drop-zone {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #4a7c43;
    background: #f5f9f4;
}

.drop-zone.drag-over {
    transform: scale(1.02);
}

.drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    color: #9ca3af;
    margin-bottom: 16px;
}

.drop-text {
    font-size: 16px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
}

.drop-hint {
    font-size: 14px;
    color: #9ca3af;
    margin-bottom: 12px;
}

.file-types {
    font-size: 12px;
    color: #9ca3af;
}

.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
}

.file-name {
    font-size: 14px;
    color: #0369a1;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.remove-file {
    background: none;
    border: none;
    font-size: 20px;
    color: #64748b;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.remove-file:hover {
    color: #ef4444;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.form-group input {
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #4a7c43;
    box-shadow: 0 0 0 3px rgba(74, 124, 67, 0.1);
}

.input-hint {
    font-size: 12px;
    color: #9ca3af;
}

.submit-btn {
    background: linear-gradient(135deg, #2d5a27 0%, #4a7c43 100%);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 124, 67, 0.4);
}

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

.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.message {
    padding: 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.message.success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.message.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

footer {
    margin-top: 32px;
    text-align: center;
}

footer p {
    font-size: 12px;
    color: #9ca3af;
}

.logout-link {
    display: inline-block;
    margin-top: 12px;
    font-size: 12px;
    color: #9ca3af;
    text-decoration: none;
}

.logout-link:hover {
    color: #4a7c43;
    text-decoration: underline;
}

.login-container {
    max-width: 400px;
}

.login-container form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Waveform Section */
.file-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.waveform-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
}

.waveform-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px;
    color: #64748b;
    font-size: 14px;
}

#waveform {
    margin-bottom: 12px;
}

.waveform-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
}

.control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.add-speaker-btn {
    margin-left: auto;
    background: linear-gradient(135deg, #2d5a27 0%, #4a7c43 100%);
    color: white;
    border: none;
}

.add-speaker-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 124, 67, 0.3);
}

.time-display {
    font-size: 13px;
    color: #64748b;
    font-family: monospace;
}

/* Speakers Section */
.speakers-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
}

.speakers-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.speakers-hint {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 12px;
}

.speakers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.speaker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
}

.speaker-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.speaker-name {
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
}

.speaker-name:focus {
    outline: none;
    border-color: #4a7c43;
    box-shadow: 0 0 0 2px rgba(74, 124, 67, 0.1);
}

.speaker-time {
    font-size: 11px;
    color: #64748b;
    font-family: monospace;
    white-space: nowrap;
}

.speaker-time.duration-warning {
    color: #f59e0b;
}

.speaker-play,
.speaker-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #f1f5f9;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.speaker-play:hover {
    background: #e2e8f0;
    color: #4a7c43;
}

.speaker-delete:hover {
    background: #fef2f2;
    color: #ef4444;
}

@media (max-width: 540px) {
    body {
        padding: 16px;
    }

    .container {
        padding: 24px;
    }

    h1 {
        font-size: 24px;
    }

    .drop-zone {
        padding: 32px 16px;
    }

    .waveform-controls {
        flex-wrap: wrap;
    }

    .add-speaker-btn {
        width: 100%;
        margin-left: 0;
        margin-top: 8px;
        justify-content: center;
    }

    .speaker-item {
        flex-wrap: wrap;
    }

    .speaker-name {
        order: 1;
        width: 100%;
        margin-top: 8px;
    }

    .speaker-time {
        flex: 1;
    }
}
