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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #1e90ff 0%, #99badd 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

header {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

h1 {
    color: #333;
    margin-bottom: 20px;
    font-size: 28px;
}

h2 {
    color: #333;
    margin: 20px 0 15px;
    font-size: 18px;
    border-bottom: 2px solid #1e90ff;
    padding-bottom: 10px;
}

.nav-links {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-links a {
    display: inline-block;
    padding: 10px 16px;
    background: #1e90ff;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

.nav-links a:hover {
    background: #99badd;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(30, 144, 255, 0.3);
}

form {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

label {
    display: block;
    margin: 20px 0 10px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

label:first-of-type {
    margin-top: 0;
}

input[type="file"],
select {
    display: block;
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.3s;
}

input[type="file"]:focus,
select:focus {
    outline: none;
    border-color: #1e90ff;
    box-shadow: 0 0 0 3px rgba(30, 144, 255, 0.1);
}

input[type="file"]::file-selector-button {
    background: #1e90ff;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
    transition: background 0.3s;
}

input[type="file"]::file-selector-button:hover {
    background: #99badd;
}

button {
    background: linear-gradient(135deg, #1e90ff 0%, #99badd 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(30, 144, 255, 0.3);
}

button:active {
    transform: translateY(0);
}

#feedback {
    text-align: center;
    margin-top: 20px;
    font-weight: 600;
    padding: 15px;
    border-radius: 6px;
    display: none;
}

#feedback.success {
    background: #d1fae5;
    color: #065f46;
    border: 2px solid #10b981;
    display: block;
}

#feedback.error {
    background: #fee2e2;
    color: #991b1b;
    border: 2px solid #ef4444;
    display: block;
}

#feedback.info {
    background: #dbeafe;
    color: #1e40af;
    border: 2px solid #3b82f6;
    display: block;
}

/* Progress Tracking */
#progress-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.98);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: none !important;
    z-index: 999;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

#progress-container.active {
    display: block !important;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

#progress-container h2 {
    margin-top: 0;
    color: #333;
    position: relative;
    padding-right: 40px;
}

.close-progress {
    position: absolute;
    top: 0;
    right: 0;
    width: 36px;
    height: 36px;
    background: #f3f4f6;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 24px;
    color: #666;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.close-progress:hover {
    background: #e5e7eb;
    color: #333;
    transform: scale(1.1);
}

.close-progress:active {
    transform: scale(0.95);
}

.progress-bar-container {
    background: #e5e7eb;
    border-radius: 10px;
    height: 32px;
    overflow: hidden;
    margin: 25px 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    background: linear-gradient(90deg, #1e90ff 0%, #99badd 100%);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: bold;
}

#progress-text {
    text-align: center;
    font-size: 32px;
    font-weight: bold;
    color: #1e90ff;
    margin: 15px 0;
}

#status-message {
    text-align: center;
    color: #666;
    font-size: 16px;
    margin: 15px 0;
}

/* Features Container */
#features-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 12px;
    margin-top: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: none;
}

#features-container.active {
    display: block;
}

#features-container h2 {
    margin-top: 0;
}

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

.feature-item {
    background: linear-gradient(135deg, #1e90ff15 0%, #99badd15 100%);
    border: 2px solid #1e90ff;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.feature-name {
    font-weight: 600;
    color: #333;
    font-size: 13px;
    margin-bottom: 8px;
}

.feature-value {
    color: #1e90ff;
    font-size: 18px;
    font-weight: bold;
}

/* Error Container */
#error-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 12px;
    margin-top: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: none;
}

#error-container.active {
    display: block;
    background: #fee2e2;
    border: 2px solid #ef4444;
}

.error-title {
    color: #991b1b;
    font-weight: 600;
    margin-bottom: 10px;
}

.error-message {
    color: #7f1d1d;
    font-size: 14px;
    line-height: 1.5;
}

.error-list {
    list-style: none;
    margin: 10px 0;
}

.error-list li {
    color: #7f1d1d;
    padding: 5px 0;
    padding-left: 20px;
    position: relative;
}

.error-list li:before {
    content: "✗";
    position: absolute;
    left: 0;
    color: #ef4444;
    font-weight: bold;
}

/* Instruments Section */
.instruments-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #1e90ff;
}

.instruments-section h3 {
    color: #333;
    margin: 20px 0 15px;
    font-size: 18px;
}

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

.instrument-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #1e90ff;
    transition: all 0.3s ease;
}

.instrument-card:hover {
    box-shadow: 0 4px 12px rgba(30, 144, 255, 0.2);
    transform: translateY(-2px);
}

.instrument-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.instrument-emoji {
    font-size: 28px;
}

.instrument-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    flex-grow: 1;
}

.confidence-label {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
}

.confidence-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.confidence-bar {
    flex-grow: 1;
    height: 24px;
    background: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #1e90ff, #00bfff);
    transition: width 0.6s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 6px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.confidence-percent {
    font-weight: 600;
    color: #333;
    font-size: 12px;
    min-width: 35px;
    text-align: right;
}

.segments-section {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.segments-label {
    font-weight: 600;
    color: #555;
    font-size: 12px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.segments-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.segment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 8px 10px;
    border-radius: 4px;
    border-left: 3px solid #1e90ff;
    font-size: 12px;
    color: #666;
}

.segment-time {
    font-weight: 500;
    color: #333;
}

.segment-prob {
    background: #e8f4f8;
    color: #1e90ff;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 11px;
}

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        max-width: 100%;
    }

    form,
    header,
    #progress-container,
    #features-container,
    #error-container {
        padding: 20px;
    }

    header h1 {
        font-size: 24px;
    }

    .nav-links {
        flex-direction: column;
    }

    .nav-links a {
        width: 100%;
        text-align: center;
    }

    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
}
