/* IVA Medal Scoring System - Stylesheet */

:root {
    --primary: #1a5f7a;
    --primary-dark: #134b5f;
    --secondary: #6c757d;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --gold: #ffd700;
    --silver: #c0c0c0;
    --light: #f8f9fa;
    --dark: #343a40;
    --border: #dee2e6;
    --shadow: rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: #f5f5f5;
}

/* Navbar */
.navbar {
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 2px 4px var(--shadow);
}

.nav-brand {
    font-weight: bold;
    font-size: 1.25rem;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-link {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.page-header h1 {
    font-size: 1.75rem;
    color: var(--dark);
}

.back-link {
    color: var(--secondary);
    text-decoration: none;
    font-size: 0.9rem;
}

.back-link:hover {
    color: var(--primary);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-warning {
    background: var(--warning);
    color: var(--dark);
}

.badge-secondary {
    background: var(--secondary);
    color: white;
}

.badge-gold {
    background: linear-gradient(135deg, #ffd700, #ffb700);
    color: #333;
}

.badge-silver {
    background: linear-gradient(135deg, #e8e8e8, #c0c0c0);
    color: #333;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--primary);
    color: white;
}

.btn:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary);
}

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

.btn-primary {
    background: var(--primary);
}

.btn-warning {
    background: var(--warning);
    color: var(--dark);
}

.btn-danger {
    background: var(--danger);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-info {
    background: #e7f3ff;
    border: 1px solid #b8daff;
    color: #004085;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert a {
    color: inherit;
    font-weight: 500;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px var(--shadow);
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    background: var(--light);
    font-weight: 600;
    color: var(--dark);
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table .actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Stats Row */
.stats-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px var(--shadow);
    text-align: center;
    min-width: 120px;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

.stat-label {
    color: var(--secondary);
    font-size: 0.9rem;
}

/* Candidate List */
.candidate-name {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.candidate-name:hover {
    text-decoration: underline;
}

.row-scored {
    background: #f0fff4;
}

.status-done {
    color: var(--success);
    font-weight: 500;
}

.status-pending {
    color: var(--secondary);
}

/* Candidate Info */
.candidate-info {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px var(--shadow);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 0.8rem;
    color: var(--secondary);
    margin-bottom: 0.25rem;
}

.info-value {
    font-weight: 500;
}

.candidate-notes {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    color: var(--secondary);
}

/* Documents Section */
.documents-section {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px var(--shadow);
}

.documents-section h3 {
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.document-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.document-list li a {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--light);
    border-radius: 4px;
    color: var(--primary);
    text-decoration: none;
}

.document-list li a:hover {
    background: #e9ecef;
}

/* Score Form */
.score-form h2 {
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem;
}

.score-help {
    color: var(--secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.criteria-list {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px var(--shadow);
    overflow: hidden;
}

.criterion-row {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

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

.criterion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.criterion-name {
    font-weight: 500;
}

.score-buttons {
    display: flex;
    gap: 0.25rem;
}

.score-btn {
    width: 36px;
    height: 36px;
    border: 2px solid var(--border);
    border-radius: 4px;
    background: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.score-btn:hover {
    border-color: var(--primary);
}

.score-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Recommendation Section */
.recommendation-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px var(--shadow);
    margin-bottom: 1.5rem;
}

.recommendation-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.rec-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border);
    border-radius: 4px;
    background: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.rec-btn:hover {
    border-color: var(--primary);
}

.rec-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.recommendation-comment label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.recommendation-comment textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    resize: vertical;
}

/* Form Actions */
.form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.save-status {
    color: var(--success);
    font-size: 0.9rem;
}

/* Forms */
.form-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px var(--shadow);
    max-width: 600px;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Inline Forms */
.inline-form {
    display: inline;
}

.input-inline {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-right: 0.5rem;
}

.input-table {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    width: 100%;
}

/* Rankings */
.filter-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.top-five {
    background: #fffbeb;
}

.rank-number {
    font-weight: bold;
    color: var(--primary);
}

.score-cell {
    font-weight: 500;
}

/* Scores Matrix */
.scores-matrix {
    overflow-x: auto;
}

.table-scores .evaluator-col {
    min-width: 80px;
    text-align: center;
}

.table-scores .score-cell {
    text-align: center;
}

.table-scores .avg-cell {
    font-weight: bold;
    text-align: center;
    background: var(--light);
}

/* History */
.history-section {
    margin-top: 1.5rem;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.login-container {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 500px;
    width: 90%;
}

.login-container h1 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--secondary);
    margin-bottom: 2rem;
}

.evaluator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.evaluator-btn {
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.evaluator-btn:hover {
    border-color: var(--primary);
    background: var(--light);
}

.no-evaluators {
    grid-column: 1 / -1;
    color: var(--secondary);
}

.login-admin {
    margin-top: 1.5rem;
}

/* Admin Section */
.admin-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px var(--shadow);
    margin-bottom: 1.5rem;
}

.admin-section h2 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.add-evaluator-form {
    margin-bottom: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Round Management */
.round-info {
    color: var(--secondary);
    margin-bottom: 1rem;
}

.candidate-toggle-row {
    cursor: pointer;
}

.candidate-toggle-row.active {
    background: #e8f5e9;
}

.toggle-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Import Section */
.import-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px var(--shadow);
    margin-bottom: 1.5rem;
}

.import-section h2 {
    margin-bottom: 0.75rem;
}

.import-section ul {
    margin: 0.75rem 0 1.5rem 1.5rem;
}

.import-form .form-group {
    margin-bottom: 1rem;
}

/* Info Box */
.info-box {
    background: #e7f3ff;
    border: 1px solid #b8daff;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-top: 1.5rem;
}

.info-box h3 {
    color: #004085;
    margin-bottom: 0.5rem;
}

.info-box ul {
    margin-left: 1.25rem;
}

.info-box li {
    margin-bottom: 0.25rem;
}

/* Upload Section */
.upload-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px var(--shadow);
    margin-bottom: 1.5rem;
}

.upload-section h2 {
    margin-bottom: 1rem;
}

.upload-form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

/* Create Round */
.create-round {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px var(--shadow);
    margin-bottom: 1.5rem;
}

.create-round h2 {
    margin-bottom: 1rem;
}

/* Utility Classes */
.text-muted {
    color: var(--secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .nav-links {
        order: 3;
        width: 100%;
        flex-wrap: wrap;
    }

    .nav-user {
        order: 2;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .stats-row {
        flex-wrap: wrap;
    }

    .criterion-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .score-buttons {
        margin-top: 0.5rem;
    }

    .recommendation-buttons {
        flex-direction: column;
    }

    .rec-btn {
        width: 100%;
        text-align: center;
    }

    .table {
        font-size: 0.875rem;
    }

    .table th,
    .table td {
        padding: 0.5rem;
    }
}
