/* ============================================================
   GLOBAL.CSS — Shared styles for all pages
   Teliti Infotech SDN BHD
   ============================================================ */

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

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

/* ---------- Scroll Animations ---------- */
section, main {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1.5s ease-out, transform 1.5s ease-out;
}

.section-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Header ---------- */
header {
    background-color: #ffffff;
    padding: 10px 0;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    height: auto;
    transition: top 0.3s ease;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.logo-text-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.logo img {
    width: 80px;
    height: auto;
}

.company-name {
    font-size: 1rem;
    font-weight: 700;
    font-family: 'garet', sans-serif;
    color: #333;
    white-space: normal;
    line-height: 1.2;
    max-width: 150px;
}

/* ---------- Hamburger ---------- */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
    z-index: 1001;
}

.hamburger span {
    height: 3px;
    width: 25px;
    background: #333;
    margin: 3px 0;
    border-radius: 3px;
    transition: 0.3s;
}

/* ---------- Navigation ---------- */
nav {
    display: flex;
    align-items: center;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 5px;
}

nav ul li a {
    text-decoration: none;
    color: #333;
    font-weight: 600;
    font-family: 'garet', sans-serif;
    font-size: 0.9rem;
    padding: 8px 12px;
    transition: background 0.3s, color 0.3s;
    border-radius: 15px;
    display: block;
}

nav ul li a:hover,
nav ul li a.active-link {
    background-color: #007bff;
    color: white;
}

/* ---------- Footer ---------- */
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 20px 15px;
    margin-top: 0;
}

footer p {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
}

/* ---------- Accessibility: Screen-reader only ---------- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================================
   RESPONSIVE — Tablet (768px+)
   ============================================================ */
@media (min-width: 768px) {
    header {
        padding: 15px 0;
        height: 100px;
    }

    .logo img {
        width: 120px;
    }

    .company-name {
        font-size: 1.8rem;
        max-width: none;
        white-space: nowrap;
    }

    nav ul {
        gap: 10px;
    }

    nav ul li a {
        font-size: 1.1rem;
        padding: 10px 18px;
    }
}

/* ============================================================
   RESPONSIVE — Desktop (1024px+)
   ============================================================ */
@media (min-width: 1024px) {
    .header-container {
        padding: 0 20px;
    }

    .logo-text-wrapper {
        gap: 30px;
    }

    .company-name {
        font-size: 2rem;
    }

    nav ul {
        gap: 0;
    }

    nav ul li a {
        font-size: 1.2rem;
        padding: 12px 20px;
    }
}

/* ============================================================
   RESPONSIVE — Mobile Navigation (max 767px)
   ============================================================ */
@media (max-width: 767px) {
    .hamburger {
        display: flex;
    }

    nav ul {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: white;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: 80px;
        transition: right 0.3s ease;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        gap: 0;
    }

    nav ul.active {
        right: 0;
    }

    nav ul li {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid #f0f0f0;
    }

    nav ul li a {
        padding: 15px 20px;
        font-size: 1.1rem;
        border-radius: 0;
        display: block;
        width: 100%;
    }

    nav ul li a:hover {
        background-color: #007bff;
        color: white;
    }

    /* Hamburger → X animation */
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
    }

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

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -8px);
    }

    /* Overlay */
    .overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .overlay.active {
        display: block;
    }
}
