/* ลบทุกอย่างในไฟล์ navigation.css และเขียนใหม่ทั้งหมด */

/* =========================================
   NAVIGATION STYLES - 4HYPER-X CLONE
   ========================================= */

/* =========================================
   HEADER NAVIGATION
   ========================================= */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.95) 0%, rgba(25, 25, 25, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(232, 199, 66, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: var(--z-fixed);
    transition: all 0.3s ease;
}

.header.scrolled {
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.98) 0%, rgba(25, 25, 25, 0.98) 100%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.navbar {
    padding: 1rem 0;
    position: relative;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    max-width: 1400px;
}

/* Logo */
.navbar-brand {
    z-index: var(--z-modal);
    flex-shrink: 0;
}

.logo img {
    height: 40px;
    width: auto;
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: scale(1.05);
}

/* Navigation Menu */
.navbar-menu {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 900px;
    margin: 0 auto;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
    flex-wrap: nowrap;
    justify-content: center;
}

.nav-item {
    position: relative;
    flex-shrink: 0;
}

.nav-link {
    color: var(--light-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.5rem 0.8rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    min-height: 36px;
}

.nav-link:hover {
    background: rgba(232, 199, 66, 0.1);
    color: var(--secondary-color);
}

.nav-link.active {
    background: var(--gradient-primary);
    color: var(--light-text);
}

/* Navigation Icons */
.nav-icon {
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.nav-link:hover .nav-icon {
    transform: scale(1.1);
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    position: relative;
    padding-right: 2rem;
}

.dropdown-toggle::after {
    content: '▼';
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-toggle::after {
    transform: translateY(-50%) rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: linear-gradient(135deg, rgba(25, 25, 25, 0.95) 0%, rgba(45, 45, 45, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(232, 199, 66, 0.2);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: var(--z-dropdown);
    margin-top: 0.5rem;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    color: var(--light-text);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 0.25rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.dropdown-item span:first-child {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.dropdown-item:hover {
    background: rgba(232, 199, 66, 0.1);
    color: var(--secondary-color);
    transform: translateX(5px);
}

/* Navbar Actions */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    z-index: var(--z-modal);
    flex-shrink: 0;
}

.navbar-actions .btn {
    padding: 0.5rem 1rem;
    border-radius: 18px;
    font-weight: 600;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.navbar-actions .btn span:first-child {
    font-size: 0.9rem;
    flex-shrink: 0;
}

.navbar-actions .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.navbar-actions .btn:hover::before {
    left: 100%;
}

.navbar-actions .btn-outline {
    background: transparent;
    color: var(--light-text);
    border-color: var(--light-text);
}

.navbar-actions .btn-outline:hover {
    background: var(--light-text);
    color: var(--dark-bg);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.2);
}

.navbar-actions .btn-primary {
    background: var(--gradient-primary);
    color: var(--light-text);
    border-color: var(--primary-color);
}

.navbar-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(232, 199, 66, 0.4);
    background: var(--gradient-secondary);
}

/* Mobile Toggle Button */
.navbar-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: var(--z-modal);
}

.navbar-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--light-text);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.navbar-toggle:hover span {
    background: var(--secondary-color);
}

.navbar-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
    background: var(--secondary-color);
}

.navbar-toggle.active span:nth-child(2) {
    opacity: 0;
}

.navbar-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
    background: var(--secondary-color);
}

/* =========================================
   MOBILE BOTTOM NAVIGATION
   ========================================= */

.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.95) 0%, rgba(25, 25, 25, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 2px solid rgba(232, 199, 66, 0.3);
    box-shadow: 0 -6px 25px rgba(0, 0, 0, 0.3);
    z-index: var(--z-fixed);
    
    /* ซ่อนใน desktop */
    display: none;
    
    /* ออโต้ Responsive */
    padding: min(4vw, 0.75rem) min(2vw, 0.5rem) calc(min(4vw, 0.75rem) + env(safe-area-inset-bottom));
    min-height: clamp(60px, 15vw, 75px);
    gap: min(2vw, 0.5rem);
    
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(45, 45, 45, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    
    /* ออโต้ Responsive */
    padding: min(3vw, 0.5rem) min(2vw, 0.25rem);
    border-radius: min(3vw, 12px);
    margin: 0 min(1vw, 0.25rem);
    min-height: clamp(45px, 12vw, 60px);
    max-width: clamp(60px, 18vw, 85px);
    
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.mobile-bottom-nav .nav-icon {
    font-size: clamp(1.125rem, 4vw, 1.5rem);
    margin-bottom: min(2vw, 0.25rem);
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(24px, 8vw, 32px);
    height: clamp(24px, 8vw, 32px);
    border-radius: min(2vw, 8px);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.mobile-bottom-nav .nav-icon img {
    width: clamp(20px, 7vw, 28px);
    height: clamp(20px, 7vw, 28px);
    object-fit: contain;
    filter: brightness(0.8);
    transition: all 0.3s ease;
}

.mobile-bottom-nav span {
    font-size: clamp(0.5rem, 2.5vw, 0.75rem);
    font-weight: 600;
    text-align: center;
    line-height: 1.1;
    color: inherit;
    transition: all 0.3s ease;
    margin-top: min(1.5vw, 0.25rem);
    display: block;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile Bottom Nav Hover States */
.mobile-bottom-nav .nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(232, 199, 66, 0.2), transparent);
    transition: left 0.5s ease;
}

.mobile-bottom-nav .nav-item:hover::before,
.mobile-bottom-nav .nav-item:active::before {
    left: 100%;
}

.mobile-bottom-nav .nav-item:hover,
.mobile-bottom-nav .nav-item.active {
    color: var(--secondary-color);
    background: rgba(232, 199, 66, 0.15);
    border-color: rgba(232, 199, 66, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(232, 199, 66, 0.3);
}

.mobile-bottom-nav .nav-item.active {
    background: rgba(232, 199, 66, 0.2);
    box-shadow: 0 6px 20px rgba(232, 199, 66, 0.4);
}

.mobile-bottom-nav .nav-item:hover .nav-icon,
.mobile-bottom-nav .nav-item.active .nav-icon {
    background: rgba(232, 199, 66, 0.2);
    transform: scale(1.1);
}

.mobile-bottom-nav .nav-item:hover .nav-icon img,
.mobile-bottom-nav .nav-item.active .nav-icon img {
    filter: brightness(1.2) saturate(1.2);
    transform: scale(1.1);
}

.mobile-bottom-nav .nav-item:hover span,
.mobile-bottom-nav .nav-item.active span {
    color: var(--secondary-color);
    text-shadow: 0 0 8px rgba(232, 199, 66, 0.8);
    transform: scale(1.05);
}

/* Line Icon Special Effects */
.mobile-bottom-nav .nav-item[href*="line.me"] span {
    color: #00c300;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.mobile-bottom-nav .nav-item[href*="line.me"]:hover span {
    color: #00ff00;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
}

/* =========================================
   RESPONSIVE DESIGN
   ========================================= */

/* Desktop */
@media (min-width: 769px) {
    .mobile-bottom-nav {
        display: none !important;
    }
    
    body {
        padding-bottom: 0 !important;
    }
    
    .footer {
        margin-bottom: 0 !important;
    }
}

/* Large Desktop */
@media (min-width: 1200px) {
    .navbar-nav {
        gap: 0.8rem;
    }
    
    .nav-link {
        font-size: 0.9rem;
        padding: 0.6rem 1.2rem;
    }
    
    .navbar-actions {
        gap: 0.8rem;
    }
    
    .navbar-actions .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
    }
}

/* Medium Desktop */
@media (max-width: 1199px) and (min-width: 992px) {
    .navbar-nav {
        gap: 0.5rem;
    }
    
    .nav-link {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }
    
    .navbar-actions .btn {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }
}

/* Small Desktop */
@media (max-width: 991px) and (min-width: 900px) {
    .navbar-nav {
        gap: 0.4rem;
    }
    
    .nav-link {
        font-size: 0.8rem;
        padding: 0.5rem 0.8rem;
    }
    
    .navbar-actions .btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.75rem;
    }
}

/* Icon-only Desktop */
@media (max-width: 899px) and (min-width: 769px) {
    .navbar-nav {
        gap: 0.3rem;
    }
    
    .nav-link span:not(.nav-icon) {
        display: none;
    }
    
    .nav-link {
        width: 36px;
        height: 36px;
        padding: 0;
        justify-content: center;
    }
    
    .nav-icon {
        font-size: 1.1rem;
    }
    
    .navbar-actions .btn span:last-child {
        display: none;
    }
    
    .navbar-actions .btn {
        width: 36px;
        height: 36px;
        padding: 0;
        justify-content: center;
    }
    
    .navbar-actions .btn span:first-child {
        font-size: 1.1rem;
    }
    
    /* Tooltips */
    .nav-link::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: -35px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.8);
        color: white;
        padding: 0.25rem 0.5rem;
        border-radius: 4px;
        font-size: 0.75rem;
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1000;
    }
    
    .nav-link:hover::after {
        opacity: 1;
        visibility: visible;
    }
}

