/* Reset và base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
    /* Prevent horizontal scroll caused by elements using 100vw or shadows */
    overflow-x: hidden;
}

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

/* Brand color variables: use chat box gradient + avatar (bot) orange as primary palette */
:root {
    /* chat box gradient (teal -> blue) */
    --brand-chat-start: #11c6d3;
    /* same as includes/chat_bubble.php --chat-start */
    --brand-chat-end: #2f8df7;
    /* same as includes/chat_bubble.php --chat-end */

    /* avatar / bot orange palette (used as complementary brand color) */
    --brand-avt-start: #ff9a1c;
    /* gradient start */
    --brand-avt-end: #ff7a00;
    /* gradient end */
    --brand-avt: #c87400;
    /* solid orange used across components */
    --brand-avt-dark: #a85f00;
    /* darker orange for hovers/accents */
}

/* Header */
.header {
    position: relative;
    overflow: hidden;
    box-shadow: none;
    margin: 0;
    padding: 0;
    border: none;
}

.header-banner {
    position: relative;
    width: 100%;
    height: 350px;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border: none;
    display: block;
}

.banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(78, 78, 78, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-overlay .container {
    text-align: center;
    color: rgb(255, 255, 255);
    z-index: 2;
}

.header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7), 0 0 10px rgba(0, 0, 0, 0.5);
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.3);
    animation: fadeInDown 0.8s ease-out;
}

.header p {
    font-size: 1.3rem;
    opacity: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7), 0 0 8px rgba(0, 0, 0, 0.5);
    -webkit-text-stroke: 0.5px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Navigation */
.nav {
    background: white;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 0;
    position: relative;
    z-index: 100;
}

/* Default layout for nav links (desktop) - allow JS to toggle on mobile */
.nav-links {
    display: flex;
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    flex: 1 1 auto;
    justify-content: flex-end;
}

/* Mobile nav toggle button */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    padding: 6px 10px;
    cursor: pointer;
}

/* nav container layout - keep logo to left and links to right, no wrapping */
.nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-left: 20px;
    /* keep same internal padding as .container by default */
}

.nav ul {
    list-style: none;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin: 0;
    padding: 0;
    flex: 1 1 auto;
    align-items: center;
    flex-wrap: nowrap;
    /* prevent wrapping into 2 rows */
    white-space: nowrap;
    /* ensure anchors won't wrap onto next line */
}

