/* =========================================================
   EMBEDDED PROJECTS — header.css
   Theme: Technical / Industrial — deep navy + electric blue
   ========================================================= */

/* ----------  Google Font import  ---------- */
@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@400;600;700;900&family=Share+Tech+Mono&display=swap');

/* ----------  CSS Variables  ---------- */
:root {
    --clr-navy:      #020e38;
    --clr-blue:      #1a6fc4;
    --clr-sky:       #8bdbfb;
    --clr-white:     #ffffff;
    --clr-dark:      #111827;
    --clr-mid:       #374151;
    --clr-accent:    #00c6ff;
    --clr-danger:    #c0392b;
    --font-main:     'Exo 2', sans-serif;
    --font-mono:     'Share Tech Mono', monospace;
    --transition:    0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm:     0 2px 8px rgba(0,0,0,0.12);
    --shadow-md:     0 4px 20px rgba(0,0,0,0.18);
    --shadow-lg:     0 8px 40px rgba(0,0,0,0.25);
    --radius:        8px;
}

/* ----------  Page-level reset & font  ---------- */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    background-color: #f4f7fb;
    overflow-x: hidden; /* Prevent horizontal scroll on mobile */
}

/* ----------  Page fade-in  ---------- */
@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   HEADER — shared base styles (applied at all widths)
   ========================================================= */
.main_header {
    font-family: var(--font-main);
    position: sticky;
    top: 0;
    z-index: 500;
    transition: box-shadow var(--transition), padding var(--transition);
}

/* Shrink header on scroll (applied via JS class .scrolled) */
.main_header.scrolled {
    box-shadow: var(--shadow-md);
}

.main_logo img {
    transition: transform 0.4s ease;
    display: block;
}
.main_logo img:hover {
    transform: rotate(15deg) scale(1.1);
}

/* Contact Us button — base */
.main_contact_us {
    cursor: pointer;
    transition: background-color var(--transition),
                transform var(--transition),
                box-shadow var(--transition);
    font-family: var(--font-main);
}
.main_contact_us:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 98, 179, 0.4);
}
.main_contact_us:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Nav links — shared transition */
.main_menu_list a {
    transition: background-color var(--transition),
                color var(--transition),
                transform var(--transition);
    font-family: var(--font-main);
    position: relative;
}

/* Active nav link */
.main_menu_list a.nav-active {
    font-weight: 900;
    color: var(--clr-accent) !important;
}
.main_menu_list a.nav-active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 10%;
    width: 80%;
    height: 3px;
    background: var(--clr-accent);
    border-radius: 2px;
}

/* =========================================================
   SOCIAL MEDIA BAR — shared
   ========================================================= */

/* Tooltip */

/* =========================================================
   SCROLL-TO-TOP BUTTON
   ========================================================= */
#scrollToTopBtn {
    display: none;
    position: fixed;
    bottom: 2rem;
    right: 1rem;
    z-index: 600;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--clr-navy);
    color: var(--clr-white);
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: background var(--transition),
                transform var(--transition),
                opacity 0.3s ease;
    opacity: 0.85;
}
#scrollToTopBtn:hover {
    background: var(--clr-blue);
    transform: translateY(-3px);
    opacity: 1;
}
#scrollToTopBtn.visible {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pageFadeIn 0.3s ease both;
}

/* =========================================================
   MOBILE  (max-width: 480px)
   ========================================================= */
