.nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.nav li {
    position: relative;
}

.nav a {
    display: block;
    padding: 10px 0;
    text-decoration: none;
}

.nav .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 190px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    z-index: 1000;
}

.nav .dropdown-menu li {
    width: 100%;
}

.nav .dropdown-menu a {
    padding: 10px;
    white-space: nowrap;
}

.nav .dropdown-menu a:hover {
    background: #f2f4f7;
    border-radius: 4px;
}

.nav .dropdown:hover > .dropdown-menu,
.nav .dropdown:focus-within > .dropdown-menu {
    display: block;
}

@media (max-width: 768px) {
    .nav ul {
        gap: 10px;
    }

    .nav .dropdown-menu {
        min-width: 170px;
    }
}








/* Main navigation menu */
.site-menu {
    display: flex;
    align-items: center;
    gap: 24px;
}

.site-menu a {
    color: #9aa4b2;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.site-menu a:hover {
    color: #54d6a0;
}

/* Mobile menu toggle */
#menu-toggle {
    display: none;
}

.menu-icon {
    display: none;
    font-size: 28px;
    color: #54d6a0;
    cursor: pointer;
}

/* Responsive layout */
@media (max-width: 700px) {
    header {
        position: relative;
    }

    .menu-icon {
        display: block;
        margin-left: auto;
    }

    .site-menu {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
        width: 100%;
        padding: 20px 0;
    }

    #menu-toggle:checked ~ .site-menu {
        display: flex;
    }
}





/* CRYPTO navigation TABLE */
* {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body {
            font-family: 'Poppins', sans-serif; /* OLD FONT CLASHING WITH POPPINS
            font-family: Arial, sans-serif; */
            background: #0b0e11;
            color: #f0f3f5;
        }

        header {
            padding: 22px 6%;
            border-bottom: 1px solid #252a32;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 16px;
            flex-wrap: wrap;
        }

        .logo {
            font-size: 24px;
            font-weight: bold;
            color: #54d6a0;
        }

        header span {
            color: #9aa4b2;
            font-size: 13px;
        }

        main {
            max-width: 1250px;
            margin: auto;
            padding: 35px 20px;
        }

        h1 {
            font-size: clamp(26px, 4vw, 38px);
            margin-bottom: 12px;
        }

        .subtitle {
            color: #9aa4b2;
            margin-bottom: 28px;
        }

        .stats {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 16px;
            margin-bottom: 30px;
        }

        .stat-card {
            background: #151a21;
            border: 1px solid #252a32;
            padding: 20px;
            border-radius: 12px;
        }

        .stat-card p {
            color: #9aa4b2;
            font-size: 13px;
            margin-bottom: 12px;
        }

        .stat-card strong {
            font-size: 21px;
        }

        .toolbar {
            display: flex;
            justify-content: space-between;
            gap: 15px;
            margin-bottom: 18px;
            flex-wrap: wrap;
        }

        .tabs {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }

        button {
            cursor: pointer;
            background: #151a21;
            border: 1px solid #303642;
            color: #c6ced8;
            padding: 10px 15px;
            border-radius: 8px;
        }

        button.active,
        button:hover {
            background: #54d6a0;
            border-color: #54d6a0;
            color: #07110c;
        }

        input {
            background: #151a21;
            border: 1px solid #303642;
            color: white;
            border-radius: 8px;
            padding: 12px 14px;
            min-width: 220px;
            max-width: 100%;
        }

        .table-wrap {
            overflow-x: auto;
            background: #11161d;
            border: 1px solid #252a32;
            border-radius: 12px;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            min-width: 800px;
            text-align: left;
        }

        th, td {
            padding: 18px 16px;
            border-bottom: 1px solid #252a32;
        }

        th {
            color: #9aa4b2;
            font-size: 12px;
            font-weight: normal;
            white-space: nowrap;
        }

        tbody tr:hover {
            background: #1a2029;
        }

        .symbol {
            color: #9aa4b2;
            font-size: 12px;
            margin-top: 5px;
        }

        .asset-info {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .asset-logo {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            object-fit: contain;
            flex-shrink: 0;
        }

        .positive {
            color: #36d399;
        }

        .negative {
            color: #ff6577;
        }

        #status {
            color: #9aa4b2;
            font-size: 13px;
            margin-top: 16px;
        }

        footer {
            padding: 25px;
            text-align: center;
            color: #737e8c;
            font-size: 12px;
        }
        
        /* THIS IS THE TEXT COLOUR FOR THE LINK TO THE ASSET PAGE */
        .coin-link {
    color: #f0f3f5;
    text-decoration: none;
        }

        .coin-link:hover {
    color: #54d6a0;
        }


















/* =====================================
   HEADER AND LOGO
===================================== */

header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

header a.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    color: #54d6a0;
    font-size: 24px;
    font-weight: 600;
    text-decoration: none;
}