.nav a {
    display: block;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    padding: 1rem 1.25rem;
    /* make links smaller so they fit on one line */
    border-radius: 0;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav a:hover {
    background: #fff8f0;
    color: var(--brand-avt);
    border-bottom-color: var(--brand-avt);
}

/* Give the logo (brand) a safe left alignment and reduce image size slightly for good fit */
.nav .nav-brand {
    display: inline-flex;
    align-items: center;
    margin-right: 16px;
    margin-left: 0;
    /* ensure brand sits at left inside the container */
}

.nav .nav-brand img {
    height: 56px !important;
    max-height: 56px !important;
}

.nav .nav-brand .site-logo {
    margin-right: 12px;
    display: block;
}

/* Site logo helpers */
.site-logo {
    display: block;
    height: auto;
    width: auto;
    max-width: 220px;
    object-fit: contain;
}

.site-logo--header {
    max-height: 64px;
}

.site-logo--footer {
    max-height: 96px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    border-radius: 8px;
}

.site-logo--hero {
    max-height: 140px;
}

@media (max-width: 768px) {
    .site-logo--header {
        max-height: 40px;
    }

    .site-logo--footer {
        max-height: 64px;
    }

    .site-logo--hero {
        max-height: 80px;
    }
}

@media (min-width: 1200px) {
    .site-logo--header {
        max-height: 72px;
    }
}

/* Media queries: let items compress on smaller screens but still avoid wrapping until very small */
@media (max-width: 1200px) {
    .nav a {
        padding: 0.9rem 0.9rem;
    }
}

@media (max-width: 900px) {

    /* Allow nav to wrap for mobile while keeping logo at left */
    .nav ul {
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .nav a {
        padding: 12px 10px;
    }

    /* hide desktop nav and show hamburger */
    .mobile-nav-toggle {
        display: inline-block;
        z-index: 220;
    }

    .nav .nav-brand {
        flex: 0 0 auto;
    }

    .nav-links {
        display: none !important;
        position: absolute;
        top: calc(100% + 8px);
        right: 10px;
        left: 10px;
        background: white;
        flex-direction: column;
        gap: 6px;
        padding: 12px;
        border-radius: 8px;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
        z-index: 200;
    }

    .nav-links.open {
        display: flex !important;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links li a {
        display: block;
        padding: 12px 14px;
        border-radius: 6px;
    }
}

/* When nav is open, prevent body scrolling (useful for mobile) */
.nav-links.open+* {}

html.nav-open {
    overflow: hidden;
}

/* Search Section */
.search-section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.search-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select {
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #0891b2;
}

.btn {
    padding: 0.75rem 1.5rem;
    background: #0891b2;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    background: #0e7490;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
}

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

/* University Grid */
.university-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.university-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.university-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.university-header {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.university-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.university-code {
    font-size: 0.9rem;
    opacity: 0.8;
}

.university-body {
    padding: 1.5rem;
}

.university-info {
    margin-bottom: 1rem;
}

.info-item {
    display: flex;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.info-label {
    font-weight: 500;
    min-width: 80px;
    color: #666;
}

.info-value {
    color: #333;
}

.university-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

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

.stat-number {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0891b2;
}

.stat-label {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.25rem;
}

/* Major List */
.major-list {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.major-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s ease;
}

.major-item:hover {
    background: #f8f9fa;
}

.major-item:last-child {
    border-bottom: none;
}

.major-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.major-name {
    font-weight: 600;
    color: #333;
}

.major-code {
    background: #0891b2;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
}

.major-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    font-size: 0.9rem;
    color: #666;
}

/* Score Table */
.score-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.score-table th,
.score-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.score-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
}

.score-table tr:hover {
    background: #f8f9fa;
}

.score-high {
    color: #dc3545;
    font-weight: 600;
}

.score-medium {
    color: #ffc107;
    font-weight: 600;
}

.score-low {
    color: #28a745;
    font-weight: 600;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: #0891b2;
    color: white;
    border-color: #0891b2;
}

.pagination .current {
    background: #0891b2;
    color: white;
    border-color: #0891b2;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #0f3366 0%, #143f7a 100%);
    color: white;
    text-align: center;
    padding: 2rem 0 0 0;
    /* keep bottom part minimal, main content moved to .footer-large */
    margin-top: 3rem;
}

/* Large footer layout similar to the sample image */
.footer-large {
    /* Trải nền full viewport (không bị giới hạn bởi .container bên ngoài) */
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;

    background: linear-gradient(135deg, #0a2a60 0%, #0f3b7a 100%);
    color: white;
    padding: 40px 0;
    /* padding theo trục dọc; padding ngang xử lý bên trong .container */
}

.footer-large .container {
    /* Giữ nội dung ở giữa và tăng khoảng cách trái/phải để 2 cột ngoài không sát mép */
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 48px;
    /* tăng khoảng cách trái/phải ở các màn hình lớn */
    box-sizing: border-box;
}

.footer-large .footer-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 40px;
    align-items: start;
}

.footer-left {
    color: #fff;
}

.footer-left .logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.site-logo--footer {
    height: auto;
    max-height: 96px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    border-radius: 8px;
}

.footer-left .contact {
    margin-top: 18px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.7;
}

.map-box {
    margin-top: 18px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    width: 320px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.footer-right {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.branch-block h5 {
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 12px;
    font-size: 1rem;
    font-weight: 700;
}

.branch-item {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
}

.btn-map {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-map:hover {
    background: rgba(255, 255, 255, 0.12);
}

.footer-bottom-bar {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
}

.visit-stats {
    display: flex;
    gap: 24px;
    align-items: center;
    color: rgba(255, 255, 255, 0.9);
}

.visit-stats .stat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.visit-stats .stat .value {
    font-weight: 700;
    color: #fff;
}

/* Responsive improvements */
@media (max-width: 992px) {
    .footer-large .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-right {
        grid-template-columns: repeat(2, 1fr);
    }

    .map-box {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .footer-right {
        grid-template-columns: 1fr;
    }

    .map-box {
        height: 200px;
    }

    .visit-stats {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .search-form {
        grid-template-columns: 1fr;
    }

    .university-grid {
        grid-template-columns: 1fr;
    }

    .university-stats {
        grid-template-columns: 1fr;
    }

    .major-info {
        grid-template-columns: 1fr;
    }

    .nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

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

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

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

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ===== SEARCH PAGES STYLES ===== */

/* Search Container */
.search-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 30px;
    margin-bottom: 0;
}

/* Search Tabs */
.search-tabs {
    display: flex;
    gap: 0;
    background: white;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    box-shadow: none;
    margin-bottom: 0;
    margin: -30px -30px 30px -30px;
}

.search-tab {
    flex: 1;
    padding: 18px 24px;
    text-align: center;
    text-decoration: none;
    color: #666;
    font-weight: 600;
    font-size: 1rem;
    background: #f8f9fa;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.search-tab:hover {
    background: #e9ecef;
    color: #333;
}

.search-tab.active {
    background: white;
    color: var(--brand-avt);
    border-bottom-color: var(--brand-avt);
}

/* Search Form */
.search-form {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
}

.search-input-wrapper {
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.1rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--brand-avt);
    box-shadow: 0 0 0 3px rgba(200, 116, 0, 0.08);
}

/* New Layout: Row 1 - Tỉnh | Hình thức | Năm */
.filters-row-top {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 15px;
    width: 100%;
}

/* New Layout: Row 2 - Search input | Button | Min - Max */
.filters-row-bottom {
    display: grid;
    grid-template-columns: 2fr auto auto 40px auto;
    gap: 12px;
    align-items: center;
    width: 100%;
}

.search-input-inline {
    padding: 14px 16px;
    font-size: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
    width: 100%;
}

.search-input-inline:focus {
    outline: none;
    border-color: var(--brand-avt);
    box-shadow: 0 0 0 3px rgba(200, 116, 0, 0.08);
}

.score-input {
    padding: 14px 12px;
    font-size: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    width: 80px;
    text-align: center;
    transition: all 0.3s ease;
}

.score-input:focus {
    outline: none;
    border-color: var(--brand-avt);
    box-shadow: 0 0 0 3px rgba(200, 116, 0, 0.08);
}

.score-separator {
    font-weight: 600;
    color: #666;
    text-align: center;
}

/* Old filters-row - keeping for backward compatibility */
.filters-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
}

.filter-select {
    padding: 14px 16px;
    font-size: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    width: 100%;
}

.filter-select:hover {
    border-color: var(--brand-avt);
    background: #fff8f0;
}

.filter-select:focus {
    outline: none;
    border-color: var(--brand-avt);
    box-shadow: 0 0 0 3px rgba(200, 116, 0, 0.08);
}

.search-button {
    padding: 14px 40px;
    background: linear-gradient(135deg, var(--brand-avt-start) 0%, var(--brand-avt-end) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(200, 116, 0, 0.18);
}

.search-button:hover {
    background: linear-gradient(135deg, var(--brand-avt-dark) 0%, var(--brand-avt-end) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(200, 116, 0, 0.22);
}

.search-button:active {
    transform: translateY(0);
}

.search-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Province Pills */
.province-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.province-pill {
    padding: 8px 16px;
    background: #f8f9fa;
    color: #666;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.province-pill:hover {
    background: #e9ecef;
    color: #333;
}

.province-pill.active {
    background: var(--brand-avt);
    color: white;
    border-color: var(--brand-avt);
}

/* Score Range Slider */
.score-range-container {
    margin: 20px 0;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    border: 2px solid #e9ecef;
}

.score-range-label {
    display: block;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.1rem;
    text-align: center;
}

#minScoreDisplay,
#maxScoreDisplay {
    color: var(--brand-avt);
    font-size: 1.4rem;
    font-weight: 700;
    padding: 2px 8px;
    background: rgba(200, 116, 0, 0.08);
    border-radius: 6px;
}

/* Modern Range Slider */
.range-slider-wrapper {
    position: relative;
    padding: 15px 0;
}

.range-input {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 10px;
    background: #ddd;
    border-radius: 5px;
    outline: none;
    padding: 0;
    margin: 0;
}

/* Chrome, Safari, Edge */
.range-input::-webkit-slider-runnable-track {
    width: 100%;
    height: 10px;
    background: linear-gradient(to right, #27ae60, #f39c12, #e74c3c);
    border-radius: 5px;
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: white;
    border: 4px solid var(--brand-avt);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.range-input::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(200, 116, 0, 0.32);
}

.range-input::-webkit-slider-thumb:active {
    transform: scale(1.1);
    cursor: grabbing;
}

/* Firefox */
.range-input::-moz-range-track {
    width: 100%;
    height: 10px;
    background: linear-gradient(to right, #27ae60, #f39c12, #e74c3c);
    border-radius: 5px;
    border: none;
}

.range-input::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: white;
    border: 4px solid var(--brand-avt);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.range-input::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(200, 116, 0, 0.32);
}

.range-input::-moz-range-thumb:active {
    transform: scale(1.1);
    cursor: grabbing;
}

.score-range-bar {
    height: 10px;
    background: linear-gradient(to right, #27ae60, #f39c12, #e74c3c);
    border-radius: 5px;
    position: relative;
    margin-bottom: 10px;
}

.score-range-fill {
    position: absolute;
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 5px;
    transition: all 0.3s ease;
    border: 2px solid white;
}

/* Results Summary */
.results-summary {
    background: white;
    padding: 16px 0;
    border-radius: 0;
    margin-bottom: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    box-shadow: none;
    font-size: 1.05rem;
    color: #666;
}

.results-summary strong {
    color: var(--brand-avt);
    font-size: 1.2rem;
}

/* Result Cards */
.result-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.result-card:hover {
    box-shadow: 0 4px 16px rgba(200, 116, 0, 0.12);
    transform: translateY(-2px);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.result-major {
    flex: 1;
}

.result-major-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.result-university {
    color: #666;
    font-size: 0.95rem;
}

.result-score {
    text-align: center;
    min-width: 100px;
}

.result-score-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--brand-avt);
}

.result-score-label {
    font-size: 0.85rem;
    color: #999;
    margin-top: 4px;
}

.result-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.result-detail-item {
    font-size: 0.9rem;
    color: #555;
}

.result-detail-label {
    font-weight: 600;
    color: #666;
    margin-right: 6px;
}

.result-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.result-btn {
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.result-btn-primary {
    /* Màu chính: avatar (orange) gradient */
    background: linear-gradient(135deg, var(--brand-avt-start) 0%, var(--brand-avt-end) 100%);
    color: white;
}

.result-btn-primary:hover {
    background: linear-gradient(135deg, var(--brand-avt-dark) 0%, var(--brand-avt-end) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 122, 0, 0.22);
}

.result-btn-secondary {
    background: white;
    color: var(--brand-avt);
    border: 2px solid var(--brand-avt);
}

.result-btn-secondary:hover {
    background: var(--brand-avt);
    color: white;
}

.filters-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

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

.filters-row-bottom {
    grid-template-columns: 1fr;
    gap: 10px;
}

.filter-select {
    padding: 12px 14px;
    font-size: 0.95rem;
}

.score-inputs {
    justify-content: center;
}

/* Responsive for Search Pages */
@media (max-width: 768px) {
    .header-banner {
        height: 250px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .header p {
        font-size: 1rem;
    }

    .search-tabs {
        flex-direction: column;
    }

    .search-tab {
        border-bottom: 1px solid #e9ecef;
        border-right: none;
    }

    .search-tab.active {
        border-bottom: 3px solid var(--brand-avt);
    }

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

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

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

    .score-input {
        width: 100px;
    }

    .result-header {
        flex-direction: column;
    }

    .result-score {
        margin-top: 15px;
        text-align: left;
    }

    .result-details {
        grid-template-columns: 1fr;
    }

    .province-pills {
        justify-content: center;
    }
}

/* ============================================
   Predict Score Page Styles
   ============================================ */
body.predict-page {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.predict-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.predict-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding: 4rem 2rem;
    background: url('../../img/banner.jpg') center center / cover no-repeat;
    color: white;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.predict-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 0;
}

.predict-header h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2.8rem;
    font-weight: 800;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.5px;
}

.predict-header p {
    margin: 0;
    opacity: 0.95;
    font-size: 1.2rem;
    position: relative;
    z-index: 1;
    font-weight: 400;
}

.predict-form {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

.form-section {
    margin-bottom: 3rem;
}

.form-section:last-of-type {
    margin-bottom: 2rem;
}

.form-section h3 {
    color: #2c3e50;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #0891b2;
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    position: relative;
}

.form-section h3::before {
    content: '';
    width: 10px;
    height: 28px;
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    border-radius: 5px;
    margin-right: 15px;
    box-shadow: 0 2px 8px rgba(8, 145, 178, 0.3);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #2c3e50;
    font-size: 1rem;
    display: flex;
    align-items: center;
}

.form-group label::after {
    content: '*';
    color: #e74c3c;
    margin-left: 4px;
    font-size: 1.1rem;
}

.form-group input,
.form-group select {
    padding: 1rem 1.25rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1.05rem;
    transition: all 0.3s ease;
    background: #fafafa;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #0891b2;
    background: white;
    box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.1);
    transform: translateY(-2px);
}

.score-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
}

.score-inputs .form-group {
    position: relative;
}

.score-inputs .form-group input {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0891b2;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 3px solid #e0e0e0;
    padding: 1.5rem 1rem;
}

.score-inputs .form-group input:focus {
    border-color: #0891b2;
    box-shadow: 0 0 0 5px rgba(8, 145, 178, 0.15);
    transform: translateY(-3px) scale(1.02);
}

.score-inputs .form-group label {
    justify-content: center;
    font-size: 1.05rem;
}

.btn-predict {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: white;
    padding: 1.5rem 2.5rem;
    border: none;
    border-radius: 15px;
    font-size: 1.3rem;
    font-weight: 800;
    cursor: pointer;
    width: 100%;
    transition: all 0.4s ease;
    box-shadow: 0 8px 25px rgba(8, 145, 178, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

/* Small button variant for centered links */
.btn-small {
    display: inline-block;
    padding: 8px 12px;
    background: #0f3366;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.btn-small:hover {
    background: #0d2e5a;
    transform: translateY(-2px);
}

.btn-predict::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-predict:hover::before {
    width: 300px;
    height: 300px;
}

.btn-predict:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.6);
}

.btn-predict:active {
    transform: translateY(-2px);
}

.result-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    padding: 3rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.result-header {
    text-align: center;
    padding: 3rem 2rem;
    border-radius: 16px;
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
}

.result-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.2), transparent);
    pointer-events: none;
}

.result-header h2 {
    position: relative;
    z-index: 1;
    font-size: 2rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.result-header.high {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    box-shadow: 0 8px 30px rgba(17, 153, 142, 0.3);
}

.result-header.medium {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    box-shadow: 0 8px 30px rgba(240, 147, 251, 0.3);
}

.result-header.low {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
    box-shadow: 0 8px 30px rgba(250, 112, 154, 0.3);
}

.probability-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem auto;
    font-size: 3.5rem;
    font-weight: 900;
    color: #0891b2;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    animation: pulse 2.5s ease-in-out infinite;
    border: 5px solid rgba(8, 145, 178, 0.1);
}

.probability-circle::before {
    content: '';
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    border: 3px dashed rgba(8, 145, 178, 0.3);
    animation: rotate 15s linear infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 20px 60px rgba(8, 145, 178, 0.4);
    }
}

.result-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.detail-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 2.5rem;
    border-radius: 16px;
    border: 2px solid #e9ecef;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.detail-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg, #0891b2 0%, #0e7490 100%);
}

.detail-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(8, 145, 178, 0.05) 0%, transparent 70%);
    transition: all 0.4s ease;
}

.detail-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 45px rgba(8, 145, 178, 0.25);
    border-color: #0891b2;
}