@media (max-width: 480px) {

    /* Header bar — logo + title + hamburger in one row */
    .main_header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 2% 3%;
        min-height: 14vw;
        background-color: var(--clr-sky);
        border-bottom: 2px solid var(--clr-navy);
        box-sizing: border-box;
        width: 100%;
        position: relative;
    }

    .main_logo { order: 1; flex-shrink: 0; }

    .main_logo img {
        width: 10vw;
        height: 10vw;
        min-width: 34px;
        min-height: 34px;
        margin-left: 0;
    }

    /* Logo + title sit together as a flex group on the left */
    .logo-container {
        display: flex;
        align-items: center;
        flex-shrink: 0;
        order: 1;
    }

    #website_title {
        order: 2;
        flex-shrink: 0;      /* never shrink — always show full brand name */
        margin-left: 2%;
    }

    .main_website_title {
        font-size: 4.2vw;
        font-weight: 900;
        text-align: left;
        color: var(--clr-navy);
        font-family: var(--font-main);
        white-space: nowrap;  /* single line */
        overflow: visible;    /* never clip */
        text-overflow: unset; /* no ellipsis */
        line-height: 1.2;
    }

    /* Spacer pushes hamburger to the right */
    .main_header .horizontal_stripe {
        flex: 1; /* take remaining space as invisible spacer */
    }

    /* Hide Contact Us button on mobile — replaced by hamburger menu */
    .main_right_side {
        display: none;
    }

    /* Remove the blue ribbon on mobile — not needed, hamburger is in header bar */
    .horizontal_stripe {
        display: none;
    }

    /* Hamburger button — sits inside .main_header on the right */
    .menu_button {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 10vw;
        height: 10vw;
        min-width: 40px;
        min-height: 40px;
        background-color: var(--clr-navy);
        color: var(--clr-white);
        font-size: 5.5vw;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        transition: background var(--transition), transform 0.15s ease;
        flex-shrink: 0;
        order: 3;
    }
    .menu_button:active,
    .menu_button.open {
        background-color: rgba(255,255,255,0.32);
        transform: scale(0.95);
    }
    /* Icon swap burger → X */
    .menu_button .fa-bars   { display: inline; }
    .menu_button .fa-times  { display: none; }
    .menu_button.open .fa-bars  { display: none; }
    .menu_button.open .fa-times { display: inline; }

    /* Dropdown menu — drops from the header bar, top-right corner */
    /* Mobile dropdown — separate element outside header, not affected by stripe display:none */
    .mobile_menu_dropdown {
        display: none;
        position: fixed;
        top: 15vw;
        right: 0;
        width: 65vw;
        min-width: 200px;
        z-index: 1000;
        flex-direction: column;
        background: var(--clr-navy);
        border-radius: 0 0 0 12px;
        box-shadow: -4px 6px 24px rgba(0,0,0,0.4);
    }
    .mobile_menu_dropdown.open {
        display: flex;
    }
    .mobile_menu_dropdown a {
        display: block;
        padding: 4% 6%;
        font-size: 4.5vw;
        font-weight: 600;
        color: var(--clr-white);
        text-decoration: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        letter-spacing: 0.02em;
        font-family: var(--font-main);
        transition: background-color 0.15s ease, padding-left 0.15s ease;
    }
    .mobile_menu_dropdown a:last-child {
        border-bottom: none;
        border-radius: 0 0 0 12px;
    }
    .mobile_menu_dropdown a:active {
        background-color: var(--clr-blue);
        padding-left: 9%;
    }
    .mobile_menu_dropdown a.nav-active {
        background-color: rgba(255,255,255,0.15);
        border-left: 3px solid var(--clr-accent);
    }

    /* Social bar */
}

/* =========================================================
   TABLET  (481px – 1000px)
   ========================================================= */
@media (min-width: 481px) and (max-width: 1000px) {

    .main_header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5% 1%;
        background-color: var(--clr-sky);
        border-bottom: 2px solid var(--clr-navy);
    }

    .main_logo { order: 1; }
    .main_logo img {
        width: 50px;
        height: 50px;
        margin-left: 10px;
        margin-top: 4px;
    }

    .main_website_title {
        order: 2;
        font-size: 3.5vw;
        font-weight: 900;
        margin-left: 1vw;
        color: var(--clr-navy);
        font-family: var(--font-main);
    }

    .main_right_side { order: 3; display: flex; }

    .main_contact_us {
        height: 4vw;
        width: 13vw;
        font-size: 1.5vw;
        font-weight: 700;
        border: none;
        border-radius: 20px;
        background-color: var(--clr-navy);
        color: var(--clr-white);
    }

    .horizontal_stripe {
        display: block;
        background: linear-gradient(90deg, var(--clr-navy), var(--clr-blue));
        width: 100%;
        height: 4vw;
        padding: 5px;
    }

    .menu_button { display: none; }
    .mobile_menu_dropdown { display: none !important; }

    .main_menu_list {
        display: flex;
        justify-content: space-around;
        margin: 0;
        padding: 0;
    }
    .main_menu_list a {
        font-size: 1.8vw;
        font-weight: 700;
        color: var(--clr-white);
        text-decoration: none;
        text-align: center;
        padding: 0.3vw 0.5vw;
        border-radius: 4px;
        letter-spacing: 0.02em;
    }
    .main_menu_list a:hover {
        background-color: rgba(255,255,255,0.2);
        color: var(--clr-white);
    }

    /* Social bar — fixed vertical column on right */
}

