/* Responsive Design */

/* Large Desktop (1440px and up) */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-title {
        font-size: clamp(3rem, 5vw, 4rem);
    }
    
    .hero-image img {
        max-width: 500px;
    }
}

/* Desktop and Large Tablets (1025px to 1439px) */
@media (max-width: 1439px) and (min-width: 1025px) {
    .container {
        max-width: 1200px;
        padding: 0 var(--space-8);
    }
    
    .hero-title {
        font-size: clamp(2.5rem, 4.5vw, 3.5rem);
    }
}

/* Tablets (769px to 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .container {
        padding: 0 var(--space-6);
    }

    .hero-container {
        gap: var(--space-10);
        grid-template-columns: 1fr 1fr;
    }

    .hero-title {
        font-size: clamp(2.2rem, 4.8vw, 3.2rem);
    }

    .hero-description {
        font-size: var(--font-size-base);
    }

    .hero-image img {
        max-width: 350px;
    }
    
    .overview-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-8);
    }
}

/* Mobile Landscape and Small Tablets (481px to 768px) */
@media (max-width: 768px) and (min-width: 481px) {
    .container {
        padding: 0 var(--space-4);
    }
    
    .nav-container {
        padding: 0 var(--space-6);
        gap: var(--space-8);
        justify-content: space-between;
    }
    
    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: rgba(255, 255, 255, 0.98);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: var(--space-8);
        gap: var(--space-6);
        transition: var(--transition);
        border-top: 1px solid var(--gray-200);
        z-index: 1000;
    }

    .nav-link {
        padding: var(--space-4) var(--space-6);
        font-size: var(--font-size-lg);
        text-align: center;
        min-width: 120px;
        width: 100%;
        border-radius: var(--border-radius);
        position: relative;
    }
    
    /* Giữ lại hiệu ứng after cho active state trên mobile */
    .nav-link::after {
        content: '';
        position: absolute;
        bottom: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 0;
        height: 2px;
        background-color: var(--primary-blue);
        transition: width 0.3s ease;
    }
    
    .nav-link.active::after {
        width: 30px;
    }
    
    /* Hover effect chỉ cho desktop trong mobile view */
    @media (hover: hover) {
        .nav-link:hover::after {
            width: 30px;
        }
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    .hero {
        padding: 100px 0 60px;
        min-height: 80vh;
    }

    .hero-container {
        grid-template-columns: 1fr;
        gap: var(--space-8);
        text-align: center;
    }

    .hero-visual {
        order: -1;
    }

    .hero-title {
        font-size: clamp(2rem, 6vw, 2.8rem);
        margin-bottom: var(--space-4);
        line-height: 1.2;
    }

    .hero-break {
        display: block;
    }
    
    .hero-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-4);
    }
    
    .overview-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
}

/* Mobile Portrait (320px to 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-3);
    }
    
    .nav-container {
        padding: 0 var(--space-4);
        gap: var(--space-6);
    }
    
    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: rgba(255, 255, 255, 0.98);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: var(--space-8);
        gap: var(--space-6);
        transition: var(--transition);
        border-top: 1px solid var(--gray-200);
        z-index: 1000;
    }

    .nav-link {
        padding: var(--space-3) var(--space-4);
        font-size: var(--font-size-base);
        text-align: center;
        width: 100%;
        border-radius: var(--border-radius);
        position: relative;
    }
    
    /* Giữ lại hiệu ứng after cho active state trên mobile nhỏ */
    .nav-link::after {
        content: '';
        position: absolute;
        bottom: 6px;
        left: 50%;
        transform: translateX(-50%);
        width: 0;
        height: 2px;
        background-color: var(--primary-blue);
        transition: width 0.3s ease;
    }
    
    .nav-link.active::after {
        width: 25px;
    }
    
    /* Hover effect chỉ cho desktop trong mobile view */
    @media (hover: hover) {
        .nav-link:hover::after {
            width: 25px;
        }
    }

    .logo-text {
        display: none;
    }

    .hero {
        padding: 90px 0 50px;
        min-height: 85vh;
    }

    .hero-container {
        grid-template-columns: 1fr;
        gap: var(--space-6);
        text-align: center;
    }

    .hero-title {
        font-size: clamp(1.6rem, 7vw, 2.2rem);
        margin-bottom: var(--space-3);
        line-height: 1.1;
    }

    .hero-description {
        font-size: var(--font-size-sm);
        margin-bottom: var(--space-6);
    }

    .hero-stats {
        grid-template-columns: 1fr;
        gap: var(--space-3);
        margin-bottom: var(--space-6);
    }

    .hero-buttons {
        flex-direction: column;
        gap: var(--space-3);
        width: 100%;
    }

    .btn {
        width: 100%;
        justify-content: center;
        padding: var(--space-3) var(--space-4);
        font-size: var(--font-size-sm);
    }

    .overview-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }

    .ahtp-gallery {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--space-6);
        text-align: center;
    }

    .cta-buttons {
        flex-direction: column;
        gap: var(--space-3);
        width: 100%;
    }

    .section-title {
        font-size: clamp(1.5rem, 5vw, 2rem);
    }

    .section-description {
        font-size: var(--font-size-sm);
    }
}

