/* === BLAZOR ERROR UI === */
#blazor-error-ui {
    display: none;
}

/* === RESET & BASE === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: 'Arial', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #F0F4F8;
    color: #1A2332;
    font-size: 16px;
    line-height: 1.6;
}

/* === LAYOUT === */
.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-main {
    flex: 1;
    padding: 2rem 1rem;
}

.app-footer {
    text-align: center;
    padding: 1.5rem;
    color: #64748B;
    font-size: 0.85rem;
    border-top: 1px solid #E2E8F0;
}

/* === HEADER === */
.app-header {
    background: #262262;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.brand {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.brand-logo {
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1);
}

.nav-link {
    color: #94A3B8;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    transition: all 0.2s;
}

    .nav-link:hover {
        background: rgba(255,255,255,0.1);
        color: #fff;
    }

/* === CARDS === */
.card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    padding: 2.5rem;
    margin-bottom: 0;
    overflow: hidden;
}

.question-card {
    padding: 1.5rem 2rem;
}

.assessment-container {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 6rem);
    justify-content: center;
}

.admin-container {
    max-width: 960px;
    margin: 0 auto;
}

/* === ENTRY === */
.entry-header {
    text-align: center;
    margin-bottom: 2rem;
}

.entry-logo {
    width: 60%;
    max-width: 220px;
    height: auto;
    margin-bottom: 1rem;
}

.entry-header h1 {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #1A2332;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #64748B;
    font-size: 0.95rem;
}

/* === FORMS === */
.form-group {
    margin-bottom: 1.25rem;
}

    .form-group label {
        display: block;
        font-weight: 500;
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
        color: #374151;
    }

.hint {
    font-weight: 400;
    color: #9CA3AF;
    font-size: 0.82rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #FAFAFA;
    color: #1A2332;
}

    .form-input:focus {
        outline: none;
        border-color: #03A687;
        box-shadow: 0 0 0 3px rgba(3,166,135,0.15);
        background: #fff;
    }