.detail-card:hover::after {
    top: -20%;
    right: -20%;
}

.detail-card h4 {
    color: #0891b2;
    margin: 0 0 1.25rem 0;
    font-size: 1.15rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
}

.detail-card p {
    margin: 0.75rem 0;
    color: #495057;
    font-size: 1.05rem;
    line-height: 1.7;
    position: relative;
}

.detail-card strong {
    color: #2c3e50;
    font-weight: 700;
}

.detail-card .highlight {
    background: linear-gradient(135deg, #0891b215 0%, #0e749015 100%);
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-size: 1.5rem;
    font-weight: 900;
    color: #0891b2;
    display: inline-block;
    margin-top: 0.75rem;
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.15);
}

.history-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 2rem;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.history-table th,
.history-table td {
    padding: 1.25rem 1rem;
    text-align: left;
}

.history-table th {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: none;
}

.history-table td {
    color: #495057;
    font-size: 0.95rem;
    border-bottom: 1px solid #e9ecef;
}

.history-table tbody tr {
    transition: all 0.2s ease;
}

.history-table tr:hover {
    background: #f8f9fa;
    transform: scale(1.005);
}

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

.history-table tbody td:first-child {
    font-weight: 700;
    color: #0891b2;
    font-size: 1.1rem;
}

.alert-error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    display: flex;
    align-items: center;
    gap: 1rem;
    border: none;
}

