/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Container */
.container {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 40px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Typography */
h1 {
    color: #000000;
    margin-bottom: 8px;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
}

.subtitle {
    color: #666666;
    text-align: center;
    margin-bottom: 32px;
    font-size: 14px;
    font-weight: 400;
}

/* Player Selection */
.player-select-section {
    margin-bottom: 24px;
}

.player-select-section label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.player-select-wrapper {
    position: relative;
}

.player-select-wrapper select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    background: #fafafa;
    color: #000;
    cursor: pointer;
    appearance: none;
    transition: border-color 0.2s;
}

.player-select-wrapper select:hover {
    border-color: #000;
}

.player-select-wrapper select:focus {
    outline: none;
    border-color: #000;
    background: #fff;
}

.player-select-wrapper::after {
    content: '\25BC';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 12px;
    color: #666;
}

.player-select-hint {
    font-size: 12px;
    color: #999;
    margin-top: 6px;
}

/* Recording Section */
.record-section {
    text-align: center;
    margin: 20px 0;
}

.record-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.record-btn:hover:not(:disabled) {
    background: #c82333;
    transform: scale(1.05);
}

.record-btn.recording {
    background: #ff4444;
    animation: pulse 1.5s infinite;
}

.record-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

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

.recording-timer {
    color: #dc3545;
    font-weight: 600;
    font-size: 18px;
    margin-top: 10px;
}

/* Divider */
.divider {
    text-align: center;
    margin: 20px 0;
    color: #666;
    font-size: 14px;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background: #e0e0e0;
}

.divider::before { left: 0; }
.divider::after { right: 0; }

/* Upload Area */
.upload-area {
    border: 2px dashed #d0d0d0;
    border-radius: 8px;
    padding: 48px 20px;
    text-align: center;
    margin-bottom: 20px;
    background: #fafafa;
    transition: all 0.2s;
    cursor: pointer;
}

.upload-area:hover {
    background: #f5f5f5;
    border-color: #000000;
}

.upload-area.dragover {
    background: #f0f0f0;
    border-color: #000000;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.upload-text {
    font-size: 15px;
    color: #000000;
    font-weight: 500;
    margin-bottom: 4px;
}

.upload-hint {
    font-size: 13px;
    color: #999999;
}

input[type="file"] {
    display: none;
}

/* File Info */
.file-info {
    background: #f5f5f5;
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: none;
    border: 1px solid #e0e0e0;
}

.file-info.show {
    display: block;
}

.file-name {
    font-weight: 500;
    color: #000000;
    font-size: 14px;
}

/* Buttons */
button {
    width: 100%;
    background: #000000;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover:not(:disabled) {
    background: #333333;
}

button:disabled {
    background: #e0e0e0;
    color: #999999;
    cursor: not-allowed;
}

.btn-secondary {
    background: #ffffff;
    color: #000000;
    margin-top: 12px;
    border: 1px solid #e0e0e0;
}

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

/* Loading Spinner */
.loading {
    display: none;
    text-align: center;
    padding: 30px;
}

.loading.show {
    display: block;
}

.spinner {
    border: 3px solid #f0f0f0;
    border-top: 3px solid #000000;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #000000;
    font-weight: 600;
    font-size: 16px;
}

/* Results */
.results {
    display: none;
    margin-top: 32px;
}

.results.show {
    display: block;
}

.score-card {
    background: #000000;
    color: white;
    padding: 32px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 24px;
}

.score-big {
    font-size: 56px;
    font-weight: 600;
    line-height: 1;
}

.grade {
    font-size: 20px;
    margin-top: 8px;
    font-weight: 400;
    opacity: 0.8;
}

/* Detected Player */
.detected-player {
    background: #f5f5f5;
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 24px;
    text-align: center;
    border: 1px solid #e0e0e0;
}

.detected-player strong {
    color: #000000;
    font-size: 15px;
    font-weight: 500;
}

/* Metrics */
.metrics {
    background: #fafafa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

.metric-row:last-child {
    border-bottom: none;
}

.metric-label {
    font-weight: 500;
    color: #666666;
    font-size: 14px;
}

.metric-value {
    font-weight: 600;
    color: #000000;
    font-size: 14px;
}

/* Suggestions */
.suggestions h3 {
    color: #000000;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
}

.suggestion-item {
    background: white;
    padding: 16px;
    margin: 8px 0;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e0e0e0;
}

.suggestion-item:hover {
    border-color: #000000;
    background: #fafafa;
}

.suggestion-name {
    font-weight: 500;
    color: #000000;
    font-size: 15px;
}

.suggestion-details {
    font-size: 13px;
    color: #666666;
    margin-top: 4px;
}

.suggestion-confidence {
    font-size: 20px;
    font-weight: 600;
    color: #000000;
}

/* Error */
.error {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-left: 3px solid #000000;
    padding: 20px;
    border-radius: 6px;
    color: #000000;
    margin-top: 20px;
}

.error strong {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 600;
}