.field-error {
    color: #DC2626;
    font-size: 0.82rem;
    margin-top: 0.3rem;
    display: block;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

    .btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.btn-full {
    width: 100%;
    margin-top: 0.5rem;
}

.btn-primary {
    background: #262262;
    color: #fff;
}

    .btn-primary:hover:not(:disabled) {
        background: #1A1845;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(38,34,98,0.3);
    }

.btn-secondary {
    background: #F1F5F9;
    color: #374151;
    border: 2px solid #E2E8F0;
}

    .btn-secondary:hover:not(:disabled) {
        background: #E2E8F0;
    }

.btn-success {
    background: #16A34A;
    color: #fff;
}

    .btn-success:hover:not(:disabled) {
        background: #15803D;
        transform: translateY(-1px);
    }

.btn-danger {
    background: #FEE2E2;
    color: #DC2626;
}

    .btn-danger:hover {
        background: #FECACA;
    }

.btn-sm {
    padding: 0.35rem 0.8rem;
    font-size: 0.82rem;
    border-radius: 6px;
}

/* === PROGRESS === */
.progress-bar-wrap {
    height: 6px;
    background: #E2E8F0;
    border-radius: 99px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #262262, #03A687);
    border-radius: 99px;
    transition: width 0.4s ease;
}

.progress-label {
    font-size: 0.82rem;
    color: #94A3B8;
    text-align: right;
    margin-bottom: 0.75rem;
}

/* === QUESTIONS === */
.question-text {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1A2332;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.q-num {
    color: #03A687;
    margin-right: 0.4rem;
}

.answers {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.answer-btn {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    background: #F8FAFC;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: 0.9rem;
    color: #374151;
    transition: all 0.2s;
    line-height: 1.4;
}

    .answer-btn:hover {
        border-color: #03A687;
        background: #E8F7F4;
    }

    .answer-btn.selected {
        border-color: #262262;
        background: #EDEBF7;
        color: #1A2332;
    }

        .answer-btn.selected .answer-letter {
            background: #262262;
            color: #fff;
        }

.answer-letter {
    min-width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.8rem;
    background: #E2E8F0;
    color: #374151;
    flex-shrink: 0;
    transition: all 0.2s;
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

    .nav-buttons .btn {
        flex: 1;
    }

.unanswered-hint {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #D97706;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

/* === RESULTS === */
.results-card {
    text-align: center;
}

.result-header {
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #F1F5F9;
}

.result-emoji {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.result-header h2 {
    font-size: 1.1rem;
    color: #64748B;
    font-weight: 400;
    margin-bottom: 0.75rem;
}

.style-badge {
    display: inline-block;
    color: #fff;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 2.2rem;
    font-weight: 900;
    padding: 0.5rem 1.5rem;
    border-radius: 12px;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
}

.style-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.style-desc {
    color: #64748B;
    font-size: 0.93rem;
    max-width: 440px;
    margin: 0 auto;
}

.scores-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border-radius: 12px;
    background: #F8FAFC;
}

.score-letter {
    font-size: 1.4rem;
    font-weight: 800;
}

.score-val {
    font-size: 1.8rem;
    font-weight: 700;
}

.score-lbl {
    font-size: 0.72rem;
    color: #94A3B8;
    text-align: center;
}

.t-color .score-letter, .t-color .score-val {
    color: #262262;
}

.e-color .score-letter, .e-color .score-val {
    color: #03A687;
}

.a-color .score-letter, .a-color .score-val {
    color: #BE1E2D;
}

.m-color .score-letter, .m-color .score-val {
    color: #F26522;
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.result-note {
    font-size: 0.85rem;
    color: #64748B;
    background: #F8FAFC;
    border-radius: 10px;
    padding: 1rem;
}

/* === PDF PAGE === */
.pdf-page h2 {
    margin-bottom: 0.5rem;
}

.style-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.style-card-link {
    text-decoration: none;
}

.style-card-link:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.style-mini-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1rem;
    background: #F8FAFC;
    border-radius: 10px;
    border-left-width: 5px;
    border-left-style: solid;
    transition: all 0.2s;
    cursor: pointer;
}

    .style-mini-card:hover {
        background: #EDEBF7;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }

.style-code {
    font-weight: 800;
    font-size: 1.1rem;
    min-width: 3rem;
}

.style-title {
    flex: 1;
    font-weight: 500;
    font-size: 0.9rem;
    color: #374151;
}

.style-arrow {
    font-size: 0.8rem;
    color: #94A3B8;
}

.back-link {
    margin-top: 1.5rem;
}

/* === ALERTS === */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.88rem;
    margin-top: 0.75rem;
}

.alert-error {
    background: #FEE2E2;
    color: #DC2626;
    border: 1px solid #FECACA;
}

.alert-success {
    background: #DCFCE7;
    color: #16A34A;
    border: 1px solid #BBF7D0;
}

/* === SPINNER === */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    display: inline-block;
    animation: spin 0.7s linear infinite;
}

    .spinner.white {
        border-color: rgba(255,255,255,0.3);
        border-top-color: #fff;
    }

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* === ADMIN === */
.admin-header {
    margin-bottom: 2rem;
}

    .admin-header h1 {
        font-family: 'Josefin Sans', sans-serif;
        font-size: 1.8rem;
        font-weight: 700;
    }

    .admin-header p {
        color: #64748B;
    }

.admin-section h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.create-code-form {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

    .create-code-form .form-input {
        flex: 1;
        min-width: 140px;
    }

    .create-code-form .btn {
        white-space: nowrap;
    }

.results-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

    .results-header-row h2 {
        margin-bottom: 0;
    }

.filter-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.select-input {
    width: auto;
    min-width: 140px;
    padding: 0.5rem 0.75rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

    .data-table th {
        background: #F1F5F9;
        padding: 0.75rem 1rem;
        text-align: left;
        font-weight: 600;
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: #64748B;
        border-bottom: 2px solid #E2E8F0;
    }

    .data-table td {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #F1F5F9;
        vertical-align: middle;
    }

    .data-table tr:last-child td {
        border-bottom: none;
    }

    .data-table tr:hover td {
        background: #FAFAFA;
    }

.table-scroll {
    overflow-x: auto;
}

.results-count {
    font-size: 0.82rem;
    color: #94A3B8;
    margin-top: 0.75rem;
    text-align: right;
}

.style-tag {
    display: inline-block;
    color: #fff;
    font-weight: 700;
    font-size: 0.78rem;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    letter-spacing: 0.05em;
}

.answers-cell {
    font-size: 0.78rem;
    color: #94A3B8;
    font-family: monospace;
}

.empty-state {
    color: #94A3B8;
    text-align: center;
    padding: 2rem;
    font-style: italic;
}

.loading {
    color: #94A3B8;
    padding: 1rem;
    text-align: center;
}

.not-found {
    text-align: center;
    padding: 4rem;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
    .card {
        padding: 1.5rem;
        border-radius: 12px;
    }

    .app-main {
        padding: 1rem 0.75rem;
    }

    .entry-logo {
        width: 50%;
        max-width: 140px;
    }

    .entry-header {
        margin-bottom: 1rem;
    }

    .entry-header h1 {
        font-size: 1.2rem;
    }

    .scores-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .result-actions {
        flex-direction: column;
    }

    .nav-buttons {
        flex-direction: column-reverse;
    }

    .create-code-form {
        flex-direction: column;
    }

    .results-header-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* === AUTH / LOGIN === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-card {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

    .modal-card h3 {
        font-size: 1.1rem;
        margin-bottom: 1.25rem;
    }

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

/* === TABS === */
.tab-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #E2E8F0;
    padding-bottom: 0;
}

.tab-btn {
    padding: 0.6rem 1.25rem;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    color: #64748B;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    border-radius: 6px 6px 0 0;
    transition: all 0.2s;
}

    .tab-btn:hover {
        color: #262262;
        background: #F1F5F9;
    }

    .tab-btn.active {
        color: #262262;
        border-bottom-color: #262262;
        font-weight: 600;
    }

/* === BADGES === */
.badge {
    display: inline-block;
    background: #F1F5F9;
    color: #64748B;
    border-radius: 99px;
    padding: 0.2rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 500;
}

.badge-blue {
    background: #EDEBF7;
    color: #262262;
}

/* === ANSWER DETAIL === */
.answer-detail-grid {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 1rem;
    background: #F8FAFC;
    border-radius: 10px;
}

.answer-detail-row {
    display: grid;
    grid-template-columns: 2.5rem 2rem 1fr 2rem;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.aq-num {
    color: #94A3B8;
    font-weight: 600;
    font-size: 0.78rem;
}

.aq-letter {
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.82rem;
    background: #E2E8F0;
    color: #374151;
}

.aq-text {
    color: #374151;
}

.aq-style {
    font-weight: 800;
    font-size: 0.9rem;
    text-align: center;
}

.style-t .aq-letter, .style-t {
    color: #262262;
}

.style-e .aq-letter, .style-e {
    color: #03A687;
}

.style-a .aq-letter, .style-a {
    color: #BE1E2D;
}

.style-m .aq-letter, .style-m {
    color: #F26522;
}

.detail-row td {
    background: #F8FAFC;
    padding: 0.5rem 1rem;
}

/* === ACTION CELL === */
.action-cell {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.select-input-sm {
    width: auto;
    min-width: 130px;
    padding: 0.35rem 0.6rem;
    font-size: 0.82rem;
    border-radius: 6px;
}

/* === PROFESSOR SUMMARY STRIP === */
.summary-strip {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1rem 0 0.5rem;
}

.summary-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #F8FAFC;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    min-width: 90px;
}

.sum-val {
    font-size: 1.8rem;
    font-weight: 800;
    color: #1A2332;
}

.sum-lbl {
    font-size: 0.75rem;
    color: #94A3B8;
    text-align: center;
}

.style-name-small {
    font-size: 0.75rem;
    color: #64748B;
    margin-left: 0.4rem;
}

/* === LOGIN PAGE === */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F0F4F8;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

.login-card .logo {
    text-align: center;
    margin-bottom: 0.5rem;
}

.login-logo {
    max-width: 180px;
    height: auto;
}

.login-card h2 {
    text-align: center;
    font-size: 1.1rem;
    color: #64748B;
    font-weight: 400;
    margin-bottom: 2rem;
}

.login-card .form-group {
    margin-bottom: 1.25rem;
}

.login-card label {
    display: block;
    font-size: 0.88rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.4rem;
}

.form-input-login {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background: #FAFAFA;
    color: #1A2332;
    transition: border-color 0.2s;
}

.form-input-login:focus {
    outline: none;
    border-color: #03A687;
    background: #fff;
}

.btn-login {
    width: 100%;
    padding: 0.85rem;
    background: #262262;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background 0.2s;
}

.btn-login:hover {
    background: #1A1845;
}

.login-card .error {
    background: #FEE2E2;
    color: #DC2626;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.88rem;
    margin-bottom: 1rem;
}

.login-card .back-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.88rem;
}

.login-card .back-link a {
    color: #03A687;
    text-decoration: none;
}

/* === CONFIRM DELETE === */
.confirm-delete {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #DC2626;
}
