/* WASSCE Combiner Enterprise Styling */
:root {
    --primary: #0b3954;
    --secondary: #087e8b;
    --accent: #bfd7ea;
    --surface: #ffffff;
    --surface-muted: #f5f7fa;
    --border: #d9e2ec;
    --border-strong: #c5d5e4;
    --text-primary: #1f2933;
    --text-secondary: #52606d;
    --shadow-soft: 0 2px 6px rgba(11, 57, 84, 0.08);
    --shadow-hover: 0 3px 10px rgba(11, 57, 84, 0.12);
    --error-color: #db3d6c;
    --warning-color: #d69e2e;
    --success-color: #2f855a;
}

body {
    background-color: var(--surface-muted);
    font-family: 'Inter', 'Poppins', system-ui, -apple-system, sans-serif;
    color: var(--text-primary);
}

.combiner-container {
    max-width: 1100px;
    margin: 2.5rem auto 4rem;
    padding: 0 1.5rem 3rem;
}

/* Header Section */
.combiner-header {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem 3rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-soft);
}

.combiner-header .eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.combiner-header h1 {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.combiner-header p {
    max-width: 620px;
    font-size: 1rem;
    color: var(--text-secondary);
}

.guidance-panel {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
}

.guidance-panel h2 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.guidance-panel p {
    color: var(--text-secondary);
    margin: 0;
}

.guidance-panel ul {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}


/* Table Container */
.table-container {
    overflow-x: auto;
    margin-top: 0.5rem;
}

/* Grade Badge */
.grade-badge {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Empty message */
.empty-message {
    text-align: center;
    color: var(--text-secondary);
    padding: 1.5rem !important;
}

/* Generated mark */
.generated-mark {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 1rem;
    font-style: italic;
}
.combiner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.combined-empty {
    padding: 1rem 1.25rem;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 8px;
    text-align: center;
}

/* Result Cards */
.result-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.75rem;
    box-shadow: var(--shadow-soft);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.result-card:focus-within,
.result-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-hover);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.badge {
    background: #e7edf3;
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge.neutral {
    background: #f3f4f6;
}

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

/* Subject Rows */
.subject-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    align-items: center;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background: #fcfdff;
}

.form-control:focus {
    border-color: var(--secondary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(8, 126, 139, 0.15);
}

.btn-icon {
    background: none;
    border: 1px solid transparent;
    color: #6b7280;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 6px;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.btn-icon:hover {
    color: var(--error-color);
    border-color: var(--border);
}

.add-subject-btn {
    width: 100%;
    padding: 0.85rem;
    background: #f8fafc;
    border: 1px dashed var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
    margin-top: 1rem;
}

.add-subject-btn:hover {
    border-color: var(--secondary);
    color: var(--secondary);
}

/* Combine Action Section */
.action-section {
    text-align: center;
    margin: 2rem 0 1rem;
}

.combine-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.95rem 3rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.combine-btn:hover {
    background: #0f4668;
}

.combine-btn:active {
    transform: translateY(1px);
}

.combine-btn:focus-visible {
    outline: 3px solid rgba(11, 57, 84, 0.35);
    outline-offset: 2px;
}

/* Results Display */
.combined-result-section {
    display: none;
    margin-top: 2rem;
}

.combined-result-section.active {
    display: block;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
}


.result-table th {
    text-align: left;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0.5rem;
}

.result-table th:last-child {
    text-align: right;
}

.result-table td {
    padding: 0.9rem 0.5rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.result-table td:last-child {
    text-align: right;
}

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

.best-grade {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
}

.grade-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.grade-chip.selected {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.grade-chip.muted {
    background: #f2f4f7;
    color: var(--text-secondary);
}

.source-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--border);
}

.source-1 {
    background: #f0f5fa;
    color: #1d4d72;
}

.source-2 {
    background: #eefcf7;
    color: #0f6b4b;
}

/* Error Messages */
.error-message {
    background: #fffaf0;
    border: 1px solid rgba(214, 158, 46, 0.4);
    color: #7a4b11;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    display: none;
}

.error-message.visible {
    display: block;
}

/* Utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

@media (max-width: 768px) {
    .combiner-header {
        padding: 1.75rem;
    }

    .combiner-header h1 {
        font-size: 1.8rem;
    }

    .guidance-panel {
        flex-direction: column;
    }

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

    .btn-icon {
        justify-self: flex-start;
    }
}

@media (max-width: 640px) {
    .result-table {
        font-size: 0.9rem;
    }

    .result-table th,
    .result-table td {
        padding: 0.6rem 0.4rem;
    }

    .result-table td:first-child {
        font-weight: 600;
    }

    .grade-badge {
        font-size: 0.8rem;
        padding: 0.2rem 0.6rem;
    }
}
