/* ===============================
   CLEAN PROFESSIONAL NAVBAR
=============================== */
.navbar {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 12px 25px;
    background: #0b0b0b;
    border-bottom: 1px solid #1b1b1b;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
}

/* FLEX */
.nav-left { flex: 1; }
.nav-center {
    flex: 2;
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 40px;
    margin: 0;
    padding: 0;
}
.nav-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-right: 40px;
}

/* LOGO */
.nav-left .nav-logo img {
    height: 55px;
    width: 55px;
    object-fit: cover;
}

/* CENTER MENU */
.nav-center li a,
.dropdown-btn {
    font-family: "Kanit", sans-serif;
    color: #ffffff;
    font-size: 17px;
    text-decoration: none;
    cursor: pointer;
    height: 32px;
    display: flex;
    align-items: center;
}

.nav-center li a:hover,
.dropdown-btn:hover {
    color: #d33;
}

/* ===============================
   UNIVERSAL DROPDOWN STYLE
=============================== */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 38px;
    left: 0;
    width: 180px;
    background: #111;
    border: 1px solid #222;
    border-radius: 8px;

    list-style: none;
    padding: 0;
    margin: 0;

    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-5px);

    transition:
        max-height 0.25s ease,
        opacity 0.25s ease,
        transform 0.25s ease;
}

.dropdown.active .dropdown-menu {
    max-height: 600px;
    opacity: 1;
    transform: translateY(0);
}

.dropdown.active .arrow {
    transform: rotate(180deg);
}

/* ===============================
   PROFILE DROPDOWN – FIX ALL BORDER LINES
=============================== */

/* กล่อง dropdown */
.profile-dropdown .dropdown-menu {
    right: 0 !important;
    left: auto !important;
    width: 200px;
    background: #0f0f0f !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 8px;
    overflow: hidden !important;
    box-shadow: 0 0 12px rgba(0,0,0,0.4);
}

/* รายการด้านใน */
.profile-dropdown .dropdown-menu li {
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ปุ่มแต่ละแถว */
.profile-dropdown .dropdown-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px !important;

    font-family: "Kanit", sans-serif;
    font-size: 15px;
    color: #ddd;

    background: transparent !important;
    border: none !important;
    border-bottom: none !important;
    outline: none !important;

    transition: 0.15s;
}

/* Hover effect */
.profile-dropdown .dropdown-menu li a:hover {
    background: rgba(255,0,0,0.18) !important;
    color: #fff !important;
}

/* ไอคอน */
.profile-dropdown .dropdown-menu li a i {
    width: 22px;
    text-align: center;
    font-size: 16px;
    color: #ccc;
}

.profile-dropdown .dropdown-menu li a:hover i {
    color: #ff4444;
}

/* ปิดทุก pseudo-element ที่สร้างเส้น */
.profile-dropdown .dropdown-menu li a::before,
.profile-dropdown .dropdown-menu li a::after,
.profile-dropdown .dropdown-menu::before,
.profile-dropdown .dropdown-menu::after {
    display: none !important;
    border: none !important;
    content: "" !important;
}

/* ===============================
   DOWNLOAD BUTTON
=============================== */
.btn-download {
    background: #d40000;
    color: white;
    padding: 10px 25px;
    font-family: "Kanit", sans-serif;
    font-size: 17px;
    border-radius: 8px;
    text-decoration: none;
}
.btn-download:hover {
    background: #b30000;
}

/* ACTIVE STATE */
.nav-center a.active,
.dropdown.active > .dropdown-btn {
    color: #ff2b2b !important;
    font-weight: 600;
}

.dropdown.active > .dropdown-btn::after {
    content: "";
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #ff2b2b;
    border-radius: 2px;
}
/* เอาเส้นใต้ลิงก์ออกจาก dropdown profile */
.profile-dropdown .dropdown-menu li a {
    text-decoration: none !important;
}


/* ปรับช่องไฟเมนู dropdown ทั้งหมด */
.dropdown .dropdown-menu li a {
    display: flex !important;
    align-items: center;
    gap: 12px !important;     /* ⭐ ระยะห่างระหว่างไอคอนกับข้อความ */
    padding: 10px 16px !important;
}

/* ไอคอนใน dropdown */
.dropdown .dropdown-menu li a i {
    width: 20px !important;    /* ⭐ ให้ไอคอนอยู่ในพื้นที่เท่ากัน */
    text-align: center;
    font-size: 16px;
}
.navbar .arrow {
    font-size: 10px;     /* ขนาดเล็กกำลังดี */
    margin-left: 4px;    /* ระยะห่างตัวหนังสือ */
    opacity: 0.7;
    transition: 0.2s;
}

/* หมุนตอนเปิด dropdown */
.dropdown.active .arrow {
    transform: rotate(180deg);
    opacity: 1;
}
/* ===============================
   MOBILE RESPONSIVE NAVBAR
   (รวมครบทุกอย่างของ toggle)
=============================== */
@media (max-width: 768px) {

    /* ปุ่ม Toggle */
    .nav-toggle {
        display: flex !important;
        justify-content: center;
        align-items: center;
        width: 34px;
        height: 34px;
        font-size: 24px;
        color: #fff;

        margin: 0 !important;
        padding: 0 !important;

        position: relative;
        right: 0 !important;
        z-index: 9999 !important;
        cursor: pointer;
    }

    /* ปรับ nav-right ให้ปุ่มไม่ล้น */
    .nav-right {
        display: flex !important;
        justify-content: flex-end !important;
        align-items: center !important;

        max-width: 100% !important;
        overflow: hidden !important;

        padding-right: 30px !important;  /* ⭐ ขยับเข้า */
        padding-left: 0 !important;
        margin: 0 !important;
    }


    /* ซ่อนทุกอย่างใน nav-right ยกเว้น toggle */
    .nav-right > *:not(.nav-toggle) {
        display: none !important;
    }

    /* ซ่อนเมนู desktop */
    .nav-center {
        position: fixed;
        top: 65px;
        left: 0;

        width: 100%;
        background: #0b0b0b;
        border-top: 1px solid #1b1b1b;

        flex-direction: column;
        gap: 0;
        overflow: hidden;

        max-height: 0;
        transition: max-height 0.25s ease;
    }

    /* เมื่อกด toggle ให้โชว์เมนู */
    .nav-center.show {
        max-height: 450px;
    }

    /* สไตล์เมนูแต่ละบรรทัดในมือถือ */
    .nav-center li {
        width: 100% !important;
        text-align: left !important; /* ถ้าต้องการซ้าย */
        padding: 14px 20px !important;
        border-bottom: 1px solid #181818;
    }

    /* Dropdown menu ภายในมือถือ */
    .dropdown-menu {
        position: relative !important;
        width: 100% !important;
        border: none !important;
        background: #111 !important;

        max-height: 0;
        overflow: hidden;

        transition: max-height 0.25s ease;
    }

    .dropdown.active .dropdown-menu {
        max-height: 300px;
    }
}
@media (max-width: 768px) {

    /* ยกเลิก position:absolute ของ desktop dropdown */
    .dropdown-menu {
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;

        border: none !important;
        border-radius: 0 !important;

        background: #111 !important;
        overflow: hidden !important;

        max-height: 0 !important;
        transition: max-height 0.25s ease !important;
    }

    /* ตอนเปิดเมนูย่อย */
    .dropdown.active .dropdown-menu {
        max-height: 800px !important;
        opacity: 1 !important;
    }
}
/* ซ่อน toggle บนหน้าจอใหญ่ (Desktop) */
.nav-toggle {
    display: none;
}
