:root {
    --bg-color: #000000;
    --secondary-bg-color: #383838;
    --text-color: #ffffff;
    --secondary-text-color: #9c9c9c;
    --border-color: var(--secondary-bg-color);
}



/* Main ---------------------------------------------------------------- */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.bg-dark {
    background-color: var(--bg-color) !important;
}

.bg-secondary {
    background-color: var(--secondary-bg-color) !important;
}

header {
    border-bottom: 1px solid var(--border-color);
}

.new-tag {
    background-color: #211900;
    color: #FFAA00;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    margin-left: 5px;
}

.new-tag:before {
    content: "NEW";
}

.hot-tag {
    background-color: #210000;
    color: #FF4400;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    margin-left: 5px;
}

.hot-tag:before {
    content: "HOT 🔥";
}

.square-icon {
    width: 12px;
    height: 12px;
    background-color: var(--secondary-bg-color);
}


/* Logo ---------------------------------------------------------------- */
.logo-container {
    padding-left: 20px;
}

/* Header Buttons ---------------------------------------------------------------- */
.buttons-container {
    padding-right: 20px;
}

.header-buttons {
    display: flex;
    align-items: center;
    height: 42px;
    gap: 10px;
}

.header-buttons .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px; 
    height: 40px; 
    min-width: 180px; 
    color: var(--text-color);
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px; 
    box-sizing: border-box; 
    font-size: 16px; 
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
}

.header-buttons .btn:hover {
    background-color: var(--secondary-bg-color);
    border-color: var(--border-color);
}

.header-buttons .btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.btn-success,
.btn-outline-success {
    color: var(--text-color);
    background-color: var(--bg-color);
    border-color: var(--border-color);
}

.btn-outline-success {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.metamask-icon,
.plus-icon {
    width: 20px;     
    height: 20px;    
    object-fit: contain;
}

/* User Info ---------------------------------------------------------------- */
.user-info {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px 15px;
    height: 40px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    min-width: 200px; /* Ensure minimum width to fit content */
    gap: 8px;
}

/* Make wallet address more compact */
.wallet-address {
    font-size: 13px;
    color: var(--text-color);
    white-space: nowrap; /* Prevent wrapping */
}

/* Make coins section more compact */
.coins {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: var(--text-color);
    white-space: nowrap;
    margin-left: auto; /* Push to right */
}

.coin-icon {
    width: 16px;
    height: 16px;
    margin-left: 4px;
}

.logout-link {
    display: flex;
    align-items: center;
    margin-left: 8px;
}

.logout-icon {
    width: 16px;
    height: 16px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.logout-icon:hover {
    opacity: 1;
}


/* Sidebar ---------------------------------------------------------------- */
.sidebar {
    padding: 20px 20px 20px 20px;  /* top right bottom left */
    color: var(--secondary-text-color);
}

.sidebar-section {
    margin-bottom: 30px;
}

.sidebar-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.sidebar-section-header h2 {
    color: var(--text-color);
    font-size: 16px;
    margin: 0;
}

.sidebar-section-items {
    list-style: none;
    padding-left: 20px;
    margin: 0;
    border-left: 1px solid var(--secondary-bg-color);
}

.sidebar-section-items li {
    padding: 5px 0;
    cursor: pointer;
}

.sidebar-section-items li:hover {
    color: var(--text-color);
}

.sidebar-section-items .category-item {
    cursor: pointer;
}

.sidebar-section-items .category-item.active {
    color: var(--text-color);
    font-weight: bold;
}

.sidebar-section-items a {
    color: var(--secondary-text-color);  /* Same grey color as non-links */
    text-decoration: none;  /* Remove underline */
}

.sidebar-section-items a:hover {
    color: var(--text-color);  /* Same white color on hover as non-links */
}

.sidebar-footer {
    margin-top: 40px;
    padding-top: 10px;
    border-top: 1px solid var(--secondary-bg-color);
}

.sidebar-footer-links {
    list-style-type: none; 
    padding: 0;
    margin: 0;
}

.sidebar-footer-links li {
    padding: 2px 0;
    cursor: pointer;
    color: var(--secondary-text-color);
    font-size: 12px;
}

.sidebar-footer-links li:hover {
    color: var(--text-color);
}

.sidebar-footer-links a {
    color: var(--secondary-text-color);  /* Same grey color as non-links */
    text-decoration: none;  /* Remove underline */
}

.sidebar-footer-links a:hover {
    color: var(--text-color);  /* Same white color on hover as non-links */
}


/* RSS Feed ---------------------------------------------------------------- */
.news-feed {
    padding: 20px;
    color: var(--secondary-text-color);
}

.news-feed h2 {
    color: var(--text-color);
    font-size: 16px;
    margin-bottom: 20px;
}

.news-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--secondary-bg-color);
}

.news-header {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    width: 100%;  /* Ensure the header takes full width */
}

.news-header img {
    width: 146px;  /* Increased from 20px */
    height: 74px;  /* Increased from 20px */
    border-radius: 4px;  /* Optional: if you want slightly rounded corners */
}

