/* COMPREHENSIVE MOBILE RESPONSIVE FIX */

/* Force clear browser cache - increment version */
/* Version 2.0 */

/* === NAVBAR/HEADER - CENTER ON MOBILE === */
@media screen and (max-width: 768px) {
    .navbar {
        padding: 0 !important;
        margin: 0 !important;
        background: white !important;
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1) !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 1000 !important;
    }

    .nav-container {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 1rem 1.25rem !important;
        height: auto !important;
        margin: 0 !important;
    }

    .nav-brand {
        flex: 1 !important;
    }

    .nav-logo a {
        display: flex !important;
        align-items: center !important;
        gap: 0.75rem !important;
        text-decoration: none !important;
    }

    .logo-icon {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        background: linear-gradient(135deg, #7c3aed, #8b5cf6) !important;
        border-radius: 12px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 1.5rem !important;
        color: white !important;
        box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3) !important;
        flex-shrink: 0 !important;
    }

    .logo-text {
        display: flex !important;
        flex-direction: column !important;
    }

    .logo-name {
        font-size: 1.1rem !important;
        font-weight: 700 !important;
        color: var(--text-primary) !important;
        line-height: 1.2 !important;
    }

    .logo-title {
        font-size: 0.7rem !important;
        color: var(--text-secondary) !important;
        font-weight: 500 !important;
        line-height: 1.2 !important;
    }

    /* Modern hamburger menu */
    .hamburger {
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        align-items: center !important;
        background: linear-gradient(135deg, #7c3aed15, #8b5cf615) !important;
        border: 2px solid #7c3aed30 !important;
        border-radius: 10px !important;
        padding: 12px 10px !important;
        cursor: pointer !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        z-index: 1001 !important;
        width: 44px !important;
        height: 38px !important;
    }

    .hamburger:active {
        transform: scale(0.95) !important;
    }

    .hamburger.active {
        background: linear-gradient(135deg, #7c3aed, #8b5cf6) !important;
        border-color: #7c3aed !important;
        justify-content: center !important;
    }

    .hamburger .bar {
        width: 24px !important;
        height: 2px !important;
        background: var(--primary-color) !important;
        border-radius: 2px !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        display: block !important;
        margin: 0 !important;
    }

    .hamburger.active .bar {
        background: white !important;
        position: absolute !important;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: rotate(45deg) !important;
    }

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

    .hamburger.active .bar:nth-child(3) {
        transform: rotate(-45deg) !important;
    }

    /* Enhanced mobile menu */
    .nav-menu {
        position: fixed !important;
        left: 0 !important;
        top: 72px !important;
        width: 100% !important;
        background: white !important;
        flex-direction: column !important;
        padding: 0 !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
        max-height: 0 !important;
        overflow: hidden !important;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
        border-bottom-left-radius: 20px !important;
        border-bottom-right-radius: 20px !important;
    }

    .nav-menu.active {
        max-height: 600px !important;
        padding: 1rem 0 !important;
    }

    .nav-menu li {
        width: 100% !important;
        text-align: left !important;
        opacity: 0 !important;
        transform: translateX(-20px) !important;
        transition: all 0.3s ease !important;
    }

    .nav-menu.active li {
        opacity: 1 !important;
        transform: translateX(0) !important;
    }

    .nav-menu.active li:nth-child(1) {
        transition-delay: 0.05s !important;
    }

    .nav-menu.active li:nth-child(2) {
        transition-delay: 0.1s !important;
    }

    .nav-menu.active li:nth-child(3) {
        transition-delay: 0.15s !important;
    }

    .nav-menu.active li:nth-child(4) {
        transition-delay: 0.2s !important;
    }

    .nav-menu.active li:nth-child(5) {
        transition-delay: 0.25s !important;
    }

    .nav-menu.active li:nth-child(6) {
        transition-delay: 0.3s !important;
    }

    .nav-menu.active li:nth-child(7) {
        transition-delay: 0.35s !important;
    }

    .nav-menu.active li:nth-child(8) {
        transition-delay: 0.4s !important;
    }

    .nav-menu.active li:nth-child(9) {
        transition-delay: 0.45s !important;
    }

    .nav-menu.active li:nth-child(10) {
        transition-delay: 0.5s !important;
    }

    .nav-link {
        padding: 1rem 1.5rem !important;
        width: 100% !important;
        justify-content: flex-start !important;
        display: flex !important;
        align-items: center !important;
        gap: 1rem !important;
        font-size: 1rem !important;
        font-weight: 600 !important;
        color: var(--text-primary) !important;
        border-left: 4px solid transparent !important;
        transition: all 0.3s ease !important;
    }

    .nav-link:hover,
    .nav-link.active {
        background: linear-gradient(90deg, #7c3aed15, transparent) !important;
        border-left-color: var(--primary-color) !important;
        color: var(--primary-color) !important;
    }

    .nav-link i {
        font-size: 1.25rem !important;
        width: 24px !important;
        text-align: center !important;
    }

    .nav-link span {
        flex: 1 !important;
    }
}

/* === ACADEMICS SECTION - MOBILE FIX === */
@media screen and (max-width: 768px) {

    /* Main academics container */
    .academics {
        padding: 3rem 1rem !important;
    }

    /* Force column layout */
    .academics-content {
        display: flex !important;
        flex-direction: column !important;
        gap: 2rem !important;
    }

    /* Each subsection full width */
    .academic-subsection {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
    }

    /* Education and experience grids */
    .education-grid,
    .experience-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* Cards styling */
    .education-card,
    .experience-card {
        padding: 1.5rem !important;
        margin-bottom: 0 !important;
    }

    /* Subsection titles */
    .subsection-title {
        font-size: 1.25rem !important;
        margin-bottom: 1.5rem !important;
    }
}

/* === CERTIFICATIONS - MOBILE === */
@media screen and (max-width: 768px) {
    .certifications {
        padding: 3rem 1rem !important;
    }

    .cert-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        padding: 0 !important;
    }

    .cert-card {
        padding: 1.5rem !important;
        margin: 0 !important;
    }

    .cert-logo {
        width: 70px !important;
        height: 70px !important;
        font-size: 2rem !important;
    }

    .cert-card h3 {
        font-size: 1rem !important;
        min-height: auto !important;
    }

    .certifications::before {
        width: 300px !important;
        height: 300px !important;
        top: -150px !important;
        right: -150px !important;
    }
}

/* === TABLES - MOBILE === */
@media screen and (max-width: 768px) {

    .activities-table,
    .workshops-table,
    .conferences-table {
        font-size: 0.85rem !important;
        width: 100% !important;
        overflow-x: auto !important;
    }

    .activities-table thead th,
    .activities-table tbody td,
    .workshops-table thead th,
    .workshops-table tbody td,
    .conferences-table thead th,
    .conferences-table tbody td {
        padding: 0.75rem !important;
        font-size: 0.85rem !important;
    }
}

/* === VERY SMALL SCREENS === */
@media screen and (max-width: 480px) {

    /* Stack tables as cards */
    .activities-table thead,
    .workshops-table thead,
    .conferences-table thead {
        display: none !important;
    }

    .activities-table,
    .activities-table tbody,
    .activities-table tr,
    .activities-table td,
    .workshops-table,
    .workshops-table tbody,
    .workshops-table tr,
    .workshops-table td,
    .conferences-table,
    .conferences-table tbody,
    .conferences-table tr,
    .conferences-table td {
        display: block !important;
        width: 100% !important;
    }

    .activities-table tr,
    .workshops-table tr,
    .conferences-table tr {
        margin-bottom: 1rem !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 12px !important;
        overflow: hidden !important;
        background: white !important;
    }

    .activities-table tbody td,
    .workshops-table tbody td,
    .conferences-table tbody td {
        padding: 0.75rem 1rem !important;
        border-bottom: 1px solid #f1f5f9 !important;
        text-align: left !important;
    }

    .activities-table tbody td:last-child,
    .workshops-table tbody td:last-child,
    .conferences-table tbody td:last-child {
        border-bottom: none !important;
    }

    .activities-table tbody td:first-child {
        background: linear-gradient(135deg, #7c3aed, #8b5cf6) !important;
        color: white !important;
    }

    .activities-table tbody td:first-child i {
        color: white !important;
        margin-right: 0.5rem !important;
    }

    .workshops-table tbody td:first-child,
    .conferences-table tbody td:first-child {
        font-weight: 700 !important;
        background: #f8fafc !important;
    }

    /* Certification cards even smaller */
    .cert-card {
        padding: 1.25rem !important;
    }

    .cert-logo {
        width: 60px !important;
        height: 60px !important;
        font-size: 1.75rem !important;
    }
}

/* === HERO SECTION - MOBILE === */
@media screen and (max-width: 768px) {

    /* Remove all padding/margin that causes white space */
    .hero {
        margin: 0 !important;
        padding: 0 !important;
        padding-top: 0 !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }

    .hero-background {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .hero-container {
        flex-direction: column !important;
        padding: 2rem 1.5rem !important;
        margin: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .hero-content {
        max-width: 100% !important;
        text-align: center !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .hero-title {
        font-size: 1.75rem !important;
    }

    .title-name {
        font-size: 2.25rem !important;
    }

    .hero-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
        margin: 1.5rem 0 !important;
    }

    .hero-buttons {
        flex-direction: column !important;
        gap: 1rem !important;
        width: 100% !important;
    }

    .hero-buttons .btn {
        width: 100% !important;
        justify-content: center !important;
    }

    .hero-visual {
        margin-top: 2rem !important;
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        margin-left: 0 !important;
    }

    .profile-card {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
    }

    .profile-image {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .profile-image img {
        width: 220px !important;
        height: 220px !important;
    }
}

/* === FIX BODY/HTML OVERFLOW === */
@media screen and (max-width: 768px) {

    html,
    body {
        overflow-x: hidden !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Fix any section causing white space */
    section {
        width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
}

/* === INDUSTRIAL TRAINING & OTHER SECTIONS - CENTER ON MOBILE === */
@media screen and (max-width: 768px) {

    /* Industrial Training - Center cards */
    .training-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        max-width: 400px !important;
        margin: 0 auto !important;
        justify-items: center !important;
    }

    .training-card {
        width: 100% !important;
        max-width: 350px !important;
        margin: 0 auto !important;
    }

    /* Content Development - Center */
    .content-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        max-width: 400px !important;
        margin: 0 auto !important;
    }

    .content-card {
        width: 100% !important;
        max-width: 350px !important;
        margin: 0 auto !important;
    }

    /* Professional Bodies - Center */
    .professional-card {
        max-width: 400px !important;
        margin: 0 auto !important;
    }

    /* International Exposure - Center */
    .international-card {
        max-width: 400px !important;
        margin: 0 auto !important;
    }

    /* Research Project - Center */
    .research-card {
        max-width: 500px !important;
        margin: 0 auto !important;
    }
}

/* === GENERAL SPACING FIXES === */
@media screen and (max-width: 768px) {

    /* Section padding */
    section {
        padding: 3rem 1rem !important;
    }

    /* Container width */
    .container {
        max-width: 100% !important;
        padding: 0 1rem !important;
    }

    /* Section titles */
    .section-title {
        font-size: 1.75rem !important;
        margin-bottom: 2rem !important;
    }

    /* Remove any excessive margins */
    .about-stats,
    .skills-grid,
    .research-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}