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

body {
    font-family: Arial, sans-serif;
    color: #1F2937;
}

/* ===== NAVIGATION CONTAINER ===== */
.nav-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, #042240 0%, #024f9c 100%);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
    z-index: 1000;
    transition: all 0.4s ease;
}

/* Transparent blue when scrolled */
.nav-container.scrolled {
    background: linear-gradient(135deg, #0422407a 0%, #024f9c9c 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 102, 204, 0.2);
}

/* ===== MAIN HEADER ===== */
.main-header {
    display: grid;
    grid-template-columns: 1fr 2fr 2fr 1fr;
    grid-template-rows: auto auto;
    padding: 10px 0;
}

.logo {
    grid-column: 1;
    grid-row: 1 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    font-weight: bold;
    font-size: 20px;
}

.logo img {
    max-height: 100px;
    width: 100px;
}

.name {
    grid-column: 2 / 4;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.name h3 {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    color: #ffffff;
}

.search {
    grid-column: 4;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 20px;
    gap: 10px;
}

.search input {
    padding: 8px 12px;
    width: 180px;
    border: 2px solid rgb(255, 255, 255);
    background-color: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    font-size: 14px;
    color: #ffffff;
}

.search input::placeholder {
    color: rgb(255, 255, 255);
}

.search input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background-color: rgba(255, 255, 255, 0.25);
}

.search button {
    padding: 8px 12px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgb(255, 255, 255);
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search button:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* ===== HAMBURGER MENU (Hidden on Desktop) ===== */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 40px;
    height: 35px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 2001;
    transition: all 0.3s ease;
}

.hamburger-menu:hover {
    transform: scale(1.1);
}

.hamburger-menu span {
    width: 35px;
    height: 4px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

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

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

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

/* ===== MAIN MENU ===== */
.main-menu {
    grid-column: 1 / 5;
    grid-row: 2;
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 10px 20px;
    flex-wrap: wrap;
}

.main-menu a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.main-menu a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.main-menu a.active {
    background-color: rgba(255, 255, 255, 0.25);
    color: white;
}

/* ===== DROPDOWN NAVIGATION ===== */
.dropdown {
    position: relative;
    display: inline-block;
}

/* Dropdown Button */
.dropdown .dropbtn {
    background-color: transparent;
    color: #ffffff;
    font-weight: 600;
    padding: 8px 12px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.dropdown .dropbtn i {
    font-size: 10px;
    margin-left: 5px;
    transition: transform 0.3s ease;
}

/* Dropdown Button Hover */
.dropdown .dropbtn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

/* ===== CLICK-BASED DROPDOWN FUNCTIONALITY ===== */
/* Hide dropdown content by default */
.dropdown .dropdown-content {
    display: none;
}

/* Show dropdown content when active class is added */
.dropdown.active > .dropdown-content {
    display: block;
}

/* Ensure nested dropdowns work properly */
.dropdown .dropdown.active > .dropdown-content {
    display: block;
}

/* Dropdown Content Styling */
.dropdown-content {
    position: absolute;
    background-color: #ffffff;
    min-width: 240px;
    z-index: 1001;
    margin-top: 8px;
    opacity: 0;
    font-weight:600;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    overflow: hidden;
}

/* Show dropdown with animation when active */
.dropdown.active > .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* IMPORTANT: Create a triangular connector to prevent gap */
.dropdown-content::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 20px;
    width: 16px;
    height: 8px;
    background-color: transparent;
}

/* Dropdown Links */
.dropdown-content a {
    color: #1F2937;
    padding: 12px 20px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

/* Hover Effect on Dropdown Links */
.dropdown-content a:hover {
    color: rgb(0, 128, 255);
}

/* Rotate Arrow when dropdown is active */
.dropdown.active > .dropbtn i {
    transform: rotate(180deg);
}

/* ===== RESPONSIVE STYLES ===== */
@media screen and (max-width: 1024px) {
    .main-header {
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
    }
    
    .name {
        grid-column: 2;
    }
    
    .search {
        grid-column: 3;
    }
    
    .main-menu {
        grid-column: 1 / 4;
        gap: 15px;
    }
    
    .dropdown-content {
        min-width: 200px;
    }
}

/* ===== MOBILE NAVIGATION REDESIGN (≤768px) ===== */
@media screen and (max-width: 768px) {
    .main-header {
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
        padding: 12px 0;
    }
    
    /* Logo on top left */
    .logo {
        grid-column: 1;
        grid-row: 1;
        justify-content: flex-start;
        padding: 8px 15px;
        z-index: 2000;
    }
    
    .logo img {
        max-height: 45px;
    }
    
    /* Company name in center - NOW VISIBLE! */
    .name {
        grid-column: 2;
        grid-row: 1;
        display: flex;
        padding: 8px 10px;
    }
    
    .name h3 {
        font-size: 11px;
        line-height: 1.2;
        letter-spacing: 0.3px;
    }
    
    /* Hamburger menu on top right */
    .hamburger-menu {
        display: flex;
        grid-column: 3;
        grid-row: 1;
        padding: 10px 15px;
        z-index: 2001;
        width: 50px;
        height: 50px;
        align-items: center;
        justify-content: center;
    }
    
    .hamburger-menu span {
        width: 28px;
        height: 4px;
    }
    
    /* Search bar on bottom row - FULL WIDTH */
    .search {
        grid-column: 1 / 4;
        grid-row: 2;
        justify-content: center;
        padding: 8px 15px;
        gap: 8px;
        z-index: 2000;
    }
    
    .search input {
        flex: 1;
        max-width: 500px;
        width: 100%;
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .search button {
        padding: 10px 15px;
        font-size: 16px;
    }
    
    /* Main menu - SLIDE-OUT SIDEBAR */
    .main-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: linear-gradient(180deg, #042240 0%, #024f9c 100%);
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 80px 0 20px 0;
        gap: 0;
        overflow-y: auto;
        transition: right 0.3s ease;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
        z-index: 1999;
    }
    
    .main-menu.active {
        right: 0;
    }
    
    .main-menu a,
    .dropdown {
        width: 100%;
        display: block;
    }
    
    .main-menu a {
        padding: 15px 25px;
        font-size: 15px;
        border-radius: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .main-menu a.active {
        background-color: rgba(255, 255, 255, 0.15);
        border-left: 4px solid #0080ff;
    }
    
    .dropdown .dropbtn {
        width: 100%;
        text-align: left;
        padding: 15px 25px;
        border-radius: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    /* Mobile dropdown content */
    .dropdown-content {
        position: static;
        background-color: rgba(0, 0, 0, 0.2);
        width: 100%;
        transform: none;
        margin-top: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .dropdown.active > .dropdown-content {
        max-height: 500px;
        opacity: 1;
        visibility: visible;
    }
    
    .dropdown-content::before {
        display: none;
    }
    
    .dropdown-content a {
        color: #ffffff;
        padding: 12px 25px 12px 45px;
        font-size: 14px;
        border-left: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .dropdown-content a:hover {
        background-color: rgba(255, 255, 255, 0.1);
        padding-left: 50px;
    }
    
    /* Overlay when menu is open */
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1998;
    }
    
    .menu-overlay.active {
        display: block;
    }
}

/* Small phones - Samsung A05, iPhone SE, etc. (360px-480px) */
@media screen and (max-width: 480px) {
    .logo img {
        max-height: 40px;
    }
    
    .name h3 {
        font-size: 10px;
    }
    
    .search input {
        padding: 9px 12px;
        font-size: 13px;
    }
    
    .search button {
        padding: 9px 12px;
        font-size: 15px;
    }
    
    .hamburger-menu {
        width: 48px;
        height: 48px;
    }
    
    .main-menu {
        width: 260px;
    }
    
    .main-menu a {
        padding: 13px 20px;
        font-size: 14px;
    }
    
    .dropdown .dropbtn {
        padding: 13px 20px;
    }
}

/* Extra small devices - Galaxy Fold, very small iPhones (≤360px) */
@media screen and (max-width: 360px) {
    .logo {
        padding: 8px 10px;
    }
    
    .logo img {
        max-height: 35px;
    }
    
    .name h3 {
        font-size: 9px;
    }
    
    .hamburger-menu {
        width: 45px;
        height: 45px;
    }
    
    .hamburger-menu span {
        width: 24px;
        height: 3px;
    }
    
    .search {
        padding: 8px 10px;
    }
    
    .search input {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .search button {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    .main-menu {
        width: 240px;
    }
    
    .main-menu a {
        padding: 12px 18px;
        font-size: 13px;
    }
}