.news-datetime {
    display: flex;
    flex-direction: column;
    align-items: flex-end;  /* This right-aligns the date and time */
    font-size: 14px;
}

.news-meta {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    align-items: flex-end;  /* This will right-align all children, including author */
}

.news-author {
    color: var(--text-color);
    font-weight: bold;
    font-size: 14px;
    text-align: right;  /* Additional right alignment for text */
}

.news-date {
    color: var(--secondary-text-color);
    font-weight: normal;
}

.news-time {
    color: var(--secondary-text-color);
    font-weight: bold;
}

.news-item p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

.news-item a {
    color: var(--text-color);
    text-decoration: none;
}

.news-item a:hover {
    text-decoration: underline;
}

.news-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.news-section-header h2 {
    color: var(--text-color);
    font-size: 16px;
    margin: 0;
}


/* Main Content ---------------------------------------------------------------- */
.main-content {
    padding: 20px;
}

.content-title {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--text-color);
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.categories-scroll-container {
    margin-bottom: 20px;
    position: relative;
}

.categories-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.categories-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    padding: 5px 0;
}

.categories-list::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.category-btn {
    white-space: nowrap;
    padding: 8px 16px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 4px;
    cursor: pointer;
}

.category-btn.active {
    background: var(--secondary-bg-color);
    color: var(--text-color);
    font-weight: bold;
}

.scroll-button {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    width: 150px;
    height: 40px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    padding: 0;
    transition: background-color 0.2s;
}

.scroll-button:hover {
    background-color: var(--secondary-bg-color);
}

.scroll-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.scroll-button.left {
    margin-right: 8px;
}

.scroll-button.right {
    margin-left: 8px;
}

.filters-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.filters-row .search-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}


.filters-row .search-container input {
    width: 100%;
    height: 40px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 0 4px 4px 0;  /* Rounded only on right side */
    padding: 8px 15px;
    color: var(--text-color);
    outline: none;  /* Remove focus outline */
}

.filters-row .search-container .search-submit {
    height: 40px;
    width: 40px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px 0 0 4px;  /* Rounded only on left side */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s, border-color 0.3s;
}

.filters-row .search-container .search-icon {
    width: 16px;
    height: 16px;
    opacity: 0.5;
}

.filters-row .time-selector select {
    height: 40px;
    padding: 0 15px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--secondary-text-color);
    min-width: 100px;
    cursor: pointer;
}


.filters-row .time-selector select:focus {
    outline: none;
    border-color: var(--accent-color);
}

.filters-row .search-container .search-submit:hover,
.filters-row .search-container .search-submit:active {
    background-color: var(--border-color);
}

.filters-row .search-container .search-submit img {
    width: 16px;
    height: 16px;
    opacity: 0.5;
}

.filters-row .search-container input:focus {
    outline: none;
    box-shadow: none;  /* Remove the default focus shadow */
}

.dapps-table {
    width: 100%;
    overflow-x: auto;
}

.dapps-table tr td:first-child {
    border-radius: 4px 0 0 4px;
}

.dapps-table tr td:last-child {
    border-radius: 0 4px 4px 0;
}

.dapps-table table {
    width: 100%;
    border-collapse: collapse; /* Use collapse to remove spacing */
}

.dapps-table th {
    color: var(--secondary-text-color);
    font-weight: normal;
    text-align: left;
    padding: 10px 15px;
    border-bottom: 1px solid var(--secondary-bg-color); /* Add underline */
}

.dapps-table td {
    background: transparent; /* Make rows transparent */
    padding: 15px;
    color: var(--secondary-text-color); /* Grey text */
    border-bottom: 1px solid var(--secondary-bg-color); /* Add underline */
    vertical-align: middle;
}

.tag {
    background: #00000000;
    border: 1px solid var(--border-color);
    padding: 4px 8px;
    border-radius: 4px;
    margin-right: 5px;
    font-size: 14px;
    color: var(--text-color); /* White text */
}

.ad-tag {
    color: #1BF688;
    font-weight: bold;
}

.percent-tag {
    color: #009E35;
    font-weight: bold;
}

.percent-tag:before {
    content: '+';
}

.percent-tag:after {
    content: '%';
}

.site-link {
    color: var(--secondary-text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-link:hover {
    color: var(--text-color);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
}

.pagination button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--secondary-bg-color);
    background: var(--primary-bg-color);
    color: var(--text-color);
    cursor: pointer;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination span {
    color: var(--text-color);
}

/* Leaderboard ---------------------------------------------------------------- */
.leaderboard-container {
    width: 100%;
    margin: auto;
    padding: 20px;
    color: white;
}

.leaderboard-title {
    margin-bottom: 1rem;
    font-size: 5vh !important;
    color: #d3d3d3 !important;
    text-align: center !important;
    font-family: sans-serif;
    font-weight: bold;
}

.leaderboard {
    background-color: black;
    border: 1px solid #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    max-width: 380px;
    margin: auto;
}

.leaderboard-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    justify-content: start;
    align-items: center;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #555;
    width: 100%;
    gap: 10px;
}

.leaderboard-item:last-child { border-bottom: none; }

.rank { font-weight: bold; }