/* =========================================================
   SHORT SCREENS
   ========================================================= */
@media (max-height: 480px) {
}

/* =========================================================
   DESKTOP  (min-width: 1001px)
   ========================================================= */
@media (min-width: 1001px) {

    .main_header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.4% 1%;
        background-color: var(--clr-sky);
        border-bottom: 2px solid var(--clr-navy);
    }

    .main_logo { order: 1; }
    .main_logo img {
        width: 4vw;
        height: 4vw;
        margin-left: 1vw;
    }

    #website_title { width: 14vw; }
    .main_website_title {
        order: 2;
        font-size: 2vw;
        font-weight: 900;
        margin-left: 1vw;
        color: var(--clr-navy);
        font-family: var(--font-main);
        letter-spacing: -0.02em;
    }

    .horizontal_stripe {
        display: block;
        background: linear-gradient(90deg, var(--clr-navy) 0%, var(--clr-blue) 100%);
        width: 80%;
        padding: 5px;
    }

    .menu_button { display: none; }
    .mobile_menu_dropdown { display: none !important; }

    .main_menu_list {
        display: flex;
        justify-content: space-around;
        margin: 0;
        padding: 0;
    }
    .main_menu_list a {
        font-size: 1.1vw;
        font-weight: 700;
        color: var(--clr-white);
        text-decoration: none;
        text-align: center;
        padding: 0.3vw 0.8vw;
        border-radius: 4px;
        letter-spacing: 0.03em;
    }
    .main_menu_list a:hover {
        background-color: rgba(255,255,255,0.18);
        transform: translateY(-1px);
    }
    .main_menu_list a.nav-active {
        background-color: rgba(255,255,255,0.25);
        color: var(--clr-white) !important;
    }
    .main_menu_list a.nav-active::after {
        background: var(--clr-white);
        bottom: -2px;
    }

    .main_right_side { order: 3; display: flex; align-items: center; }
    .contact_us { display: flex; order: 3; }

    .main_contact_us {
        height: 2.4vw;
        width: 8vw;
        font-size: 0.85vw;
        font-weight: 700;
        border: none;
        border-radius: 25px;
        background-color: var(--clr-navy);
        color: var(--clr-white);
        letter-spacing: 0.04em;
    }
    .main_contact_us:hover {
        background-color: var(--clr-blue);
    }

    /* Social bar — fixed vertical column on right */

    /* ----  Login modal  ---- */
    .modal {
        display: none;
        position: fixed;
        z-index: 900;
        left: 0; top: 0;
        width: 100%; height: 100%;
        overflow: auto;
        background-color: rgba(0,0,0,0.5);
        padding-top: 60px;
    }
    .modal-content {
        background: var(--clr-white);
        margin: 5% auto;
        border-radius: var(--radius);
        width: 80%;
        max-width: 30%;
        box-shadow: var(--shadow-lg);
        padding: 2%;
        animation: pageFadeIn 0.3s ease both;
    }
    .close {
        position: absolute;
        right: 10%; top: 0;
        color: var(--clr-white);
        font-size: 3vw;
        font-weight: bold;
        cursor: pointer;
        transition: color var(--transition);
    }
    .close:hover { color: var(--clr-danger); }

    input[type=text], input[type=password] {
        width: 100%; padding: 3%; margin: 2%;
        border: 1px solid #ccc;
        border-radius: 4px;
        box-sizing: border-box;
        font-family: var(--font-main);
        transition: border-color var(--transition), box-shadow var(--transition);
    }
    input[type=text]:focus, input[type=password]:focus {
        outline: none;
        border-color: var(--clr-blue);
        box-shadow: 0 0 0 3px rgba(26,111,196,0.15);
    }
    button {
        background-color: #04AA6D;
        color: var(--clr-white);
        padding: 2%; margin: 2%;
        border: none; cursor: pointer;
        width: 100%; font-size: 1vw;
        border-radius: 4px;
        font-family: var(--font-main);
        font-weight: 700;
        transition: background var(--transition), transform var(--transition);
    }
    button:hover { opacity: 0.88; transform: translateY(-1px); }
    button:active { transform: translateY(0); }

    .cancelbtn {
        width: auto; padding: 2%;
        background-color: var(--clr-danger);
    }
    .login_container, .login_bottom_container { padding: 1%; }
    span.psw { float: right; padding-top: 16px; }

    .animate {
        animation: animatezoom 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
    }
    @keyframes animatezoom {
        from { transform: scale(0.7); opacity: 0; }
        to   { transform: scale(1);   opacity: 1; }
    }
}

