/* ================= Reset and Base Styles ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f4f6fa;
}

/* ================= Desktop Header ================= */
.desktop-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 1rem 2rem;
    background-color: #ffffff;
    border-bottom: 1px solid #ddd;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    width: 100%;
    z-index: 998;
}

.desktop-header .logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0e1a35;
    z-index: 1;
}

/* Centered Search Bar in Desktop Header */
.desktop-header .search-bar {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.desktop-header .search-bar input {
    padding: 0.5rem 1rem;
    width: 590px;
    border: 1px solid #ccc;
    border-radius: 20px;
    outline: none;
}

/* ================= Main Content Area ================= */
/* Removed sidebar margin-left to use full width */
.main {
    padding: 120px 2rem 2rem 2rem;
    /* padding top accounts for fixed header */
    flex-grow: 1;
}

/* ================= Mobile Top Navbar ================= */
.top-navbar-mobile {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    color: #333;
    display: none;
    flex-direction: column;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    z-index: 999;
}

.top-navbar-mobile .top-title {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
}

.top-navbar-mobile .top-title h1 {
    font-size: 1.2rem;
    color: #333;
}

.top-navbar-mobile .top-title .finbot-link {
    font-size: 0.9rem;
    color: #333;
    text-decoration: none;
    background: #eee;
    padding: 6px 10px;
    border-radius: 6px;
}

/* Mobile Navbar Links */
.top-navbar-mobile ul {
    display: flex;
    justify-content: space-around;
    background-color: #fff;
    padding: 0.5rem 0;
    list-style: none;
    overflow-x: auto;
}

.top-navbar-mobile ul li a {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.8rem;
    color: #333;
    text-decoration: none;
    padding: 0 0.5rem;
    white-space: nowrap;
}

.top-navbar-mobile ul li a i {
    font-size: 0.85rem;
    color: #6610f2;
    text-shadow: none;
}

.top-navbar-mobile ul li a span {
    margin-top: 2px;
    color: #333;
}

/* ================= Mobile Bottom Navbar ================= */
.bottom-navbar-mobile {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #fff;
    display: none;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.1);
    z-index: 999;
}

.bottom-navbar-mobile a {
    color: #333;
    font-size: 0.8rem;
    text-align: center;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bottom-navbar-mobile a i {
    color: #6610f2;
}

.bottom-navbar-mobile a span {
    margin-top: 2px;
    color: #333;
}

/* ================= Responsive Styles ================= */
@media screen and (max-width: 768px) {

    /* Hide desktop elements on mobile */
    .sidebar,
    .desktop-header {
        display: none;
    }

    /* Main content padding adjusts for mobile navbars */
    .main {
        margin-left: 0;
        padding-top: 120px;
        padding-bottom: 70px;
    }

    /* Show mobile navbars */
    .top-navbar-mobile,
    .bottom-navbar-mobile {
        display: flex;
    }

    /* Style for Finbot link on mobile */
    .finbot-link {
        font-size: 0.9rem;
        color: #fff;
        text-decoration: none;
        background: #6610f2;
        padding: 6px 12px;
        border-radius: 6px;
        display: flex;
        align-items: center;
        gap: 6px;
    }
}

/* ================= Clock Styles ================= */
.clock-container {
    background: #fff;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    max-width: 400px;
    margin: 0 auto;
    margin-top: 0;
}

.glow {
    box-shadow: 0 0 20px #6610f2, 0 0 40px #6610f2;
    transform: scale(1.02);
}

.digital-time {
    font-size: 48px;
    font-weight: 600;
    letter-spacing: 2px;
}

.market-status {
    margin-top: 10px;
    font-size: 16px;
    color: #6610f2;
}

/* Clock Margin Adjustment for Desktop */
@media screen and (min-width: 768px) {
    .clock-container {
        margin-top: 20px;
    }
}

/* Clock Margin Adjustment for Mobile */
@media screen and (max-width: 767px) {
    .top-navbar-mobile {
        position: sticky;
        top: 0;
        z-index: 999;
        background-color: #fff;
        padding: 10px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    }

    .clock-container {
        margin-top: 10px;
    }
}

/* ================= Marquee Styles ================= */
.marquee-container {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    background: #fff;
    padding: 5px 0;
}

.marquee-track {
    display: inline-block;
    animation: scroll-left 40s linear infinite;
}

.market-item {
    display: inline-flex;
    align-items: center;
    padding: 0 20px;
    border-right: 2px solid #6610f2;
    font-size: 14px;
}

.market-item img {
    width: 20px;
    height: 14px;
    margin-right: 8px;
}

.change-positive {
    color: green;
    font-weight: 600;
    margin-left: 5px;
}

.change-negative {
    color: red;
    font-weight: 600;
    margin-left: 5px;
}

@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* ================= Table Styles ================= */
.table-container {
    flex-grow: 1;
    overflow-x: auto;
    min-width: 0;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}

th,
td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ccc;
}