.logo-icon {
    width: 36px;
    height: 36px;
    max-width: 36px;
    object-fit: contain;
    display: block;
}

/* =====================================
   DESKTOP NAVIGATION
===================================== */

.nav {
    margin-left: auto;
}

.nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0;
    padding: 0;
}

.nav li {
    position: relative;
}

.nav a {
    display: block;
    padding: 10px 0;
    color: #c6ced8;
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.nav a:hover,
.nav a:focus-visible {
    color: #54d6a0;
}

/* =====================================
   DROPDOWN MENUS
===================================== */

.nav .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    padding: 8px;
    background: #151a21;
    border: 1px solid #303642;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    z-index: 1000;
}

.nav .dropdown-menu li {
    width: 100%;
}

.nav .dropdown-menu a {
    padding: 10px 12px;
    white-space: normal;
    border-radius: 5px;
}

.nav .dropdown-menu a:hover,
.nav .dropdown-menu a:focus-visible {
    background: #252a32;
    color: #54d6a0;
}

.nav .dropdown:hover > .dropdown-menu,
.nav .dropdown:focus-within > .dropdown-menu {
    display: block;
}

/* =====================================
   HAMBURGER BUTTON
===================================== */

#menu-toggle {
    display: none;
}

.menu-icon {
    display: none;
    color: #54d6a0;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    padding: 5px;
    margin-left: auto;
    user-select: none;
}

/* =====================================
   MOBILE NAVIGATION
===================================== */

@media (max-width: 900px) {
    .menu-icon {
        display: block;
    }

    .nav {
        display: none;
        width: 100%;
        margin-left: 0;
        padding: 12px;
        background: #151a21;
        border: 1px solid #252a32;
        border-radius: 10px;
    }

    /* Show navigation when hamburger is checked */
    #menu-toggle:checked ~ .nav {
        display: block;
    }

    .nav > ul {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        width: 100%;
    }

    .nav > ul > li {
        width: 100%;
    }

    .nav a {
        padding: 12px;
        white-space: normal;
    }

    /* Mobile dropdowns stay inside the menu */
    .nav .dropdown-menu {
        display: none;
        position: static;
        min-width: 0;
        width: 100%;
        margin: 0;
        padding: 4px 0 4px 14px;
        background: #0b0e11;
        border: none;
        border-radius: 6px;
        box-shadow: none;
    }

    .nav .dropdown:hover > .dropdown-menu,
    .nav .dropdown:focus-within > .dropdown-menu {
        display: block;
    }

    .nav .dropdown-menu a {
        padding: 10px 12px;
    }
}


/* Round the corners of the website logo */
header a.logo img.logo-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    object-fit: cover;
    border-radius: 8px !important;
    overflow: hidden;
    clip-path: inset(0 round 8px);
}












/* Currency selector */
#currency-select {
    background: #151a21;
    color: #f0f3f5;
    border: 1px solid #303642;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    cursor: pointer;
    min-width: 125px;
    max-width: 100%;
}

#currency-select:focus {
    outline: none;
    border-color: #54d6a0;
}

#currency-select option {
    background: #151a21;
    color: #f0f3f5;
}





















/* =====================================
   SITE FOOTER
===================================== */

.site-footer {
    padding: 25px 20px;
    margin-top: 45px;
    border-top: 1px solid #252a32;
    text-align: center;
    color: #9aa4b2;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    line-height: 1.8;
}

.site-footer p {
    margin: 0;
}









/* =========================================
   Cryptocurrency price history chart
   Shared by all coin pages
   ========================================= */

.chart-history-card {
    width: 100%;
    min-width: 0;
    margin-top: 24px;
    margin-bottom: 24px;
    padding: 26px;
    overflow: hidden;
    background: #151a21;
    border: 1px solid #252a32;
    border-radius: 16px;
    color: #f0f3f5;
}

.chart-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.chart-heading h2 {
    margin: 0;
    color: #f0f3f5;
    font-size: 21px;
    font-weight: 600;
    line-height: 1.5;
}

.chart-heading p {
    margin: 6px 0 0;
    color: #9aa4b2;
    font-size: 12px;
    line-height: 1.7;
}

.chart-badge {
    display: inline-block;
    padding: 7px 11px;
    border: 1px solid rgba(84, 214, 160, 0.25);
    border-radius: 8px;
    background: rgba(84, 214, 160, 0.08);
    color: #54d6a0;
    font-size: 11px;
    white-space: nowrap;
}

.chart-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 32px;
    margin-bottom: 22px;
    padding: 16px;
    background: #11161d;
    border: 1px solid #252a32;
    border-radius: 12px;
}