/* =========================================================
   MOBILE SPECIFIC OVERRIDES
   ========================================================= */

/* Move scroll-to-top to left on mobile so it doesn't overlap social bar */
@media (max-width: 480px) {
    #scrollToTopBtn {
        right: auto;
        left: 1rem;
        bottom: 1.5rem;
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    /* Social bar — fixed at viewport center-right on mobile, JS toggles visibility */

}

/* Tablet/desktop — fixed at vertical center on the right, always visible */
@media (min-width: 481px) {

}

/* Tablet — scroll-to-top back to normal right position */
@media (min-width: 481px) and (max-width: 1000px) {
    #scrollToTopBtn {
        right: 1rem;
        bottom: 1.5rem;
    }
}

/* Disable hover transforms on touch devices to prevent sticky states */
@media (hover: none) {
    .project-box:hover,
    .Embedded-box:hover,
    .Tutorial-box:hover,
    .Programming-box:hover,
    .Articles-box:hover,
    .product:hover {
        transform: none;
        box-shadow: none;
    }
    .product:hover img {
        transform: none;
    }
    .main_menu_list a:hover {
        transform: none;
    }
}

/* =========================================================
   MOBILE ANIMATIONS  (max-width: 480px)
   ========================================================= */
@media (max-width: 480px) {

    /* --- Page entrance --- */
    @keyframes mobilePageIn {
        from { opacity: 0; transform: translateY(12px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    /* --- Logo tap spin --- */
    .main_logo img {
        transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
    }
    .main_logo:active img {
        transform: rotate(20deg) scale(1.12);
    }

    /* --- Hamburger button press --- */
    .menu_button {
        transition: background-color 0.15s ease,
                    transform 0.15s cubic-bezier(0.34,1.56,0.64,1);
    }
    .menu_button:active {
        transform: scale(0.88);
        background-color: var(--clr-blue);
    }

    /* --- Mobile dropdown entrance --- */
    @keyframes dropdownSlideIn {
        from { opacity: 0; transform: translateY(-10px) scaleY(0.95); }
        to   { opacity: 1; transform: translateY(0) scaleY(1); }
    }
    .mobile_menu_dropdown.open {
        animation: dropdownSlideIn 0.22s cubic-bezier(0.34,1.56,0.64,1) both;
        transform-origin: top right;
    }

    /* --- Nav link tap feedback --- */
    .mobile_menu_dropdown a {
        transition: background-color 0.12s ease,
                    padding-left 0.15s ease,
                    transform 0.12s ease;
        position: relative;
        overflow: hidden;
    }
    .mobile_menu_dropdown a:active {
        background-color: var(--clr-blue);
        padding-left: 9%;
        transform: scale(0.98);
    }

    /* Nav link tap ripple */
    .mobile_menu_dropdown a::after {
        content: '';
        position: absolute;
        inset: 0;
        background: rgba(255,255,255,0.12);
        opacity: 0;
        transition: opacity 0.2s ease;
    }
    .mobile_menu_dropdown a:active::after {
        opacity: 1;
    }

    /* --- Social bar icons bounce on tap --- */

    /* --- Scroll-to-top button entrance --- */
    #scrollToTopBtn.visible {
        animation: mobilePageIn 0.25s ease both;
    }
    #scrollToTopBtn:active {
        transform: scale(0.9);
    }
}

/* =========================================================
   MOBILE ANIMATIONS — shared content pages
   Applied via shared-content.css additions below
   ========================================================= */