/* 
 * OPTIMIZED CSS FOR DR. AHMAD FAISAL'S WEBSITE
 * Table of Contents:
 * 1. Variables & Global Styles
 * 2. Typography & Common Elements
 * 3. Layout Components
 * 4. Header & Navigation
 * 5. Sections (Hero, About, Timeline, etc.)
 * 6. Footer
 * 7. Responsive Design
 */

/* ==============================
   1. VARIABLES & GLOBAL STYLES
   ============================== */
:root {
    --primary-color: #0066cc;
    --secondary-color: #003366;
    --accent-color: #00aaff;
    --light-color: #f5f9ff;
    --dark-color: #1c2331;
    --gray-color: #f4f4f4;
    --text-color: #333;
    --text-light: #6c757d;
    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Roboto', sans-serif;
    --transition: all 0.3s ease;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 62.5%; /* 1rem = 10px */
}

body {
    font-family: var(--font-primary);
    font-size: 1.6rem;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #ffffff;
    overflow-x: hidden;
}

.container {
    width: 90%;
    max-width: 120rem;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ==============================
   2. TYPOGRAPHY & COMMON ELEMENTS
   ============================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1.5rem;
    color: var(--dark-color);
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1.2rem 2.5rem;
    font-size: 1.6rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

.primary-btn:hover {
    background-color: var(--secondary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.secondary-btn {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.secondary-btn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

/* Section common styles */
.section-padding {
    padding: 10rem 0;
}

.section-title {
    font-size: 3.6rem;
    margin-bottom: 5rem;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -1.5rem;
    left: 50%;
    width: 6rem;
    height: 0.4rem;
    background-color: var(--primary-color);
    transform: translateX(-50%);
    border-radius: 2rem;
}

/* ==============================
   3. LAYOUT COMPONENTS
   ============================== */
/* Menu Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

body.no-scroll {
    overflow: hidden;
}

/* ==============================
   4. HEADER & NAVIGATION
   ============================== */
header {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    padding: 0.5rem 0;
    transition: all 0.3s ease;
}

header.scrolled {
    padding: 0;
    background-color: rgba(255, 255, 255, 0.98);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 6rem;
    transition: height 0.3s ease;
}

.scrolled nav {
    height: 5rem;
}

/* Logo Styles */
.logo {
    display: flex;
    align-items: center;
    height: 100%;
}

.logo a {
    display: flex;
    align-items: center;
    height: 100%;
}

.logo img {
    max-height: 4.2rem;
    width: auto;
    transition: all 0.3s ease;
    object-fit: contain;
}

.scrolled .logo img {
    max-height: 3.5rem;
}

/* Navigation Links */
.nav-links {
    display: flex;
    list-style: none;
    transition: all 0.3s ease;
}

.nav-links li {
    margin-left: 2.5rem;
}

.nav-links a {
    color: var(--dark-color);
    font-weight: 500;
    font-size: 1.5rem;
    padding: 0.8rem 1.2rem;
    border-radius: 0.4rem;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a:hover::after {
    width: 80%;
}

/* Mobile menu logo */
.mobile-menu-logo {
    display: none;
    width: 100%;
    text-align: center;
    margin-bottom: 3rem !important;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.mobile-menu-logo a {
    display: inline-block;
    padding: 0 !important;
}

.mobile-menu-logo img {
    max-height: 4.5rem;
    width: auto;
}

/* Close button for mobile menu */
.close-mobile-menu {
    display: none;
    margin-top: 3rem !important;
    width: 100%;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 2rem;
}

.close-mobile-menu a {
    color: var(--text-light) !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-mobile-menu a i {
    margin-right: 0.8rem;
    font-size: 1.6rem;
}

/* Burger Menu */
.burger {
    display: none;
    cursor: pointer;
    background-color: transparent;
    border: none;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    position: relative;
    z-index: 1001;
    transition: all 0.3s ease;
}

.burger:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.burger div {
    width: 2.2rem;
    height: 0.2rem;
    background-color: var(--dark-color);
    margin: 0.4rem auto;
    transition: all 0.3s ease;
    border-radius: 1rem;
}

/* ==============================
   5. SECTIONS
   ============================== */
/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f5f9ff 0%, #e6f0ff 100%);
    padding-top: 8rem;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
}

.hero-text {
    flex: 1;
}

.hero-text h1 {
    font-size: 4.2rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.hero-text h2 {
    font-size: 2.4rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
}

.hero-text p {
    font-size: 1.8rem;
    margin-bottom: 3rem;
    color: var(--text-light);
}

.hero-buttons {
    display: flex;
    gap: 2rem;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image img {
    width: 100%;
    max-width: 40rem;
    border-radius: 10%;
    box-shadow: var(--shadow);
    border: 0.8rem solid white;
}

/* About Section */
.about {
    background-color: white;
}

.about-content {
    display: flex;
    flex-direction: column;
    gap: 5rem;
}

.about-text {
    max-width: 80rem;
    margin: 0 auto;
    text-align: center;
}

.about-text p {
    margin-bottom: 2rem;
    font-size: 1.7rem;
}

.about-stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 3rem;
}

.stat-box {
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    padding: 3rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    width: 20rem;
}

.stat-box:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.stat-number {
    display: block;
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.stat-text {
    font-size: 1.6rem;
    color: var(--text-light);
}

/* Experience/Timeline Section */
.experience {
    background-color: var(--gray-color);
}

.timeline {
    position: relative;
    max-width: 80rem;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 0.6rem;
    background-color: var(--primary-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -0.3rem;
    border-radius: 1rem;
}

.timeline-item {
    padding: 1rem 4rem;
    position: relative;
    width: 50%;
    box-sizing: border-box;
}

.timeline-item:nth-child(odd) {
    left: 0;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-dot {
    position: absolute;
    width: 2.5rem;
    height: 2.5rem;
    right: -1.25rem;
    background-color: white;
    border: 0.4rem solid var(--primary-color);
    top: 1.5rem;
    border-radius: 50%;
    z-index: 1;
}

.timeline-item:nth-child(even) .timeline-dot {
    left: -1.25rem;
}

.timeline-date {
    position: absolute;
    top: 1.2rem;
    right: 4.5rem;
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 2rem;
    font-size: 1.4rem;
    z-index: 2;
}

.timeline-item:nth-child(even) .timeline-date {
    left: 4.5rem;
    right: auto;
}

.timeline-content {
    padding: 2rem;
    background-color: white;
    position: relative;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.timeline-content h3 {
    margin-top: 0;
    color: var(--secondary-color);
    font-size: 2rem;
}

.timeline-content p {
    margin-bottom: 0;
}

/* Research Projects Section */
.research {
    background-color: white;
}

.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(30rem, 1fr));
    gap: 3rem;
}

.research-card {
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    padding: 3rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.research-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.research-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
}

.research-card h3 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
}

.research-card p {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

/* Publications Section */
.publications {
    background-color: var(--gray-color);
}

.publications-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 4rem;
}

.filter-btn {
    padding: 0.8rem 2rem;
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 2rem;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.4rem;
    font-weight: 500;
}

.filter-btn:hover, .filter-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.publications-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 90rem;
    margin: 0 auto;
}

.publication-item {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 2.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.publication-item:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow-hover);
}

.publication-item h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.publication-journal {
    font-size: 1.4rem;
    color: var(--text-light);
    font-style: italic;
}

.view-more {
    text-align: center;
    margin-top: 4rem;
}

/* Collaborations Section */
.collaborations {
    background-color: white;
}

.collaborations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(30rem, 1fr));
    gap: 3rem;
}

.collaboration-card {
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    padding: 3rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.collaboration-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

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

.collaboration-card h3 {
    font-size: 2rem;
    margin-bottom: 0;
    color: var(--secondary-color);
}

.country-flag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 1.4rem;
    z-index: 1;
}

.country-flag i {
    font-size: 1.6rem;
}

/* Country flag colors */
.japan-flag {
    background-color: #BC002D;
}

.australia-flag {
    background-color: #00008B;
}

.indonesia-flag {
    background-color: #FF0000;
}

.malaysia-flag {
    background-color: #010066;
}

.collaboration-card p {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

/* Contact Section */
.contact {
    background-color: var(--gray-color);
}

.contact-content {
    display: flex;
    flex-wrap: wrap;
    gap: 4rem;
}

.contact-info, .contact-form {
    flex: 1;
    min-width: 30rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 3rem;
}

.contact-icon {
    width: 5rem;
    height: 5rem;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 2rem;
    color: white;
    font-size: 2rem;
}

.contact-text h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-light);
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--primary-color);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 500;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 1.2rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-family: var(--font-primary);
    font-size: 1.6rem;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ==============================
   6. FOOTER
   ============================== */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 5rem 0 2rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 4rem;
    gap: 3rem;
}

.footer-logo h2 {
    font-size: 2.4rem;
    color: white;
    margin-bottom: 1rem;
}

.footer-logo p {
    color: #aaa;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 1rem;
}

.footer-links a {
    color: #aaa;
}

.footer-links a:hover {
    color: white;
}

.footer-social {
    display: flex;
    gap: 2rem;
}

.footer-social a {
    width: 4rem;
    height: 4rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.8rem;
    transition: var(--transition);
}

.footer-social a:hover {
    background-color: var(--primary-color);
    transform: translateY(-5px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1.4rem;
}

/* ==============================
   7. RESPONSIVE DESIGN
   ============================== */
@media screen and (max-width: 1024px) {
    html {
        font-size: 55%;
    }
    
    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    /* Timeline adjustments */
    .timeline::after {
        display: none;
    }
    
    .timeline-dot {
        display: none;
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 0;
        padding-right: 0;
        margin-bottom: 3rem;
        left: 0 !important;
    }
    
    .timeline-item:nth-child(even) {
        left: 0;
    }
    
    .timeline-date {
        position: relative;
        left: 0;
        right: auto;
        top: 0;
        display: inline-block;
        margin-bottom: 1rem;
        z-index: 2;
    }
    
    .timeline-item:nth-child(even) .timeline-date {
        left: 0;
    }
    
    .timeline-content {
        margin-top: 0;
    }
}

@media screen and (max-width: 768px) {
    html {
        font-size: 50%;
    }
    
    body {
        overflow-x: hidden;
    }
    
    /* Logo size adjustment */
    .logo img {
        max-height: 3.8rem;
    }
    
    .scrolled .logo img {
        max-height: 3.2rem;
    }
    
    /* Mobile Navigation */
    .burger {
        display: block;
    }
    
    .nav-links {
        position: fixed;
        right: 0;
        top: 0;
        background-color: white;
        height: 100vh;
        width: 75%;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 3rem 2rem 2rem 2rem;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.77, 0.2, 0.05, 1.0);
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        text-align: center;
    }
    
    .nav-links li {
        margin: 1rem 0;
        width: 100%;
        text-align: center;
    }
    
    .nav-links a {
        font-size: 1.8rem;
        display: block;
        padding: 1rem 0;
        text-align: center;
    }
    
    .nav-links a::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .nav-links a:hover::after {
        width: 5rem;
    }
    
    .nav-active {
        transform: translateX(0%);
        overflow-y: auto;
    }
    
    /* Show mobile-specific elements */
    .mobile-menu-logo, 
    .close-mobile-menu {
        display: block;
    }
    
    /* Animated Burger */
    .toggle .line1 {
        transform: rotate(-45deg) translate(-0.5rem, 0.6rem);
        width: 2.5rem;
    }
    
    .toggle .line2 {
        opacity: 0;
        transform: translateX(-2rem);
    }
    
    .toggle .line3 {
        transform: rotate(45deg) translate(-0.5rem, -0.6rem);
        width: 2.5rem;
    }
    
    /* Other mobile adjustments */
    .section-padding {
        padding: 7rem 0;
    }
    
    .contact-content {
        flex-direction: column;
    }
    
    .hero {
        height: auto;
        padding: 15rem 0 8rem;
    }
    
    .section-title {
        font-size: 3rem;
    }
    
    /* Animation for mobile nav links */
    @keyframes navLinkFade {
        from {
            opacity: 0;
            transform: translateX(50px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
}

@media screen and (max-width: 480px) {
    /* Very small screen adjustments */
    .hero-text h1 {
        font-size: 3.2rem;
    }
    
    .hero-text h2 {
        font-size: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .research-grid, 
    .collaborations-grid {
        grid-template-columns: 1fr;
    }
    
    .publications-filter {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-btn {
        width: 80%;
    }
    
    .nav-links {
        width: 100%;
    }
    
    .timeline-date {
        font-size: 1.2rem;
        padding: 0.4rem 1.2rem;
    }
}