th {
    background-color: #f4f4f4;
}

.positive {
    color: green;
}

.negative {
    color: red;
}

/* ================= Content Wrapper (Image + Table) ================= */
.content-wrapper {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 0 50px;
    gap: 50px;
    width: calc(100% - 6cm);
    /* leave 3cm on each side */
    margin-left: 3cm;
    margin-right: 3cm;
}

/* Image in Wrapper */
.ad-image {
    width: 290px;
    flex-shrink: 0;
    border-radius: 10px;
    object-fit: cover;
}

/* Table section */
.table-section {
    flex-grow: 1;
    min-width: 0;
    width: 100%;
    max-width: 800px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
        align-items: center;
        padding: 20px 10px 30px;
        width: 100%;
        margin: 0;
        /* Remove fixed margins on small screens */
    }

    .ad-image {
        width: 100%;
        max-width: 100%;
        margin-bottom: 15px;
    }

    .table-section,
    .table-container {
        width: 100%;
    }

    table {
        font-size: 14px;
    }

    th,
    td {
        padding: 8px;
    }
}

/* ================= Gainers and Decliners Tables ================= */
.gainers-decliners-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
    margin-left: 0;
    /* removed sidebar margin */
}

.gainers-table,
.decliners-table {
    flex: 1 1 45%;
    border-collapse: collapse;
    width: 100%;
    background-color: #fff;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

.gainers-table th,
.gainers-table td,
.decliners-table th,
.decliners-table td {
    padding: 10px;
    border: 1px solid #ccc;
    text-align: left;
    font-size: 14px;
}

.gainers-table th,
.decliners-table th {
    background-color: #f4f4f4;
}

@media (max-width: 768px) {
    .gainers-decliners-container {
        flex-direction: column;
        margin-left: 0;
    }
}

/* ================= Exchange Tabs ================= */
.exchange-tabs-container {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center; /* centers tabs horizontally */
    align-items: center;     /* centers tabs vertically within each row */
    margin: 20px auto;       /* centers the container horizontally */
    max-width: 100%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    text-align: center;      /* optional: centers text inside tabs */
}

.exchange-tab {
    background-color: white;
    color: #111;
    border: 1.5px solid #6610f2;
    box-shadow: 0 4px 10px rgba(102, 16, 242, 0.1);
    border-radius: 10px;
    text-align: center;
    padding: 10px 12px;
    flex: 1 1 calc(50% - 20px);
    max-width: calc(50% - 20px);
    transition: transform 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center; /* centers content inside each tab */
    gap: 10px;
    text-decoration: none;
}

.exchange-tab img {
    width: 24px;
    height: auto;
    border-radius: 3px;
}

.exchange-tab:hover {
    transform: scale(1.05);
    background-color: #f1f1f1;
}

@media (min-width: 768px) {
    .exchange-tab {
        flex: 1 1 calc(20% - 20px);
        max-width: calc(20% - 20px);
    }
}


/* ================= Footer Logos ================= */
.footer-logos {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px 20px;
    background-color: #f5f5f5;
    flex-wrap: wrap;
    gap: 20px;
    margin-left: 0;
    width: 100%;
    box-sizing: border-box;
}

.footer-logos img {
    height: 50px;
    width: 100px;
    /* Set a fixed width for uniform sizing */
    object-fit: contain;
    /* Keeps aspect ratio inside the box */
    cursor: pointer;
    transition: transform 0.3s ease;
}

.footer-logos img:hover {
    transform: scale(1.1);
}

/* ================= Main Footer ================= */
.main-footer {
    text-align: center;
    padding: 10px 0;
    background-color: #eaeaea;
    font-size: 14px;
    color: #555;
    border-top: 1px solid #ccc;
}

/* ================= Layout Helpers ================= */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    display: flex;
}

/* Responsive footer stacking on small screens */
@media (max-width: 768px) {
    .footer-logos {
        flex-direction: column;
    }
}

/* ================= Top Buttons (utility) ================= */
.top-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 768px) {
    .top-buttons {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}