/* Tablet & Mobile */
@media (max-width: 768px) {
    .navbar-toggle {
        display: flex;
    }
    
    .navbar-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background: linear-gradient(135deg, rgba(10, 10, 10, 0.98) 0%, rgba(25, 25, 25, 0.98) 100%);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        z-index: var(--z-modal-backdrop);
        transition: all 0.3s ease;
        overflow-y: auto;
    }
    
    .navbar-menu.active {
        left: 0;
    }
    
    .navbar-nav {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        height: 100%;
        padding: 2rem;
    }
    
    .nav-item {
        width: 100%;
        text-align: center;
    }
    
    .nav-link {
        font-size: 1.25rem;
        padding: 1rem 2rem;
        width: 100%;
        border: 2px solid transparent;
        justify-content: center;
        gap: 1rem;
    }
    
    .nav-link span:not(.nav-icon) {
        display: block;
    }
    
    .nav-link:hover {
        border-color: var(--secondary-color);
    }
    
    .nav-icon {
        font-size: 1.5rem;
        width: 24px;
        height: 24px;
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: rgba(45, 45, 45, 0.5);
        box-shadow: none;
        border: none;
        margin-top: 1rem;
    }
    
    .dropdown-item {
        padding: 1rem 2rem;
        font-size: 1rem;
        justify-content: center;
        gap: 1rem;
    }
    
    .dropdown-item span:first-child {
        font-size: 1.3rem;
    }
    
    .navbar-actions {
        position: absolute;
        bottom: 2rem;
        left: 50%;
        transform: translateX(-50%);
        flex-direction: column;
        gap: 1rem;
        z-index: var(--z-modal);
        opacity: 0;
        pointer-events: none;
        transition: all 0.3s ease;
    }
    
    .navbar-menu.active .navbar-actions {
        opacity: 1;
        pointer-events: auto;
    }
    
    .navbar-actions .btn {
        width: 200px;
        justify-content: center;
        font-size: 1rem;
        padding: 1rem 2rem;
        gap: 0.75rem;
    }
    
    .navbar-actions .btn span:first-child {
        font-size: 1.2rem;
    }
    
    .navbar-actions .btn span:last-child {
        display: block;
    }
    
    /* แสดงเมนูมือถือล่าง */
    .mobile-bottom-nav {
        display: flex !important;
    }
    
    body {
        padding-bottom: 85px !important;
    }
    
    .footer {
        margin-bottom: 85px !important;
    }
}