/* Extra Small Mobile (below 320px) */
@media (max-width: 319px) {
    .container {
        padding: 0 var(--space-2);
    }
    
    .hero-title {
        font-size: clamp(1.4rem, 8vw, 1.8rem);
    }
    
    .nav-container {
        padding: 0 var(--space-3);
    }
    
    .btn {
        padding: var(--space-2) var(--space-3);
        font-size: var(--font-size-xs);
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-image img,
    .logo,
    .overview-icon i {
        -webkit-image-rendering: -webkit-optimize-contrast;
        image-rendering: -webkit-optimize-contrast; /* Edge 79+ and Safari */
    }
}

/* Prevent body scroll when mobile menu is open */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Tối ưu cho trang đội ngũ trên mobile */
@media (max-width: 768px) {
    /* Page Header */
    .page-header {
        padding: 100px 0 60px;
    }
    
    .page-header h1 {
        font-size: 1.8rem;
        line-height: 1.3;
        margin-bottom: 1rem;
    }
    
    .page-header p {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    /* About Section */
    .about {
        padding: 50px 0;
    }
    
    .about-description {
        font-size: 1rem;
        line-height: 1.7;
        padding: 0 10px;
    }
    
    .about-stats {
        flex-direction: column;
        gap: 25px;
        margin-top: 30px;
    }
    
    .about-stat {
        width: 100%;
        padding: 20px;
        background: white;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }
    
    .about-stat .stat-number {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }
    
    .about-stat .stat-label {
        font-size: 0.95rem;
    }
    
    /* Team Grid */
    .team {
        padding: 50px 0;
    }
    
    .team-grid {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 0 15px;
    }
    
    .team-member {
        padding: 25px 20px;
    }
    
    .member-avatar {
        width: 70px;
        height: 70px;
        font-size: 2rem;
        margin-bottom: 15px;
    }
    
    .team-member h4 {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }
    
    .member-role {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }
    
    .member-info {
        font-size: 0.85rem;
        line-height: 1.6;
    }
    
    /* Mentor Cards */
    .mentor {
        padding: 50px 0;
    }
    
    .mentor-grid {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 0 15px;
    }
    
    .mentor-card {
        padding: 25px 20px;
        margin-bottom: 25px;
    }
    
    .mentor-avatar {
        width: 70px;
        height: 70px;
        font-size: 2rem;
        margin-bottom: 15px;
    }
    
    .mentor-info h3 {
        font-size: 1.2rem;
        margin-bottom: 8px;
    }
    
    .mentor-title {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }
    
    .mentor-education h4,
    .mentor-experience h4,
    .mentor-projects h4,
    .mentor-business h4,
    .mentor-skills h4 {
        font-size: 0.95rem;
        margin-bottom: 8px;
    }
    
    .mentor-education ul,
    .mentor-experience ul,
    .mentor-projects ul,
    .mentor-business ul {
        font-size: 0.85rem;
        line-height: 1.6;
        padding-left: 20px;
    }
    
    .mentor-education li,
    .mentor-experience li,
    .mentor-projects li,
    .mentor-business li {
        padding: 4px 0;
    }
    
    .skills-tags {
        gap: 6px;
        justify-content: center;
    }
    
    .skill-tag {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    
    /* Achievements */
    .achievements-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .achievement-item {
        padding: 15px;
        font-size: 0.9rem;
    }
    
    .achievement-item i {
        font-size: 1.3rem;
    }
}

/* Contact Page Mobile Optimization */
@media (max-width: 768px) {
    /* Contact Content */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    /* Contact Info */
    .contact-info {
        order: 2;
    }
    
    .contact-info h2 {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
    
    .contact-cards {
        display: grid;
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .contact-card {
        padding: 20px;
    }
    
    .contact-card h3 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    .contact-card p {
        font-size: 0.9rem;
        line-height: 1.7;
    }
    
    /* Contact Form */
    .contact-form {
        order: 1;
        padding: 25px 20px;
    }
    
    .contact-form h2 {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px 15px;
        font-size: 0.95rem;
    }
    
    .form-group textarea {
        min-height: 120px;
    }
    
    /* Contact Info Cards */
    .contact-info-card {
        padding: 20px;
    }
    
    .contact-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
        margin-bottom: 12px;
    }
    
    .contact-title {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    .contact-detail {
        font-size: 0.85rem;
    }
    
    /* FAQ Section */
    .faq-section {
        padding: 50px 0;
    }
    
    .faq-item {
        padding: 20px;
        margin-bottom: 15px;
    }
    
    .faq-item h4 {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .faq-item p {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    /* Newsletter Section */
    .newsletter {
        padding: 50px 0;
    }
    
    .newsletter-content {
        grid-template-columns: 1fr;
        gap: 25px;
        text-align: center;
    }
    
    .newsletter-text h2 {
        font-size: 1.4rem;
        margin-bottom: 12px;
    }
    
    .newsletter-text p {
        font-size: 0.9rem;
    }
    
    .subscribe-form {
        flex-direction: column;
        gap: 12px;
    }
    
    .subscribe-form input {
        width: 100%;
        padding: 12px 15px;
        font-size: 0.95rem;
    }
    
    .subscribe-form button {
        width: 100%;
        padding: 12px 20px;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    /* Extra small mobile adjustments */
    .page-header {
        padding: 90px 0 50px;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .page-header p {
        font-size: 0.85rem;
    }
    
    .about-description {
        font-size: 0.9rem;
        padding: 0 5px;
    }
    
    .team-member,
    .mentor-card {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    .mentor-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
        margin-bottom: 12px;
    }
    
    .mentor-info h3 {
        font-size: 1.1rem;
        line-height: 1.3;
    }
    
    .mentor-title {
        font-size: 0.85rem;
    }
    
    .mentor-education h4,
    .mentor-experience h4,
    .mentor-projects h4,
    .mentor-business h4,
    .mentor-skills h4 {
        font-size: 0.9rem;
    }
    
    .mentor-education ul,
    .mentor-experience ul,
    .mentor-projects ul,
    .mentor-business ul {
        font-size: 0.8rem;
        padding-left: 15px;
    }
    
    .skill-tag {
        padding: 5px 8px;
        font-size: 0.7rem;
    }
    
    .contact-form,
    .contact-card {
        padding: 20px 15px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}
