/* Global Styles */
* {
    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, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

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

/* Header */
.header {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 24px;
    color: #667eea;
}

.nav {
    display: flex;
    gap: 15px;
}

.nav-link {
    text-decoration: none;
    color: #667eea;
    padding: 8px 16px;
    border-radius: 5px;
    transition: background 0.3s;
}

.nav-link:hover {
    background: #f0f0f0;
}

.nav-link.active {
    background: #667eea;
    color: white;
}

/* Login Page */
.login-card {
    background: white;
    border-radius: 10px;
    padding: 40px;
    max-width: 400px;
    margin: 100px auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.login-card h1 {
    color: #667eea;
    margin-bottom: 10px;
}

.login-card p {
    color: #666;
    margin-bottom: 30px;
}

/* Evaluation Page */
.evaluation-container {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.instructions {
    text-align: center;
    margin-bottom: 30px;
}

.instructions h2 {
    color: #667eea;
    margin-bottom: 10px;
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.player-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.player-card h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.player-card audio {
    width: 100%;
    margin-bottom: 15px;
}

.player-controls {
    margin-top: 15px;
}

/* Radio Page */
.radio-container {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.radio-controls {
    margin-bottom: 30px;
}

.prompt-selector {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

.prompt-selector select {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.audio-prompt-selector {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.audio-prompt-selector select {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.audio-prompt-selector label {
    white-space: nowrap;
}

.group-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 5px;
    transition: background 0.2s;
}

.group-toggle:hover {
    background: #e9ecef;
}

.group-toggle input {
    cursor: pointer;
}

.playback-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.playlist-container {
    margin-bottom: 30px;
}

.playlist {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
}

.playlist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.playlist-item:hover {
    background: #f8f9fa;
}

.playlist-item.active {
    background: #e3f2fd;
    border-left: 4px solid #667eea;
}

.playlist-item-info {
    flex: 1;
}

.elo-rating {
    color: #666;
    font-size: 14px;
    margin-left: 10px;
}

.audio-prompt-tag {
    display: inline-block;
    background: #e8f4fd;
    color: #1976d2;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 8px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.audio-prompt-group {
    margin-bottom: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.audio-prompt-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 15px;
    font-weight: 600;
    font-size: 14px;
}

.audio-prompt-group .playlist-item {
    border-bottom: 1px solid #f0f0f0;
}

.audio-prompt-group .playlist-item:last-child {
    border-bottom: none;
}

.player-container {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.player-container audio {
    width: 100%;
    margin-top: 15px;
}

.now-playing-info {
    margin-bottom: 15px;
}

/* Dashboard */
.dashboard-container {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.stat-card h3 {
    font-size: 14px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
}

.dashboard-section {
    margin-bottom: 40px;
}

.dashboard-section h2 {
    color: #667eea;
    margin-bottom: 20px;
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.data-table th {
    background: #667eea;
    color: white;
    padding: 12px;
    text-align: left;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.data-table tr:hover {
    background: #f8f9fa;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

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

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-small {
    padding: 5px 10px;
    font-size: 14px;
}

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

/* Admin Metadata Section */
.admin-metadata-section {
    margin-top: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    overflow: hidden;
}

.admin-metadata-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f0f0f0;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    transition: background 0.2s;
}

.admin-metadata-toggle:hover {
    background: #e8e8e8;
}

.toggle-icon {
    font-size: 10px;
    transition: transform 0.2s;
}

.toggle-icon.expanded {
    transform: rotate(90deg);
}

.admin-metadata-content {
    padding: 16px;
    border-top: 1px solid #e0e0e0;
}

.metadata-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.metadata-card {
    background: white;
    border-radius: 6px;
    padding: 16px;
    border: 1px solid #e0e0e0;
}

.metadata-card h4 {
    color: #667eea;
    margin-bottom: 12px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metadata-details {
    font-size: 13px;
    color: #444;
}

.metadata-details .metadata-item {
    display: flex;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.metadata-details .metadata-item:last-child {
    border-bottom: none;
}

.metadata-details .metadata-label {
    font-weight: 500;
    color: #666;
    min-width: 100px;
    flex-shrink: 0;
}

.metadata-details .metadata-value {
    color: #333;
    word-break: break-word;
}

@media (max-width: 768px) {
    .metadata-grid {
        grid-template-columns: 1fr;
    }
}

/* Messages */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
    border: 1px solid #f5c6cb;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
    border: 1px solid #c3e6cb;
    text-align: center;
}

.success-message .loading-next {
    font-size: 14px;
    color: #3d7a4a;
    margin-top: 8px;
    font-style: italic;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #667eea;
}

.placeholder {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .comparison-grid {
        grid-template-columns: 1fr;
    }

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

    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .prompt-selector {
        flex-direction: column;
        align-items: stretch;
    }
}