.chart-summary > div {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.chart-label {
    color: #9aa4b2;
    font-size: 11px;
}

.chart-summary strong {
    color: #54d6a0;
    font-size: 21px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 340px;
    min-width: 0;
}

.chart-status {
    margin: 18px 0 0;
    color: #9aa4b2;
    font-size: 12px;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

@media (max-width: 600px) {
    .chart-history-card {
        margin-top: 16px;
        margin-bottom: 24px;
        padding: 18px 14px;
        border-radius: 13px;
    }

    .chart-heading {
        gap: 12px;
        margin-bottom: 18px;
    }

    .chart-heading h2 {
        font-size: 18px;
    }

    .chart-summary {
        gap: 22px;
        padding: 13px;
        margin-bottom: 16px;
    }

    .chart-summary strong {
        font-size: 18px;
    }

    .chart-container {
        height: 270px;
    }
}







/* =====================================
   MARKET TABLE PAGINATION
===================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 30px 0 12px;
}

.page-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 40px;
    min-height: 40px;
    padding: 8px 13px;
    border: 1px solid #303746;
    border-radius: 8px;
    background: #151b27;
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s ease,
                border-color 0.2s ease;
}

.page-link:hover {
    background: #26364b;
    border-color: #54d6a0;
}

.page-link.active {
    background: #54d6a0;
    border-color: #54d6a0;
    color: #101820;
}

.page-dots {
    color: #a0a9b8;
    padding: 0 4px;
}

.pagination-info {
    text-align: center;
    color: #a0a9b8;
    font-size: 13px;
    margin: 10px 0 25px;
}


/* =====================================
   SEARCH FORM
===================================== */

.search-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.search-form button {
    cursor: pointer;
}

.search-form a {
    color: #54d6a0;
    text-decoration: none;
}


/* =====================================
   MOBILE PAGINATION
===================================== */

@media (max-width: 600px) {

    .pagination {
        gap: 5px;
    }

    .page-link {
        min-width: 35px;
        min-height: 36px;
        padding: 6px 9px;
        font-size: 12px;
    }

    .search-form {
        width: 100%;
    }

    .search-form input {
        min-width: 0;
        flex: 1;
    }

}














/* =====================================
   UNIFORM COMPACT MARKET TABLE
   INDEX.PHP AND CRYPTOS.PHP
===================================== */

.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* TABLE LAYOUT */

.table-wrap table {
    width: 100%;
    min-width: 800px;
    table-layout: fixed;
    border-collapse: collapse;
}

/* COLUMN 1 - RANK */

.table-wrap th:nth-child(1),
.table-wrap td:nth-child(1) {
    width: 55px;
}

/* COLUMN 2 - ASSET */

.table-wrap th:nth-child(2),
.table-wrap td:nth-child(2) {
    width: 155px;
}

/* COLUMN 3 - PRICE */

.table-wrap th:nth-child(3),
.table-wrap td:nth-child(3) {
    width: 155px;
}

/* COLUMN 4 */

.table-wrap th:nth-child(4),
.table-wrap td:nth-child(4) {
    width: 155px;
}

/* COLUMN 5 */

.table-wrap th:nth-child(5),
.table-wrap td:nth-child(5) {
    width: 100px;
}

/* COLUMN 6 */

.table-wrap th:nth-child(6),
.table-wrap td:nth-child(6) {
    width: 150px;
}

/* CELL FORMATTING */

.table-wrap th,
.table-wrap td {
    padding: 14px 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ASSET NAME AND LOGO */

.table-wrap .asset-info {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.table-wrap .asset-info > div {
    min-width: 0;
    overflow: hidden;
}

.table-wrap .coin-link {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* STICKY FIRST COLUMN */

.table-wrap th:nth-child(1),
.table-wrap td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 3;
    background: #11161d;
}

/* STICKY SECOND COLUMN */

.table-wrap th:nth-child(2),
.table-wrap td:nth-child(2) {
    position: sticky;
    left: 55px;
    z-index: 3;
    background: #11161d;

    /* Permanent divider after Asset */
    border-right: 1px solid #303642;
}

/* TABLE HEADER */

.table-wrap thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #11161d;
}

.table-wrap thead th:nth-child(1),
.table-wrap thead th:nth-child(2) {
    z-index: 5;
}

/* MOBILE */

@media (max-width: 600px) {

    .table-wrap table {
        min-width: 800px;
    }

    .table-wrap th,
    .table-wrap td {
        padding: 12px 8px;
        font-size: 12px;
    }

}
/* ==========================================
   MOBILE TOOLBAR
   KEEP CURRENCY AND SEARCH ON SAME LINE
========================================== */

@media (max-width: 768px) {

    .toolbar {
        display: flex;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px;
    }

    .toolbar .tabs {
        width: 100%;
        flex-basis: 100%;
    }

    .toolbar .currency-control {
        flex: 0 0 auto;
        width: auto;
    }

    .toolbar .search-form {
        flex: 1 1 0;
        min-width: 0;
        width: auto;
        margin: 0;
    }

    .toolbar .search-form input {
        width: 100%;
        min-width: 0;
    }

}