/* Education Enrollment Simulation System - Styles */

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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

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

/* Header */
header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 16px;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

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

/* Card */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.card h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
    color: var(--primary);
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text);
}

input[type="number"],
select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Grade Section */
.grade-section {
    margin: 20px 0;
    padding: 16px;
    background: var(--bg);
    border-radius: 8px;
}

.grade-section h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text);
}

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

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

.grade-item label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.grade-item select {
    width: 100%;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 16px;
}

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

.btn-secondary {
    padding: 8px 16px;
    background: var(--text-light);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

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

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    padding: 10px 16px;
    background: none;
    border: none;
    font-size: 0.95rem;
    color: var(--text-light);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

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

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-bar select {
    flex: 1;
    min-width: 150px;
}

/* Table */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg);
    font-weight: 600;
    color: var(--text);
    position: sticky;
    top: 0;
}

tr:hover {
    background: var(--bg);
}

/* Result Section */
.result-section {
    margin-top: 24px;
}

.result-category {
    margin-bottom: 20px;
}

.result-category h4 {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 1rem;
}

.result-category.rush h4 {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.result-category.stable h4 {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
}

.result-category.backup h4 {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

.school-list {
    display: grid;
    gap: 8px;
}

.school-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: box-shadow 0.2s;
}

.school-item:hover {
    box-shadow: var(--shadow);
}

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

.school-info {
    font-size: 0.85rem;
    color: var(--text-light);
}

.school-meta {
    text-align: right;
}

.school-score {
    font-weight: 600;
    color: var(--primary);
}

.school-diff {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Badge */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-public {
    background: #dbeafe;
    color: #1e40af;
}

.badge-private {
    background: #fef3c7;
    color: #92400e;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    header {
        padding: 24px 16px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .card {
        padding: 16px;
    }

    .tabs {
        overflow-x: auto;
    }

    .filter-bar {
        flex-direction: column;
    }

    .filter-bar select,
    .filter-bar button {
        width: 100%;
    }
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error */
.error {
    padding: 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
}