/* Large Mobile */
@media (max-width: 768px) and (min-width: 640px) {
    .mobile-bottom-nav {
        padding: 0.75rem 0.5rem calc(0.75rem + env(safe-area-inset-bottom));
        min-height: 75px;
        gap: 0.5rem;
    }
    
    .mobile-bottom-nav .nav-item {
        padding: 0.5rem 0.25rem;
        min-height: 60px;
        max-width: 85px;
        margin: 0 0.25rem;
    }
    
    .mobile-bottom-nav .nav-icon {
        font-size: 1.5rem;
        width: 32px;
        height: 32px;
    }
    
    .mobile-bottom-nav .nav-icon img {
        width: 28px;
        height: 28px;
    }
    
    .mobile-bottom-nav span {
        font-size: 0.75rem;
        margin-top: 0.25rem;
    }
    
    body {
        padding-bottom: 90px !important;
    }
    
    .footer {
        margin-bottom: 90px !important;
    }
}

/* Standard Mobile */
@media (max-width: 639px) and (min-width: 480px) {
    .mobile-bottom-nav {
        padding: 0.625rem 0.375rem calc(0.625rem + env(safe-area-inset-bottom));
        min-height: 70px;
        gap: 0.375rem;
    }
    
    .mobile-bottom-nav .nav-item {
        padding: 0.4rem 0.2rem;
        min-height: 55px;
        max-width: 75px;
        margin: 0 0.2rem;
    }
    
    .mobile-bottom-nav .nav-icon {
        font-size: 1.375rem;
        width: 30px;
        height: 30px;
    }
    
    .mobile-bottom-nav .nav-icon img {
        width: 26px;
        height: 26px;
    }
    
    .mobile-bottom-nav span {
        font-size: 0.6875rem;
        margin-top: 0.2rem;
    }
    
    body {
        padding-bottom: 85px !important;
    }
    
    .footer {
        margin-bottom: 85px !important;
    }
}