.alert-error::before {
    content: '⚠';
    font-size: 2rem;
}

.info-box {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 2rem;
    border-radius: 16px;
    border-left: 6px solid #2196f3;
    margin-bottom: 2rem;
    color: #1565c0;
    font-size: 0.95rem;
    line-height: 1.8;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.2);
}

.info-box h4 {
    margin: 0 0 1rem 0;
    color: #0d47a1;
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
}

.info-box h4::before {
    content: 'ℹ';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #2196f3;
    color: white;
    border-radius: 50%;
    margin-right: 10px;
    font-size: 1rem;
    font-weight: bold;
}

.info-box ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.5rem;
}

.info-box li {
    margin: 0.75rem 0;
    color: #1565c0;
    position: relative;
}

.info-box li::marker {
    color: #2196f3;
    font-weight: bold;
}

.info-box strong {
    color: #0d47a1;
    font-weight: 700;
}

/* Hero on gi i thc */
.intro-hero {
    background: white;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: center;
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
}

.intro-hero .hero-left h2 {
    font-size: 2rem;
    color: #0f3366;
    margin-bottom: 16px;
}

.intro-hero .hero-left p {
    color: #555;
    margin-bottom: 18px;
}

.intro-hero .btn-hero {
    padding: 10px 18px;
    background: #0f3366;
    color: white;
    border-radius: 10px;
    border: none;
    cursor: pointer;
}

