/* 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, #e8f4f8 0%, #cfe9f3 100%);
    min-height: 100vh;
    color: #333;
}

/* Container for centered content */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header styles */
header {
    text-align: center;
    color: #003d66;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Card styles */
.card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.card h2 {
    margin-bottom: 20px;
    color: #0066cc;
}

.card h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #555;
}

/* Error message */
.error-message {
    background: #fee;
    border: 2px solid #fcc;
    border-radius: 6px;
    padding: 15px;
    margin: 20px 0;
    color: #c33;
    font-weight: 500;
}

/* Button styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
}

.btn-primary {
    background: #0066cc;
    color: white;
}

.btn-primary:hover {
    background: #004c99;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.4);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

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

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 1.2rem;
}

.button-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

/* Form styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #0066cc;
}

.form-group select,
.config-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.form-group select:focus,
.config-select:focus {
    outline: none;
    border-color: #0066cc;
}

.form-group select:hover,
.config-select:hover {
    border-color: #0066cc;
}

/* User list styles */
.user-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.user-item:hover {
    background: #e9ecef;
    border-color: #0066cc;
    transform: translateX(5px);
}

.user-info strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.user-meta {
    font-size: 0.9rem;
    color: #666;
    margin-right: 15px;
}

/* Instructions styles */
.instructions-section {
    margin-bottom: 30px;
}

.instructions-section ul, .instructions-section ol {
    margin-left: 20px;
    line-height: 1.8;
}

.instructions-section li {
    margin-bottom: 8px;
}

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

.text-muted {
    color: #999;
}

/* ========== VIEWER SPECIFIC STYLES ========== */

.viewer-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #1a1a1a;
    color: white;
}

.viewer-header {
    background: #2a2a2a;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.viewer-header h1 {
    font-size: 1.5rem;
    color: white;
}

.case-info {
    display: flex;
    gap: 30px;
    font-size: 0.95rem;
}

.case-info span {
    color: #aaa;
}

/* Main viewer area */
.viewer-main {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px;
    background: #1a1a1a;
}

.volume-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #2a2a2a;
    border-radius: 8px;
    padding: 15px;
}

.view-label {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #0066cc;
}

canvas {
    border: 2px solid #444;
    border-radius: 4px;
    cursor: crosshair;
    max-width: 100%;
    height: auto;
}

canvas:hover {
    border-color: #0066cc;
}

/* Slice controls */
.slice-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 15px;
    background: #2a2a2a;
}

#slice-slider {
    flex: 1;
    max-width: 600px;
    height: 8px;
    border-radius: 4px;
    background: #444;
    outline: none;
    -webkit-appearance: none;
}

#slice-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0066cc;
    cursor: pointer;
}

#slice-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0066cc;
    cursor: pointer;
    border: none;
}

/* Evaluation panel */
.evaluation-panel {
    background: #2a2a2a;
    padding: 25px;
    border-top: 2px solid #444;
}

.evaluation-panel h2 {
    color: white;
    margin-bottom: 20px;
    text-align: center;
}

.score-group, .preference-group, .notes-group {
    margin-bottom: 20px;
}

.score-group label, .preference-group label, .notes-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #aaa;
}

/* Score buttons */
.score-buttons-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.score-label {
    font-size: 0.9rem;
    color: #999;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
}

.score-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.score-btn {
    width: 50px;
    height: 50px;
    border: 2px solid #444;
    background: #333;
    color: white;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.score-btn:hover {
    background: #444;
    border-color: #0066cc;
}

.score-btn.active {
    background: #0066cc;
    border-color: #0066cc;
    transform: scale(1.1);
}

/* Preference buttons */
.preference-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.pref-btn {
    padding: 12px 30px;
    border: 2px solid #444;
    background: #333;
    color: white;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pref-btn:hover {
    background: #444;
    border-color: #0066cc;
}

.pref-btn.active {
    background: #0066cc;
    border-color: #0066cc;
}

/* Notes textarea */
textarea {
    width: 100%;
    padding: 12px;
    background: #333;
    border: 2px solid #444;
    border-radius: 8px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: #0066cc;
}

/* Submit button in viewer */
.evaluation-panel .btn-large {
    width: 100%;
    margin-top: 10px;
}

/* Responsive design */
@media (max-width: 1200px) {
    .viewer-main {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    canvas {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .viewer-header {
        flex-direction: column;
        gap: 10px;
    }

    .case-info {
        flex-direction: column;
        gap: 5px;
    }

    .score-buttons, .preference-buttons {
        flex-wrap: wrap;
    }
}
