/* ==========================================================================
   RESPONSIVE DESIGN & MOBILE OPTIMIZATIONS - THÁI DƯƠNG GROUP / HBR CAREERS
   Fully optimized for all mobile phones (320px - 480px), tablets (481px - 768px),
   large tablets/laptops (769px - 1024px), and desktop viewports.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Global Mobile & Base Reset Rules
   -------------------------------------------------------------------------- */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
    width: 100%;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

*, *::before, *::after {
    box-sizing: border-box;
}

img, video, iframe {
    max-width: 100%;
    height: auto;
}

/* --------------------------------------------------------------------------
   1. Desktops & Laptops (max-width: 1200px)
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
    .header-container,
    .navbar-inner {
        padding: 0 16px;
    }

    .brand-title {
        font-size: 14px;
    }

    .nav-menu {
        gap: 14px;
    }

    .nav-link {
        font-size: 13.5px;
    }

    .hero-section .container {
        padding: 0 16px;
    }
}

/* --------------------------------------------------------------------------
   2. Medium Tablets & Small Laptops (max-width: 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .main-navbar {
        height: 72px;
    }

    .brand-logo-link {
        margin-right: 16px;
        gap: 10px;
    }

    .brand-custom-logo {
        width: 42px;
        height: 42px;
    }

    .brand-line-1 {
        font-size: 12px;
    }

    .brand-line-2 {
        font-size: 14px;
    }

    .nav-menu {
        gap: 10px;
    }

    .nav-link {
        font-size: 12.5px;
        padding: 4px 0;
    }

    .hero-content-grid {
        grid-template-columns: 260px 1fr;
        gap: 16px;
    }

    .about-grid {
        grid-template-columns: 220px 1fr;
        gap: 24px;
    }

    .vision-mission-grid {
        grid-template-columns: 280px 1fr;
        gap: 28px;
    }

    .vision-leader-photo img {
        height: 340px;
    }

    .career-cards-grid {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .story-split-grid {
        gap: 28px;
    }

    .why-join-grid {
        gap: 28px;
    }

    .benefits-cards-grid,
    .school-courses-grid {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }
}

/* --------------------------------------------------------------------------
   3. Tablets & Large Phones (max-width: 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    /* Top Bar */
    .top-bar {
        font-size: 12px;
        padding: 6px 0;
    }

    .top-bar-inner {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
        justify-content: space-between;
    }

    .top-search-form {
        display: none; /* Hide top search form on mobile to save vertical space */
    }

    .top-hotline {
        font-size: 12.5px;
    }

    .top-socials {
        gap: 6px;
    }

    .social-icon-btn {
        width: 26px;
        height: 26px;
    }

    /* Main Navbar & Mobile Hamburger Menu */
    .main-navbar {
        height: 64px;
        position: sticky;
        top: 0;
        z-index: 999;
    }

    .header-container,
    .navbar-inner {
        padding: 0 16px;
        justify-content: space-between;
        width: 100%;
    }

    .brand-logo-link {
        margin-right: 0;
        gap: 10px;
        max-width: calc(100% - 50px);
    }

    .brand-custom-logo {
        width: 38px;
        height: 38px;
    }

    .brand-line-1 {
        font-size: 11px;
        font-weight: 900;
        white-space: nowrap;
    }

    .brand-line-2 {
        font-size: 13px;
        font-weight: 900;
        white-space: nowrap;
    }

    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.15);
        color: #ffffff;
        cursor: pointer;
        transition: all 0.2s ease;
        padding: 0;
        flex-shrink: 0;
    }

    .mobile-menu-toggle:active,
    .mobile-menu-toggle.active {
        background: var(--green);
        border-color: var(--green);
    }

    .mobile-menu-toggle svg {
        width: 22px;
        height: 22px;
    }

    /* Collapsible Navigation Menu */
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--primary-dark);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        border-bottom: 3px solid var(--green);
        flex-direction: column;
        padding: 16px 20px;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
        gap: 12px;
        z-index: 1000;
        width: 100%;
        border-radius: 0 0 16px 16px;
    }

    .nav-menu.open {
        display: flex;
        animation: mobileMenuSlideDown 0.25s ease forwards;
    }

    @keyframes mobileMenuSlideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

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

    .nav-link {
        display: block;
        width: 100%;
        padding: 10px 14px;
        font-size: 14.5px;
        font-weight: 600;
        color: #eaf5ee;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.04);
        transition: all 0.2s ease;
    }

    .nav-link:hover,
    .nav-link:active {
        background: rgba(46, 125, 50, 0.2);
        color: #ffffff;
    }

    .nav-link.active {
        background: rgba(255, 59, 48, 0.15);
        color: #ff3b30 !important;
        font-weight: 700;
    }

    /* Hero Section */
    .hero-section {
        padding: 18px 0 32px 0;
    }

    .hero-section .container {
        padding: 0 14px;
    }

    .floating-filter-card {
        border-radius: 16px;
        padding: 14px;
        margin-bottom: 20px;
        box-shadow: 0 4px 16px rgba(4, 47, 48, 0.12);
    }

    .filter-form-row {
        flex-direction: column;
        gap: 10px;
    }

    .filter-group {
        width: 100%;
        border: 1px solid var(--border-color);
        border-radius: 10px;
        padding: 8px 12px;
        background: #f8fafc;
    }

    .filter-group::after {
        display: none;
    }

    .filter-select {
        width: 100%;
        font-size: 14px;
        background: transparent;
    }

    .btn-filter-search {
        width: 100%;
        justify-content: center;
        height: 44px;
        border-radius: 10px;
        font-size: 14.5px;
        padding: 0 16px;
    }

    /* Hero Content Grid (Banner & Sidebar) */
    .hero-content-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .hero-banner-card {
        order: 1;
        min-height: 200px;
        border-radius: 14px;
    }

    .category-sidebar-card {
        order: 2;
        border-radius: 14px;
    }

    /* Category Pills (Horizontal scroll on mobile) */
    .job-categories-section {
        padding: 24px 0 16px 0;
    }

    .section-title-center {
        font-size: 24px;
        margin-bottom: 18px;
    }

    .category-pills-container {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 8px;
        padding: 4px 14px 14px 14px;
        justify-content: flex-start;
        flex-wrap: nowrap;
    }

    .category-pills-container::-webkit-scrollbar {
        display: none;
    }

    .category-pill-btn {
        flex-shrink: 0;
        white-space: nowrap;
        font-size: 13.5px;
        padding: 8px 16px;
        border-radius: 20px;
    }

    /* Job Openings Section & Tables */
    .job-openings-section {
        padding: 20px 0 40px 0;
    }

    .jobs-table-header {
        display: none !important;
    }

    .jobs-table-body {
        gap: 10px;
    }

    .job-row-card {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 16px 14px;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }

    .job-cell-title {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        width: 100%;
        padding-right: 0;
    }

    .job-title-text {
        font-size: 14.5px;
        line-height: 1.4;
    }

    .job-cell-salary {
        font-size: 14.5px;
        font-weight: 700;
        color: var(--green);
        padding-right: 0;
        width: 100%;
    }

    .job-cell-deadline {
        font-size: 13px;
        color: var(--text-secondary);
        padding-right: 0;
        width: 100%;
    }

    .job-cell-action {
        width: 100%;
        margin-top: 4px;
    }

    .btn-apply-outline {
        width: 100% !important;
        text-align: center;
        height: 42px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        border-radius: 8px;
    }

    /* About Section */
    .about-hbr-section {
        padding: 36px 0;
    }

    .about-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 20px;
    }

    .about-logo-badge {
        max-width: 180px;
        margin: 0 auto;
    }

    .stats-counter-row {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 20px 16px !important;
    }

    .stat-number {
        font-size: 32px;
    }

    /* Vision & Mission */
    .vision-mission-section {
        padding: 36px 0;
    }

    .vision-mission-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 24px;
    }

    .vision-leader-photo {
        max-width: 240px;
        margin: 0 auto;
    }

    .vision-leader-photo img {
        height: auto;
        max-height: 280px;
        border-radius: 14px;
    }

    .quote-highlight {
        font-size: 17px;
        line-height: 1.5;
        padding: 14px 16px;
        border-radius: 10px;
    }

    .vision-block h3::after, 
    .mission-block h3::after {
        margin: 6px auto 0 auto;
    }

    /* Workplace Culture & Video Showcase */
    .story-split-section {
        padding: 36px 0;
    }

    .story-split-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 24px;
    }

    .story-content-col h2.story-heading {
        font-size: 24px;
        line-height: 1.3;
    }

    .story-description {
        font-size: 14.5px;
        line-height: 1.65;
    }

    .video-thumb-img {
        height: 210px;
    }

    /* Why Join Section */
    .why-join-section {
        padding: 36px 0;
    }

    .why-join-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .why-join-content h2.why-join-title {
        text-align: center;
        font-size: 23px;
        line-height: 1.3;
        margin-bottom: 20px;
    }

    .why-join-photo {
        max-width: 100%;
    }

    .why-join-photo img {
        height: auto;
        max-height: 240px;
        width: 100%;
        border-radius: 12px;
    }

    .why-benefit-item {
        gap: 12px;
        padding: 12px 14px;
    }

    .benefit-text-title {
        font-size: 14px;
    }

    /* Job Alert Banner */
    .job-alert-banner {
        grid-template-columns: 1fr;
        border-radius: 14px;
    }

    .job-alert-img-col {
        height: 180px;
    }

    .job-alert-cta-col {
        padding: 24px 16px;
        text-align: center;
        align-items: center;
    }

    .job-alert-title {
        font-size: 20px;
    }

    .job-alert-desc {
        font-size: 14px;
    }

    /* Quick Apply Form */
    .quick-apply-section {
        padding: 36px 0;
    }

    .quick-apply-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .quick-apply-card {
        padding: 20px 16px;
        border-radius: 14px;
    }

    /* Career Guide Center Interactive */
    .career-guide-interactive-wrapper {
        flex-direction: column;
    }

    .career-guide-center-avatar {
        position: relative;
        margin-bottom: 20px;
        height: 160px;
    }

    .center-holo-circle {
        width: 140px;
        height: 140px;
    }

    .career-cards-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .guide-card-bottom-center {
        max-width: 100%;
    }

    /* SUBPAGE: View Jobs (`#view-jobs`) */
    .workplace-showcase-section {
        padding: 24px 16px !important;
        margin-top: 30px !important;
        margin-bottom: 30px !important;
        border-radius: 14px !important;
    }

    .workplace-showcase-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
        text-align: center;
    }

    .workplace-showcase-text h2 {
        font-size: 24px !important;
        line-height: 1.3 !important;
        margin-bottom: 12px !important;
    }

    .workplace-showcase-text p {
        font-size: 14.5px !important;
    }

    .recruitment-cta-banner {
        padding: 30px 16px !important;
        border-radius: 14px !important;
        margin-bottom: 24px !important;
    }

    .recruitment-cta-banner h2 {
        font-size: 24px !important;
        line-height: 1.3 !important;
        margin-bottom: 12px !important;
    }

    .recruitment-cta-banner p {
        font-size: 15px !important;
        margin-bottom: 20px !important;
    }

    .recruitment-cta-banner button {
        width: 100% !important;
        max-width: 260px !important;
        padding: 12px 24px !important;
        font-size: 14.5px !important;
    }

    /* 4-Column Photo Gallery to 2 Columns on Tablet/Mobile */
    .recruitment-gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .recruitment-gallery-grid > div {
        height: 140px !important;
        border-radius: 8px !important;
    }

    /* SUBPAGE: View Benefits (`#view-benefits`) */
    .benefits-detailed-grid,
    .benefits-cards-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .benefit-card-box {
        padding: 20px 16px !important;
    }

    .benefits-invite-banner {
        padding: 24px 16px !important;
        border-radius: 14px !important;
        text-align: center;
    }

    .benefits-invite-banner h2 {
        font-size: 22px !important;
    }

    .benefits-apply-content {
        padding: 24px 16px !important;
        border-radius: 14px !important;
    }

    .benefits-apply-form {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .benefits-form-field.btn-field label {
        display: none !important;
    }

    .btn-benefit-submit {
        height: 44px !important;
        font-size: 15px !important;
    }

    /* SUBPAGE: View Guide, News, School */
    .articles-full-grid,
    .news-cards-grid,
    .school-courses-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .page-header-banner {
        padding: 32px 0 !important;
    }

    .page-header-banner h1 {
        font-size: 22px !important;
        line-height: 1.35 !important;
    }

    .page-header-banner p {
        font-size: 14px !important;
    }

    /* Footer */
    .site-footer {
        padding: 40px 0 20px 0;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    /* Floating Contact Widgets */
    .floating-contact-widgets {
        right: 12px;
        bottom: 16px;
        gap: 10px;
    }

    .floating-btn {
        width: 44px;
        height: 44px;
    }

    .floating-btn-phone svg,
    .floating-btn-zalo svg,
    .floating-btn-top svg {
        width: 20px;
        height: 20px;
    }

    /* Modals for Mobile */
    .modal-overlay {
        padding: 10px !important;
        align-items: flex-end;
    }

    .modal-container {
        max-width: 100% !important;
        width: 100% !important;
        max-height: 90vh !important;
        border-radius: 16px 16px 0 0 !important;
        margin: 0 !important;
    }

    .modal-header {
        padding: 16px 18px !important;
    }

    .modal-title {
        font-size: 16px !important;
    }

    .modal-body {
        padding: 18px 16px !important;
    }

    .form-group {
        margin-bottom: 14px !important;
    }

    .form-group[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .file-upload-box {
        padding: 18px 12px !important;
    }

    .file-upload-icon {
        font-size: 26px !important;
    }

    .file-upload-text {
        font-size: 13px !important;
    }

    .modal-footer {
        flex-direction: column-reverse !important;
        gap: 8px !important;
        margin-top: 18px !important;
        padding-top: 14px !important;
    }

    .modal-footer button {
        width: 100% !important;
        text-align: center !important;
        height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

/* --------------------------------------------------------------------------
   4. Small Mobile Phones (max-width: 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .brand-line-1 {
        font-size: 10px;
        font-weight: 900;
        white-space: nowrap;
    }

    .brand-line-2 {
        font-size: 12px;
        font-weight: 900;
        white-space: nowrap;
    }

    .brand-custom-logo {
        width: 34px;
        height: 34px;
    }

    .section-title-center {
        font-size: 21px;
    }

    .category-pill-btn {
        padding: 7px 14px;
        font-size: 12.5px;
    }

    .quote-highlight {
        font-size: 15px;
        padding: 12px 14px;
    }

    .job-alert-title {
        font-size: 18px;
    }

    .btn-subscribe-job {
        width: 100%;
        text-align: center;
    }

    .stat-number {
        font-size: 28px;
    }

    .recruitment-cta-banner h2 {
        font-size: 21px !important;
    }

    .recruitment-cta-banner p {
        font-size: 13.5px !important;
    }

    .recruitment-gallery-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    .recruitment-gallery-grid > div {
        height: 120px !important;
    }

    .toast {
        max-width: calc(100vw - 32px);
        font-size: 13px;
        padding: 12px 16px;
    }
}