/* Small Mobile */
@media (max-width: 479px) and (min-width: 360px) {
    .mobile-bottom-nav {
        padding: 0.5rem 0.25rem calc(0.5rem + env(safe-area-inset-bottom));
        min-height: 65px;
        gap: 0.25rem;
    }
    
    .mobile-bottom-nav .nav-item {
        padding: 0.375rem 0.15rem;
        min-height: 50px;
        max-width: 65px;
        margin: 0 0.15rem;
    }
    
    .mobile-bottom-nav .nav-icon {
        font-size: 1.25rem;
        width: 28px;
        height: 28px;
    }
    
    .mobile-bottom-nav .nav-icon img {
        width: 24px;
        height: 24px;
    }
    
    .mobile-bottom-nav span {
        font-size: 0.625rem;
        margin-top: 0.15rem;
    }
    
    body {
        padding-bottom: 80px !important;
    }
    
    .footer {
        margin-bottom: 80px !important;
    }
}

/* Extra Small Mobile */
@media (max-width: 359px) {
    .mobile-bottom-nav {
        padding: 0.4rem 0.2rem calc(0.4rem + env(safe-area-inset-bottom));
        min-height: 60px;
        gap: 0.2rem;
    }
    
    .mobile-bottom-nav .nav-item {
        padding: 0.3rem 0.125rem;
        min-height: 45px;
        max-width: 60px;
        margin: 0 0.125rem;
    }
    
    .mobile-bottom-nav .nav-icon {
        font-size: 1.125rem;
        width: 26px;
        height: 26px;
    }
    
    .mobile-bottom-nav .nav-icon img {
        width: 22px;
        height: 22px;
    }
    
    .mobile-bottom-nav span {
        font-size: 0.5625rem;
        margin-top: 0.125rem;
    }
    
    body {
        padding-bottom: 75px !important;
    }
    
    .footer {
        margin-bottom: 75px !important;
    }
}

/* Landscape Orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .mobile-bottom-nav {
        padding: 0.4rem 0.25rem calc(0.4rem + env(safe-area-inset-bottom));
        min-height: 55px;
        gap: 0.25rem;
    }
    
    .mobile-bottom-nav .nav-item {
        padding: 0.3rem 0.15rem;
        min-height: 42px;
        max-width: 70px;
    }
    
    .mobile-bottom-nav .nav-icon {
        font-size: 1.125rem;
        width: 26px;
        height: 26px;
    }
    
    .mobile-bottom-nav .nav-icon img {
        width: 22px;
        height: 22px;
    }
    
    .mobile-bottom-nav span {
        font-size: 0.5625rem;
        margin-top: 0.1rem;
    }
    
    body {
        padding-bottom: 70px !important;
    }
    
    .footer {
        margin-bottom: 70px !important;
    }
}

/* =========================================
   BROWSER COMPATIBILITY
   ========================================= */

/* Safari Support */
@supports (-webkit-backdrop-filter: blur(1px)) {
    .header,
    .mobile-bottom-nav {
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
    }
}

/* iOS Safe Area Support */
@supports (padding: max(0px)) {
    .mobile-bottom-nav {
        padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    }
}

/* Force Layout Reflow */
.mobile-bottom-nav::after {
    content: '';
    display: table;
    clear: both;
}

/* Prevent Text Selection */
.mobile-bottom-nav * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Smooth Scrolling */
@media (max-width: 768px) {
    html {
        scroll-padding-bottom: 90px;
    }
}