﻿:root {
    --ueh-primary: #005f69;
    --ueh-secondary: #f26f33;
}

.hidden{
    display:none !important;
}

body {
    background-color: #f5f5f5;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.header-section {
    padding: 2rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.logo {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
}

.header-title {
    color: var(--ueh-primary);
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.header-subtitle {
    color: var(--ueh-primary);
    font-weight: 600;
    border-bottom: 2px solid var(--ueh-primary);
    display: inline-block;
    padding-bottom: 2px;
}

.main-title {
    color: var(--ueh-primary);
    font-weight: bold;
    margin: 1rem 0;
    text-align: center;
}

.card {
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.card-header {
    background-color: var(--ueh-primary);
    color: white;
    font-weight: bold;
    padding: 1rem 1.5rem;
    border-radius: 8px 8px 0 0 !important;
}

.card-body {
    padding: 2rem;
    background-color: white;
}

.form-label {
    font-weight: 600;
    color: var(--ueh-primary);
    margin-bottom: 0.5rem;
}

.required {
    color: #dc3545;
}

.form-control, .form-select {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

    .form-control:focus, .form-select:focus {
        border-color: var(--ueh-primary);
        box-shadow: 0 0 0 0.2rem rgba(0, 95, 105, 0.25);
    }

.grade-table {
    margin-top: 1rem;
}

    .grade-table th {
        background-color: var(--ueh-primary);
        color: white;
        text-align: center;
        font-weight: bold;
        border: 1px solid #ddd;
        padding: 0.75rem;
    }

    .grade-table td {
        text-align: center;
        vertical-align: middle;
        border: 1px solid #ddd;
        padding: 0.5rem;
    }

.d-thm {
    text-align: center;
    font-weight: bold;
    border: 1px solid #ddd;
}

.select2-container--default .select2-selection--single {
    height: 50px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

    .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 48px;
        padding-left: 12px;
        color: #495057;
    }

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--ueh-primary);
}

/* Styling cho thông báo lỗi */
.is-invalid {
    border-color: #dc3545 !important;
}

.invalid-feedback {
    display: block !important;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Các ô nhập căn giữa (ĐGNL, tổ hợp môn, học bạ) -> thông báo lỗi cũng căn giữa dưới ô */
.dgnl-score-box .invalid-feedback,
.subject-grid .invalid-feedback,
.hocba-table .invalid-feedback {
    text-align: center;
}

.is-valid {
    border-color: #28a745 !important;
}

/* Animation cho validation */
.form-control.is-invalid {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 20%, 40%, 60%, 80% {
        transform: translateX(0);
    }

    10%, 30%, 50%, 70% {
        transform: translateX(-5px);
    }

    90% {
        transform: translateX(5px);
    }

    100% {
        transform: translateX(0);
    }
}

@media (max-width: 768px) {
    .header-section {
        padding: 1rem 0;
    }

    .logo {
        width: 60px;
        height: 60px;
    }

    .card-body {
        padding: 1rem;
    }
}

.form-check {
    margin-bottom: 0.75rem;
}

.form-check-input {
    border: 2px solid #ddd;
    border-radius: 4px;
}

    .form-check-input:checked {
        background-color: var(--ueh-primary);
        border-color: var(--ueh-primary);
    }

    .form-check-input:focus {
        border-color: var(--ueh-secondary);
        box-shadow: 0 0 0 0.2rem rgba(242, 111, 51, 0.25);
    }

.form-check-label {
    color: #333;
    font-weight: 500;
    margin-left: 0.5rem;
}

.info-box {
    background-color: #e8f4f8;
    border-left: 4px solid #17a2b8;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 8px 8px 0;
}

    .info-box .fas {
        color: #17a2b8;
        margin-right: 0.5rem;
    }

.note-highlight {
    background-color: #fde8ef;
    border-left: 3px solid #e83e8c;
    padding: 0.5rem 0.75rem;
    border-radius: 0 6px 6px 0;
}

.link-box {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.5rem;
}

    .link-box a {
        color: var(--ueh-primary);
        text-decoration: none;
        font-weight: 600;
    }

        .link-box a:hover {
            color: var(--ueh-secondary);
            text-decoration: underline;
        }

.checkbox-group {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.checkbox-group-title {
    font-weight: bold;
    color: var(--ueh-primary);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.award-icon {
    color: var(--ueh-secondary);
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.specialized-school-section {
    border-top: 2px solid #e9ecef;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

.highlight-text {
    background: #ffd200;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }

    .checkbox-group {
        padding: 1rem;
    }

    .form-check-label {
        font-size: 0.9rem;
    }
}

/* CSS cần thêm vào file hsg-style.css */
.calculate-btn {
    background: var(--ueh-primary);
    border: none;
    color: white;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 95, 105, 0.3);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

    .calculate-btn:hover {
        background: #007b87;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 95, 105, 0.4);
        color: white;
    }

    .calculate-btn:active {
        transform: translateY(0);
    }

    .calculate-btn .fas {
        margin-right: 10px;
        animation: pulse 2s infinite;
    }

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.result-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid var(--ueh-primary);
    border-radius: 20px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 8px 25px rgba(0, 95, 105, 0.15);
    transform: translateY(20px);
    transition: all 0.5s ease;
}

    .result-section.show {
        opacity: 1;
        transform: translateY(0);
    }

.result-header {
    background: var(--ueh-primary);
    color: white;
    padding: 1rem 1.5rem;
    margin: -2rem -2rem 1.5rem -2rem;
    border-radius: 15px 15px 0 0;
    text-align: center;
    font-weight: bold;
    font-size: 1.3rem;
}

.score-breakdown {
    display: grid;
    gap: 1rem;
}

.score-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

    .score-item:hover {
        border-color: var(--ueh-secondary);
        box-shadow: 0 2px 8px rgba(242, 111, 51, 0.15);
    }

.score-label {
    font-weight: 600;
    color: #333;
    flex: 1;
}

.score-value {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--ueh-primary);
    min-width: 80px;
    text-align: right;
}

.score-item.total {
    background: linear-gradient(135deg, var(--ueh-primary) 0%, #007b87 100%);
    color: white;
    border: none;
    margin-top: 1.5rem;
    padding: 2rem 1.5rem;
    border-radius: 14px;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
}

.total-circle-badge {
    width: 140px;
    height: 140px;
    background: linear-gradient(135deg, #f26f33, #d9541a);
    border: 3px solid #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 0 20px rgba(242, 111, 51, 0.5), inset 0 0 15px rgba(0, 0, 0, 0.1);
    animation: totalPulseGlow 2s infinite alternate ease-in-out;
    z-index: 1;
}

    .total-circle-badge::before {
        content: '';
        position: absolute;
        top: -3px;
        right: -3px;
        bottom: -3px;
        left: -3px;
        border-radius: 50%;
        border: 2px solid rgba(242, 111, 51, 0.6);
        z-index: -1;
        animation: totalRippleRing 2s infinite ease-out;
    }

@keyframes totalPulseGlow {
    from {
        box-shadow: 0 0 20px rgba(242, 111, 51, 0.5), inset 0 0 15px rgba(0, 0, 0, 0.1);
    }

    to {
        box-shadow: 0 0 35px rgba(242, 111, 51, 0.85), inset 0 0 15px rgba(0, 0, 0, 0.1);
    }
}

@keyframes totalRippleRing {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.35);
        opacity: 0;
    }
}

    .score-item.total .score-label {
        font-size: 1.3rem;
        font-weight: 800;
        letter-spacing: 0.5px;
        color: white;
        text-align: center;
    }

    .score-item.total .score-note {
        color: rgba(255, 255, 255, 0.85);
        font-size: 0.85rem;
    }

    .total-circle-badge .score-value {
        font-size: 2.2rem;
        font-weight: 800;
        color: white;
        min-width: 0;
        text-align: center;
    }

.score-icon {
    margin-right: 10px;
    color: var(--ueh-secondary);
    width: 20px;
}

.score-item.bonus {
    border-left: 4px solid var(--ueh-secondary);
}

    .score-item.bonus .score-value {
        color: var(--ueh-secondary);
    }

.score-note {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 400;
}

.calculation-steps {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #6c757d;
}

    .calculation-steps h6 {
        color: var(--ueh-primary);
        margin-bottom: 0.5rem;
    }

.warning-box {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

    .warning-box .fas {
        color: #ffc107;
        margin-right: 0.5rem;
    }

/* Loading animation */
.loading {
    display: none;
    text-align: center;
    margin: 1rem 0;
}

    .loading.show {
        display: block;
    }

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--ueh-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .calculate-btn {
        padding: 12px 30px;
        font-size: 1rem;
    }

    .result-section {
        padding: 1rem;
    }

    .result-header {
        margin: -1rem -1rem 1rem -1rem;
        font-size: 1.1rem;
    }

    .score-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .score-value {
        text-align: left;
        min-width: auto;
    }

    .score-item.total {
        align-items: center;
    }

    .total-circle-badge {
        width: 110px;
        height: 110px;
    }

        .total-circle-badge .score-value {
            text-align: center;
            min-width: 0;
            font-size: 1.8rem;
        }
}

<!-- CSS bổ sung cho styling -->
.form-select optgroup {
    font-weight: bold;
    font-size: 0.95em;
    background-color: #f8f9fa;
    color: var(--ueh-primary);
}

.form-select option {
    padding: 8px 12px;
    font-weight: normal;
}

.form-select optgroup option {
    padding-left: 20px;
    background-color: white;
    color: #333;
}

.form-select:focus optgroup {
    background-color: #e3f2fd;
}

/* Highlight cho chứng chỉ được chọn */
#ccta.selected {
    border-color: var(--ueh-secondary);
    background-color: #fff5f0;
}

.spinner-layout {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(53, 58, 57, 0.5);
    z-index: 2000;
}

    .spinner-layout .spinner-box {
        width: 500px;
        margin: 0 auto;
        position: relative;
        top: 40%;
    }

        .spinner-layout .spinner-box > img {
            width: 130px;
            position: relative;
            left: 50%;
            transform: translateX(-50%);
            height: 130px;
        }

        .spinner-layout .spinner-box > h2 {
            font-size: 25px;
            color: #fff;
            text-align: center;
            margin-top: 15px;
            font-weight: 400;
        }

.sweetalert2-success-title {
    font-size: 24px;
}


.multiplier-group {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
}

.multiplier-option {
    background-color: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

    .multiplier-option:hover {
        border-color: var(--ueh-secondary);
        box-shadow: 0 2px 4px rgba(242, 111, 51, 0.1);
    }

    .multiplier-option .form-check-input:checked + .form-check-label {
        color: var(--ueh-primary);
        font-weight: bold;
    }

    .multiplier-option .form-check-input:checked ~ * {
        border-color: var(--ueh-primary);
    }

.form-check-input:checked {
    background-color: var(--ueh-primary);
    border-color: var(--ueh-primary);
}

.form-check-label {
    cursor: pointer;
    width: 100%;
}

    .form-check-label small {
        font-size: 0.8rem;
        margin-top: 0.25rem;
    }

    .form-check-label i {
        margin-right: 0.5rem;
        color: var(--ueh-secondary);
    }

.badge {
    font-size: 0.9rem;
    padding: 0.5rem 0.8rem;
}

    .badge.bg-success {
        background-color: #28a745 !important;
    }

    .badge.bg-warning {
        background-color: #ffc107 !important;
        color: #212529 !important;
    }

.alert-warning {
    border-left: 4px solid #ffc107;
}

.d-thpt {
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    border: 2px solid #ddd;
    transition: all 0.3s ease;
}

    .d-thpt:focus {
        border-color: var(--ueh-primary);
        box-shadow: 0 0 0 0.2rem rgba(0, 95, 105, 0.25);
        background-color: #f8fffe;
    }

    .d-thpt.is-valid {
        border-color: #28a745;
        background-color: #f8fff9;
    }

    .d-thpt.is-invalid {
        border-color: #dc3545;
        background-color: #fff8f8;
        animation: shake 0.5s ease-in-out;
    }

.input-group-text {
    background-color: var(--ueh-primary);
    color: white;
    border: none;
    font-weight: bold;
}

.grade-table th {
    background-color: var(--ueh-primary);
    color: white;
    text-align: center;
    font-weight: bold;
    border: 1px solid #ddd;
    padding: 0.75rem;
}

.grade-table td {
    vertical-align: middle;
    border: 1px solid #ddd;
    padding: 0.75rem;
}

.table-warning td {
    background-color: #fff3cd !important;
    border-color: #ffeaa7 !important;
}

#total_thpt_score {
    color: var(--ueh-primary) !important;
    font-size: 1.5rem !important;
}

@keyframes shake {
    0%, 20%, 40%, 60%, 80% {
        transform: translateX(0);
    }

    10%, 30%, 50%, 70% {
        transform: translateX(-5px);
    }

    90% {
        transform: translateX(5px);
    }

    100% {
        transform: translateX(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .multiplier-option {
        margin-bottom: 1rem;
    }

    .input-group-text {
        font-size: 0.875rem;
    }

    .d-thpt {
        font-size: 0.9rem;
    }

    #total_thpt_score {
        font-size: 1.2rem !important;
    }
}

/* Subject grid - bảng nhập điểm 3 môn (3 cột ngang) */
.subject-grid {
    border: 1px solid #dee2e6;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.subject-col {
    padding: 1.25rem 1rem;
    background: #fff;
    border-right: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    text-align: center;
    transition: background 0.15s ease;
}

.subject-col:hover {
    background: #f8fffe;
}

.subject-col-last {
    border-right: none;
}

.subject-col-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.subject-num {
    width: 28px;
    height: 28px;
    background: var(--ueh-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    flex-shrink: 0;
}

.subject-name {
    font-weight: 600;
    color: #333;
}

.subject-grade-label {
    display: block;
    text-align: center;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}

.hocba-table thead th {
    text-align: center;
    font-weight: 600;
    color: var(--ueh-primary);
    background-color: #f0f7f8;
    font-size: 0.95rem;
    padding: 0.65rem 1rem;
    white-space: nowrap;
}

.hocba-table tbody td {
    text-align: center;
    vertical-align: middle;
    padding: 0.75rem 1rem;
}

.hocba-table .subject-col-input {
    justify-content: center;
}

.hocba-table .subject-col-input input {
    max-width: 120px;
}

@media (max-width: 575.98px) {
    .hocba-table {
        min-width: 420px;
    }
}

.subject-col-input {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.d-thpt {
    width: 135px;
    text-align: center;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    padding: 0.45rem 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.d-thpt:focus {
    border-color: var(--ueh-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 95, 105, 0.15);
    background: #f8fffe;
    outline: none;
}

.subject-suffix {
    color: #6c757d;
    font-size: 0.85rem;
    white-space: nowrap;
}

.subject-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.25rem;
    background: linear-gradient(135deg, #fff8e1, #fff3cd);
    border-top: 2px solid #ffc107;
}

.subject-total-label {
    font-weight: 700;
    color: var(--ueh-primary);
    font-size: 0.9rem;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.subject-total-label .fas {
    color: var(--ueh-secondary);
}

.subject-total-value {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

#total_thpt_score {
    font-size: 1.8rem !important;
    font-weight: 800 !important;
    color: var(--ueh-primary) !important;
    line-height: 1;
}

.subject-total-value small {
    color: #6c757d;
    font-size: 0.85rem;
}

@media (max-width: 767px) {
    .subject-col {
        border-right: none;
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }

    .subject-col-header {
        flex: 1;
    }

    .subject-col-input {
        flex: 0 0 auto;
    }

    #total_thpt_score {
        font-size: 1.4rem !important;
    }
}

/* ĐGNL score box */
.dgnl-score-box {
    border: 1px solid #dee2e6;
    border-radius: 10px;
    overflow: hidden;
}

.dgnl-score-label {
    background: var(--ueh-primary);
    color: white;
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.dgnl-score-label .fas {
    color: #a8d5da;
}

.dgnl-score-input {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.75rem 1.25rem 1.25rem;
    background: #fff;
}

/* Spacer ẩn cân bằng với hậu tố "/ 1200 điểm" bên phải để INPUT thực sự nằm
   chính giữa khung -> thông báo lỗi canh giữa sẽ nằm đúng dưới ô input */
.dgnl-score-input::before {
    content: "/ 1200 điểm";
    font-size: 1rem;
    white-space: nowrap;
    visibility: hidden;
}

.dgnl-score-input .form-control {
    width: 200px;
    text-align: center;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--ueh-primary);
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 0.5rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    -moz-appearance: textfield;
}

.dgnl-score-input .form-control::-webkit-outer-spin-button,
.dgnl-score-input .form-control::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.dgnl-score-input .form-control:focus {
    border-color: var(--ueh-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 95, 105, 0.15);
}

.dgnl-score-input .form-control.is-invalid {
    border-color: #dc3545;
    /* Bỏ icon "!" mặc định của Bootstrap để số "0" vẫn nằm chính giữa ô */
    background-image: none;
    padding-right: 0.5rem;
}

.dgnl-suffix {
    font-size: 1rem;
    color: #6c757d;
    white-space: nowrap;
}


@media (max-width: 576px) {
    .dgnl-score-input .form-control {
        width: 150px;
        font-size: 1.6rem;
    }
}