.leaderboard-coins {
    display: flex;
    align-items: center;
    color: #FAE178 !important;
}

.leaderboard-coins::before {
    content: url("");
    margin-right: 0.5rem;
}

.current-user-on-leaderboard {
    color: #F14000;
    font-weight: 900;
}

/* Referral ---------------------------------------------------------------- */
.referral-container {
    width: 100%;
    margin: auto;
    padding: 20px;
    color: white;
    text-align: center;
}

.referral-title {
    font-size: 4vh !important;
    color: #d3d3d3;
    margin: 1rem auto;
    font-weight: bold;
}

.referral-link-box {
    background-color: #333;
    border-radius: 10px;
    padding: 1rem;
    margin: 1rem auto;
    position: relative;
    max-width: 400px;
}

.referral-link {
    color: #FAE178;
    word-break: break-all;
}

.copy-button {
    background-color: #333;
    border: none;
    color: white;
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    cursor: pointer;
    padding: 5px;
}

.referral-instructions, .referral-instructions-title {
    font-weight: bold;
    color: #d3d3d3;
    margin-top: 1rem;
    padding: 0 1rem;
}

.referral-instructions { font-size: 2vh; }
.referral-instructions-title { font-size: 3vh; }


/* Bottom text ---------------------------------------------------------------- */
h1 a, p a {
    color: #F14000 !important;
    text-decoration: none !important;
}

h1 a:hover, p a:hover {
    color: #F14000 !important;
    text-decoration: none !important;
}


/* Mobile ---------------------------------------------------------------- */

.mobile-nav-toggle {
    display: none;
}

.navbar-toggler {
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: transparent;
}

.navbar-toggler-icon {
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle;
    background-image: url("ececcfedc1cb7c3732aa8651f6461b6c109b466b.svg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100%;
}

@media (max-width: 1000px) { 
    /* Header Layout */
    .logo-container {
        padding: 0 15px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        height: 63px; /* Match logo height */
    }

    .mobile-nav-toggle {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        padding: 0 15px;
        height: 63px; /* Match logo height */
    }

    .navbar-toggler {
        padding: 8px 12px;
        border: 1px solid var(--border-color);
        border-radius: 4px;
        background-color: transparent;
        height: 40px; /* Fixed height */
        width: 40px; /* Fixed width */
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Ensure header row is properly aligned */
    header .row {
        flex-direction: row;
        margin: 0;
        width: 100%;
    }

    .scroll-button {
        width: 40px;  /* Increased from original width */
        height: 40px;
        min-width: 40px;  /* Added to ensure consistent width */
        font-size: 24px;  /* Optional: increase arrow size */
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .scroll-button.left {
        margin-right: 10px;
    }

    .scroll-button.right {
        margin-left: 10px;
    }

    /* Reset column padding */
    /* header .col-9,
    header .col-3 {
        padding: 0;
    } */

    /* Buttons Container */
    .buttons-container {
        padding: 0 15px;
        display: block !important;
    }
    
    .header-buttons {
        flex-direction: column;
        width: 100%;
        gap: 10px;
        height: auto;
    }

    .header-buttons .btn,
    .header-buttons .user-info {
        width: 100%;
        min-width: unset;
        height: 40px;
        margin: 0;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    /* Ensure the button content is centered */
    .header-buttons .btn > *,
    .header-buttons .user-info > * {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Remove any Bootstrap margins */
    .header-buttons .btn.me-2 {
        margin: 0 !important;
    }

    /* Main Layout */
    .row {
        flex-direction: column;
    }

    .main-content {
        order: 1;
        width: 100%;
    }

    .news-feed {
        order: 2;
        width: 100%;
        margin-top: 20px;
    }

    body.sidebar-active {
        overflow: hidden; /* Prevents background scrolling */
    }

    .col-md-2.sidebar {
        display: none;
        position: fixed;
        top: 72px; /* Height of the header */
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--bg-color);
        z-index: 1000;
        width: 100%;
        padding: 20px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }

    .col-md-2.sidebar.active {
        display: block;
    }

    /* Table Adjustments */
    .dapps-table {
        width: 100%;
        overflow-x: auto;
    }

    /* Hide specific columns on mobile */
    .dapps-table th:nth-child(3),
    .dapps-table td:nth-child(3),
    .dapps-table th:nth-child(5),
    .dapps-table td:nth-child(5) {
        display: none;
    }

    /* Table Structure */
    .dapps-table tr {
        display: flex;
        width: 100%;
    }

    .dapps-table td,
    .dapps-table th {
        padding: 10px;
        border-bottom: 1px solid var(--border-color);
    }

    /* Column Widths */
    .dapps-table td:nth-child(1),
    .dapps-table th:nth-child(1) {
        width: 50px;
        flex-shrink: 0;
    }

    .dapps-table td:nth-child(2),
    .dapps-table th:nth-child(2) {
        flex: 1;
    }

    .dapps-table td:nth-child(4),
    .dapps-table th:nth-child(4) {
        width: 120px;
        flex-shrink: 0;
    }

    /* Hide specific tags */
    .new-tag,
    .hot-tag {
        display: none !important;
    }
}