/* ==================== RESET & BASE STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: none;
}

/* Hide scrollbars globally - Chrome, Safari, Edge */
*::-webkit-scrollbar {
    display: none;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    scrollbar-width: none;
}

body::-webkit-scrollbar {
    display: none;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

/* ==================== NAVBAR CONTAINER ==================== */
.navbar-container {
    position: sticky;
    top: 0;
    z-index: 998;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* ==================== TOP BAR (BRAND LAYER) ==================== */
.navbar-top {
    background-color: #ffffff;
    border-bottom: 1px solid #e8e8e8;
    padding: 0;
}

.navbar-top-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    max-width: 1400px;
    margin: 0 auto;
    gap: 16px;
}

/* Left Section: Hamburger & Search */
.navbar-left {
    display: flex;
    gap: 12px;
    align-items: center;
}

.nav-icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #333;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-icon-btn:hover {
    background-color: #f0f0f0;
    color: #f58220;
}

.nav-icon-btn:active {
    background-color: #e8e8e8;
}

/* Center Section: Logo */
.navbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: 700;
    color: #333;
    transition: all 0.3s ease;
}

.logo-text {
    background: linear-gradient(135deg, #f58220 0%, #ff9500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-icon {
    font-size: 28px;
}

/* Right Section: E-Paper, Search Icon */
.navbar-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

.e-paper-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.e-paper-link:hover {
    background-color: #f0f0f0;
    color: #f58220;
}

.nav-text {
    display: inline;
}

/* Mobile Search Button - Hidden by Default */
.mobile-search-btn {
    display: none !important;
}

/* Buttons */
.btn {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-subscribe {
    background-color: #f58220;
    color: #ffffff;
}

.btn-subscribe:hover {
    background-color: #e06e0f;
    box-shadow: 0 4px 12px rgba(245, 130, 32, 0.3);
    transform: translateY(-2px);
}

.btn-subscribe:active {
    background-color: #c85a0a;
    transform: translateY(0);
}

.btn-signin {
    border: 2px solid #333;
    color: #333;
    background-color: transparent;
}

.btn-signin:hover {
    border-color: #f58220;
    color: #f58220;
    background-color: #fef5f0;
}

.btn-signin:active {
    background-color: #fff0e6;
}

/* ==================== BUTTON BAR (Subscribe & Sign In) ==================== */
.navbar-button-bar {
    display: none;
    background-color: #ffffff;
    border-bottom: 1px solid #e8e8e8;
    padding: 12px 16px;
}

.navbar-button-wrapper {
    display: flex;
    gap: 12px;
    max-width: 1400px;
    margin: 0 auto;
}

.navbar-button-wrapper .btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
    text-align: center;
}

/* ==================== MARKET TICKER ==================== */
@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.market-ticker {
    background: linear-gradient(90deg, #021324 0%, #0a1f2e 100%);
    padding: 0px 0;
    border-bottom: 1px solid #1a2a3a;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
}

.market-ticker:hover .ticker-content {
    animation-play-state: paused;
}

.ticker-wrapper {
    padding: 0 16px;
    max-width: 1400px;
    margin: 0 auto;
    overflow: hidden;
}

.ticker-content {
    display: flex;
    gap: 40px;
    min-width: min-content;
    animation: marquee 60s linear infinite;
}

/* Pause animation on hover */
.ticker-content.paused {
    animation-play-state: paused;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    min-width: fit-content;
    flex-shrink: 0;
    padding: 8px 0;
}

.ticker-item::after {
    content: "|";
    color: #4a5968;
    font-size: 14px;
    margin-left: 16px;
}

.ticker-item:last-child::after {
    display: none;
}

.ticker-label {
    font-size: 11px;
    font-weight: 700;
    color: #7a8a9a;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 45px;
}

.ticker-value {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 80px;
}

.ticker-value i {
    font-size: 11px;
}

.ticker-change {
    font-size: 11px;
    font-weight: 600;
    min-width: 65px;
}

.ticker-up {
    color: #00b060;
}

.ticker-down {
    color: #ff4d4d;
}

/* ==================== BOTTOM BAR (LINKS LAYER) ==================== */
.navbar-bottom {
    background-color: #ffffff;
    border-bottom: 1px solid #e8e8e8;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.navbar-bottom::-webkit-scrollbar {
    display: none;
}

.navbar-bottom-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    max-width: 1400px;
    margin: 0 auto;
    gap: 24px;
    min-height: 48px;
}

.nav-links-container {
    display: flex;
    gap: 32px;
    min-width: min-content;
    flex: 1;
    scrollbar-width: none;
}

.nav-links-container::-webkit-scrollbar {
    display: none;
}

.nav-category {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    padding: 14px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.nav-category:hover {
    color: #333;
}

.nav-category.active {
    color: #f58220;
    border-bottom-color: #f58220;
    font-weight: 700;
}

/* More Dropdown */
.nav-more-dropdown {
    position: relative;
    flex-shrink: 0;
}

.nav-more-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    padding: 14px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-more-btn:hover {
    color: #333;
    background-color: #f0f0f0;
}

.nav-more-btn i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.nav-more-btn.active i {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background-color: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    min-width: 180px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 500;
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: #f5f5f5;
    color: #f58220;
    padding-left: 20px;
}

/* ==================== SIDEBAR MENU (Mobile/Tablet) ==================== */
.sidebar-menu {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background-color: #ffffff;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 999;
    overflow-y: auto;
}

.sidebar-menu.active {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 16px;
    border-bottom: 1px solid #e8e8e8;
    background-color: #f5f5f5;
    gap: 12px;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.sidebar-user-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-user-info h3 {
    font-size: 14px;
    font-weight: 600;
    color: #666;
}

.sidebar-user-info p {
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

.sidebar-signin-btn {
    width: 100%;
    padding: 10px 12px;
    background-color: #f58220;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.sidebar-signin-btn:hover {
    background-color: #e06e0f;
    box-shadow: 0 4px 12px rgba(245, 130, 32, 0.3);
}

.sidebar-signin-btn:active {
    background-color: #c85a0a;
}

.sidebar-close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #666;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.sidebar-close-btn:hover {
    background-color: #e8e8e8;
    color: #333;
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    padding: 12px 0;
}

.sidebar-link {
    display: block;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}

.sidebar-link:hover,
.sidebar-link.active {
    background-color: #fef5f0;
    color: #f58220;
    border-left-color: #f58220;
    padding-left: 20px;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
}

.sidebar-overlay.active {
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 1;
    visibility: visible;
}

/* ==================== SEARCH MODAL ==================== */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(2, 19, 36, 0.95) 0%,
        rgba(21, 40, 60, 0.95) 100%
    );
    opacity: 0;
    visibility: hidden;
    transform: translateY(-50px);
    transition: all 0.3s ease;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
}

.search-input {
    width: 100%;
    padding: 16px 24px;
    font-size: 18px;
    border: none;
    border-radius: 8px;
    background-color: #ffffff;
    color: #333;
    outline: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.search-input::placeholder {
    color: #999;
}

.search-close-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #666;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.search-close-btn:hover {
    background-color: #f0f0f0;
    color: #333;
}

/* ==================== RESPONSIVE DESIGN ==================== */

/* Tablet (768px to 1024px) */
@media (max-width: 1024px) {
    .mobile-search-btn {
        display: flex !important;
    }

    .navbar-top-wrapper {
        padding: 10px 12px;
    }

    .nav-links-container {
        gap: 24px;
    }

    .nav-category {
        font-size: 13px;
        padding: 12px 0;
    }

    .ticker-content {
        gap: 24px;
    }

    .ticker-item {
        min-width: 130px;
    }

    .e-paper-link {
        font-size: 13px;
    }

    .btn {
        padding: 9px 14px;
        font-size: 13px;
    }

    .navbar-button-bar {
        display: none;
    }
}

/* Mobile (up to 768px) */
@media (max-width: 768px) {
    .navbar-top-wrapper {
        padding: 12px 12px;
        gap: 8px;
    }

    /* Display button bar on mobile */
    .navbar-button-bar {
        display: block;
    }

    /* Hide E-Paper on mobile */
    .e-paper-link {
        display: none;
    }

    /* Hide full navigation bar on mobile */
    .navbar-left {
        gap: 8px;
        order: 0;
        flex: 0 0 auto;
    }

    .nav-icon-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    /* Center logo on mobile */
    .navbar-center {
        order: 1;
        flex: 0 1 auto;
        justify-content: center;
    }

    .logo {
        font-size: 20px;
        gap: 6px;
    }

    .logo-icon {
        font-size: 24px;
    }

    .logo-text {
        display: none;
    }

    .logo img {
        max-width: 100px;
    }

    /* Hide right section on mobile as it's moved to button bar */
    .navbar-right {
        order: 2;
        flex: 0 0 auto;
        gap: 0;
    }

    .nav-text {
        display: none;
    }

    /* Button bar styles */
    .navbar-button-wrapper {
        gap: 10px;
    }

    .navbar-button-wrapper .btn {
        padding: 12px 14px;
        font-size: 13px;
        border-radius: 4px;
    }

    .navbar-button-wrapper .btn-subscribe {
        flex: 1.2;
    }

    .navbar-button-wrapper .btn-signin {
        flex: 0.8;
    }

    /* Horizontal scroll for bottom navigation */
    .nav-links-container {
        gap: 20px;
        padding: 0;
    }

    .nav-category {
        font-size: 13px;
        padding: 12px 0;
        border-bottom-width: 2px;
    }

    .navbar-bottom-wrapper {
        gap: 16px;
        padding: 0 12px;
    }

    /* Simplify ticker */
    .ticker-content {
        gap: 24px;
        animation: marquee 50s linear infinite;
    }

    .ticker-item {
        min-width: 120px;
    }

    .ticker-label {
        font-size: 10px;
    }

    .ticker-value {
        font-size: 14px;
    }

    .ticker-change {
        font-size: 10px;
    }

    /* Hamburger menu visibility */
    .hamburger-btn {
        display: flex !important;
    }

    /* Hide search icon on mobile */
    .search-btn {
        display: none;
    }
}

/* Small Mobile (up to 480px) */
@media (max-width: 480px) {
    .navbar-top-wrapper {
        padding: 10px 10px;
        gap: 6px;
    }

    .navbar-button-bar {
        padding: 10px 12px;
    }

    .navbar-button-wrapper {
        gap: 8px;
    }

    .navbar-button-wrapper .btn {
        padding: 10px 12px;
        font-size: 12px;
    }

    .navbar-left {
        gap: 4px;
    }

    .nav-icon-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .logo {
        font-size: 16px;
    }

    .logo img {
        max-width: 200px;
    }

    .nav-links-container {
        gap: 16px;
    }

    .nav-category {
        font-size: 12px;
    }

    .nav-more-btn {
        padding: 12px 8px;
        font-size: 12px;
    }

    .ticker-content {
        gap: 16px;
        animation: marquee 45s linear infinite;
    }

    .ticker-item {
        min-width: 100px;
    }

    .ticker-label {
        font-size: 10px;
    }

    .ticker-value {
        font-size: 13px;
    }

    .ticker-change {
        font-size: 9px;
    }

    .ticker-item::after {
        margin-left: 8px;
    }

    .dropdown-menu {
        min-width: 150px;
    }

    .sidebar-menu {
        width: 100%;
        max-width: 280px;
    }
}

/* ==================== UTILITIES ==================== */
.hidden {
    display: none !important;
}

.no-scroll {
    overflow: hidden;
}

/* Smooth transitions */
* {
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

button,
a {
    transition: all 0.3s ease;
}