.intro-hero .hero-right {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.btn-cta {
    display: inline-block;
    padding: 14px 36px;
    background: linear-gradient(135deg, #06b5bd 0%, #087f8a 100%);
    color: white;
    border-radius: 999px;
    font-weight: 800;
    text-transform: uppercase;
    box-shadow: 0 14px 30px rgba(6, 181, 189, 0.18);
    border: none;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
    text-decoration: none;
    /* Remove underline for CTA anchor */
}

.btn-cta:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 36px rgba(6, 181, 189, 0.26);
    text-decoration: none;
}

.value-card {
    background: #eef7fb;
    padding: 28px;
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(6, 64, 98, 0.06);
}

.value-card h4 {
    font-size: 1.05rem;
    color: #0f3366;
    text-transform: uppercase;
}

.hero-right .logo-card {
    background: white;
    padding: 12px;
    border-radius: 14px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
}

.hero-right .logo-card img {
    width: 100%;
    height: auto;
    display: block;
}

.intro-hero .hero-right .hero-image {
    width: 45%;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* Value cards*/
.value-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.value-card {
    background: linear-gradient(135deg, #f0f8ff 0, #e6f0ff 100%);
    padding: 22px;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.value-card h4 {
    color: #0f3366;
    font-size: 1.05rem;
    margin-bottom: 10px;
}

.value-card p {
    color: #4b5563;
}

/* News + Announcements */
.news-announce {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.news-list {
    display: grid;
    gap: 12px;
}

.news-item {
    background: white;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    display: flex;
    gap: 12px;
    align-items: center;
}

.news-item .thumb {
    width: 140px;
    height: 90px;
    background: #f5f5f5;
    border-radius: 6px;
    overflow: hidden;
}

.news-item .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-item .meta {
    font-size: 0.95rem;
}

.news-item .meta .title {
    color: #0f3366;
    font-weight: 700;
    margin-bottom: 6px
}

.news-item .meta .date {
    color: #999;
    font-size: 0.85rem
}

.announcement-box {
    background: white;
    padding: 16px;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

@media (max-width: 992px) {
    .intro-hero {
        grid-template-columns: 1fr;
    }

    .value-cards {
        grid-template-columns: 1fr;
    }

    .news-announce {
        grid-template-columns: 1fr;
    }
}

/* AI Analysis Section */
.ai-analysis-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 3px solid #e9ecef;
}

.ai-analysis-section h3 {
    color: #0891b2;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
}

.ai-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    border: 2px solid #e9ecef;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.ai-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(8, 145, 178, 0.15);
    border-color: #0891b2;
}

.ai-card h4 {
    color: #0891b2;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 1.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-card p {
    color: #495057;
    line-height: 1.8;
    margin: 0;
    font-size: 1rem;
}

.ai-card ul {
    margin: 0;
    padding-left: 1.5rem;
}

.ai-card li {
    color: #495057;
    line-height: 1.8;
    margin: 0.75rem 0;
    font-size: 1rem;
}

.ai-card li::marker {
    color: #0891b2;
    font-weight: bold;
}

.trend-card {
    border-left: 5px solid #0891b2;
}

.recommendations-card {
    border-left: 5px solid #38ef7d;
}

.conclusion-card {
    border-left: 5px solid #f093fb;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff5f8 100%);
}

.result-difference-positive {
    color: #11998e;
    font-weight: 700;
}

.result-difference-negative {
    color: #ee5a6f;
    font-weight: 700;
}

/* Responsive Design for Predict Page */
@media (max-width: 768px) {
    body.predict-page {
        background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    }

    .predict-header {
        padding: 2.5rem 1.5rem;
    }

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

    .predict-header p {
        font-size: 1rem;
    }

    .predict-form {
        padding: 1.5rem;
    }

    .form-section {
        margin-bottom: 2rem;
    }

    .form-section h3 {
        font-size: 1.1rem;
    }

    .score-inputs {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .btn-predict {
        font-size: 1rem;
        padding: 1.25rem 1.5rem;
    }

    .probability-circle {
        width: 160px;
        height: 160px;
        font-size: 2.8rem;
    }

    .probability-circle::before {
        width: 180px;
        height: 180px;
    }

    .result-details {
        grid-template-columns: 1fr;
    }

    .detail-card {
        padding: 1.75rem;
    }

    .info-box {
        padding: 1.5rem;
    }
}

/* Extra mobile tweaks for predict page (phones) */
@media (max-width: 425px) {
    .predict-container {
        max-width: 100%;
        margin: 12px auto;
        padding: 12px;
        border-radius: 8px;
    }

    .predict-header {
        padding: 1.6rem 1rem;
        border-radius: 10px;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    }

    .predict-header h1 {
        font-size: 1.25rem;
        line-height: 1.2;
        text-shadow: none;
    }

    .predict-header p {
        font-size: 0.95rem;
    }

    .predict-form {
        padding: 1rem;
        border-radius: 10px;
        box-shadow: none;
    }

    .form-section {
        margin-bottom: 1.25rem;
    }

    .form-section h3 {
        font-size: 1rem;
        padding-bottom: 0.6rem;
    }

    .form-row {
        gap: 10px;
    }

    .form-group input,
    .form-group select {
        padding: 0.7rem 0.9rem;
        font-size: 0.95rem;
    }

    .score-inputs .form-group input {
        font-size: 1.15rem;
        padding: 1rem;
    }

    .btn-predict {
        font-size: 1rem;
        padding: 0.9rem 1rem;
        border-radius: 10px;
        box-shadow: 0 8px 20px rgba(8, 145, 178, 0.18);
    }

    .result-container {
        padding: 1rem;
        border-radius: 10px;
        box-shadow: none;
    }

    .detail-card {
        padding: 1rem;
        border-radius: 10px;
    }

    .probability-circle {
        width: 120px;
        height: 120px;
        font-size: 1.6rem;
    }

    .history-table th,
    .history-table td {
        padding: 10px 8px;
        font-size: 0.9rem;
    }

    /* Reduce heavy decorations that break mobile layout */
    .header-overlay .container {
        padding: 0 6px;
    }

    .header h1 {
        font-size: 1.4rem;
        -webkit-text-stroke: 0;
        text-shadow: none;
    }
}

@media (max-width: 360px) {
    .predict-header {
        padding: 1.2rem 0.8rem;
    }

    .predict-header h1 {
        font-size: 1.1rem;
    }

    .btn-predict {
        padding: 0.8rem 0.9rem;
        font-size: 0.95rem;
    }
}

/* ============================================
   Student Pages Styles
   ============================================ */
.auth {
    max-width: 520px;
    margin: 60px auto;
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
}

.auth h1 {
    margin: 0 0 .75rem;
    color: #2c3e50;
}

.hero {
    max-width: 900px;
    margin: 60px auto;
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .1);
}

.actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.links {
    text-align: center;
    margin-top: 1rem;
}

.links a {
    color: #2c3e50;
    text-decoration: none;
}

.links a:hover {
    text-decoration: underline;
}

.success {
    background: #d4edda;
    color: #155724;
    padding: .75rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    border: 1px solid #c3e6cb;
}

/* ============================================
   Utility Classes - Replace Inline Styles
   ============================================ */
.mt-80 {
    margin-top: 80px;
}

.text-muted {
    color: #999;
}

.text-muted-sm {
    color: #666;
    font-size: 0.9rem;
}

.text-orange {
    color: var(--brand-avt);
    font-weight: 600;
}

.text-center-pad {
    text-align: center;
    padding: 40px;
}

.text-success {
    color: #38ef7d;
}

.text-danger {
    color: #f5576c;
}

.btn-clear-filter {
    background: #e74c3c;
    color: white;
}

.inline-delete-form {
    display: inline;
}

.result-difference-positive {
    color: #38ef7d;
    font-weight: bold;
}

.result-difference-negative {
    color: #f5576c;
    font-weight: bold;
}

.modal-loading {
    text-align: center;
    padding: 40px;
}

.modal-no-data {
    text-align: center;
    padding: 40px;
    color: #999;
}

.modal-no-data p {
    font-size: 1.1rem;
}

.mt-2 {
    margin-top: 2rem;
}

.pill-label {
    color: #666;
    font-size: 0.9rem;
    margin-right: 10px;
}

/* Back to Top Button (bottom-left) */
.back-to-top {
    position: fixed;
    bottom: 26px;
    left: 26px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffffff 5%, rgba(255, 255, 255, 0.98) 95%);
    color: #0f3366;
    border: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9998;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.back-to-top.show {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.back-to-top svg {
    width: 22px;
    height: 22px;
    fill: #0f3366;
}

@media (max-width: 480px) {
    .back-to-top {
        width: 48px;
        height: 48px;
        left: 18px;
        bottom: 18px;
    }
}

/* Shared modal and interest-card components (centralized from per-page styles) */
/* Modal used for displaying detailed score tables across multiple pages */
.score-modal {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9999;
}

.score-modal .score-modal-content {
    width: 92%;
    max-width: 900px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    /* animation-ready state */
    transform: translateY(18px) scale(0.98);
    opacity: 0;
    transition: transform 260ms cubic-bezier(.2, .9, .2, 1), opacity 200ms ease-out;
}

.score-modal .score-modal-content.open {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.score-modal-header {
    background: linear-gradient(135deg, var(--brand-chat-start) 0%, var(--brand-chat-end) 100%);
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.score-modal-title {
    margin: 0;
    font-size: 1.05rem;
}

.score-modal-close {
    background: transparent;
    border: 0;
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
}

.core-modal-body {}

.score-modal-body {
    padding: 16px;
    max-height: 60vh;
    overflow: auto;
}

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

.score-table th,
.score-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #eef0f2;
    text-align: left;
}

.block-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--brand-chat-start), var(--brand-chat-end));
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.95rem;
    white-space: nowrap;
}

.score-high {
    background: #e6f9ee;
    color: #1f7a3a;
    padding: 6px 10px;
    border-radius: 20px;
}

.score-medium {
    background: #fff7e7;
    color: #b06b00;
    padding: 6px 10px;
    border-radius: 20px;
}

.score-low {
    background: #f6f7f9;
    color: #6b7280;
    padding: 6px 10px;
    border-radius: 20px;
}

/* Interest cards (used on recommend_major and similar pages) */
.suggest-container {
    max-width: 1100px;
    margin: 40px auto;
}

.interest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.interest-card {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border-radius: 10px;
    box-shadow: none;
    overflow: hidden;
    box-sizing: border-box;
    cursor: pointer;
}

.interest-card input[type=checkbox] {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: 5;
    cursor: pointer;
}

.interest-card .card-inner {
    padding: 14px;
    border-radius: 10px;
    position: relative;
    transition: all 0.18s ease;
    cursor: pointer;
    z-index: 1;
    background: linear-gradient(white, white) padding-box,
        linear-gradient(135deg, rgba(17, 198, 211, 0.12), rgba(47, 141, 247, 0.12)) border-box;
    border: 2px solid transparent;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

.interest-card .card-inner .card-inner-head {
    display: none;
}

.interest-card input[type=checkbox]:checked+.card-inner {
    background: linear-gradient(135deg, var(--brand-chat-start), var(--brand-chat-end));
    color: #fff;
    border: 2px solid transparent;
    box-shadow: 0 12px 30px rgba(17, 141, 247, 0.12);
}

.interest-card .card-inner:hover,
.interest-card:hover .card-inner {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.interest-card input[type=checkbox]:focus+.card-inner {
    outline: 3px solid rgba(19, 160, 160, 0.14);
    outline-offset: 2px;
}

/* Suggest list items: remove harsh borders and keep shadow consistent */
.suggest-item {
    background: white;
    padding: 14px;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.suggest-item .result-btn-primary {
    border: none !important;
    outline: none !important;
    -webkit-appearance: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.suggest-item .result-btn-primary:focus {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

/* Utility: prevent khối thi wrapping */
.block-badge {
    white-space: nowrap;
}