/* ----------------------------------------------------
   BASE THEME
----------------------------------------------------- */
body {
    background-color: #121212;
    color: #f5f5f5;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    font-size: 16px;
}

h1 { font-size: 1.8rem; margin: 0.5rem 0; }
h2 { font-size: 1.5rem; margin: 0.5rem 0; }
h3 { font-size: 1.2rem; margin: 0.5rem 0; }

/* ----------------------------------------------------
   GENERAL PAGE CONTAINERS
----------------------------------------------------- */
.container, .welcome-container, .swaps-container, .summary-wrapper {
    max-width: 900px;
    margin: 1rem auto;
    padding: 2rem;
    background-color: #1e1e1e;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    box-sizing: border-box;
}

.welcome-container { 
    position: relative;
    margin-top: 6rem; 
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

/* Buttons */
.logout-btn {
    position: absolute;
    top: 3rem;
    right: 1rem;
    background-color: red;
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    white-space: nowrap;
    transition: background 0.2s;
}

.logout-btn:hover {
    background-color: rgba(81, 2, 145, 0.7);
}

.export-btn {
    background-color: #33c6ff;
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.export-btn:hover {
    background-color: #1aa3cc;
}

.go-premium-btn {
    display: inline-block;
    background-color: green;
    color: #fff;
    padding: 6px 16px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 0.9em;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.go-premium-btn:hover {
    background-color: rgba(81, 2, 145, 0.7);
}

/* ----------------------------------------------------
   PROFILE + PREMIUM BADGE
----------------------------------------------------- */
.profile-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 1rem;
}

.profile-details h1 {
    margin-top: 1rem;
    font-size: 1.5rem;
}

.premium-badge {
    background-color: gold;
    color: #1e1e1e;
    margin-top: 1rem;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: bold;
}

/* ----------------------------------------------------
   LEADERBOARD SECTION
----------------------------------------------------- */
.leaderboard-section {
    margin-top: 2rem;
    margin-bottom: 2rem;        /* space after the section */
    padding-bottom: 1rem;       /* space before bottom border */
}

.leaderboard-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #33c6ff; /* blue line under heading */
    padding-bottom: 0.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.toggle-arrow {
    transition: transform 0.3s ease;
}

.leaderboard-section.collapsed .toggle-arrow {
    transform: rotate(180deg); /* turns ▲ into ▼ */
}

.leaderboard-section.collapsed .leaderboard-cards,
.leaderboard-section.collapsed .summary-cards {
    display: none; /* hides the content */
}

.leaderboard-section.collapsed .analytics-content {
    display: none;
}

.category-desc {
  font-size: 0.85rem;
  font-style: italic;
  color: #555; /* soft gray for readability */
  margin-top: 0.25rem;
}

.leaderboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.leaderboard-card {
    background: #1e1e1e;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 0 10px rgba(255,255,255,0.05);
}

.leaderboard-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.leaderboard-card ol {
    text-align: left;
    padding-left: 1.2rem;
}

.leaderboard-card li {
    margin: 4px 0;
}

.leaderboard-card p {
    font-weight: bold;
    color: #33c6ff;
    margin-top: 10px;
}

.leaderboard-card li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 6px;
}

.leaderboard-card li span.username {
    margin-left: 10px;
}

/* ----------------------------------------------------
   SUMMARY BOXES
----------------------------------------------------- */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: #1e1e1e;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 0 10px rgba(255,255,255,0.05);
}

.summary-card p {
    font-size: 1.6rem;
    margin: 0;
    color: #33c6ff;
}

/* ----------------------------------------------------
   FILTERS
----------------------------------------------------- */
.filters {
    display: flex;
    gap: 20px;
    background: #222;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.filters label {
    font-weight: bold;
    color: gold;
}

.filters select {
    background: #333;
    border: 1px solid #444;
    padding: 6px 10px;
    color: #ddd;
    border-radius: 6px;
}

/* ----------------------------------------------------
   CHARTS
----------------------------------------------------- */
.charts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

canvas {
    background: #141414;
    padding: 20px;
    border-radius: 12px;
}

/* ----------------------------------------------------
   PAGINATION
----------------------------------------------------- */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding-top: 12px;
    max-width: 100%;
}

.pagination button {
    background: #333;
    border: 1px solid #555;
    padding: 8px 14px;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    flex: 0 0 auto;
}

.pagination button:hover {
    background: #444;
}

/* ----------------------------------------------------
   SWAPS TABLE
----------------------------------------------------- */
.swaps-table-container {
    background: #1b1b1b;
    padding: 20px;
    border-radius: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    border-bottom: 1px solid #333;
}

th {
    color: gold;
    text-align: left;
}

/* ----------------------------------------------------
   MODAL OVERLAY
----------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(4px);
    display: flex;
    opacity: 0;
    visibility: hidden;
    justify-content: center;
    align-items: center;
    transition: opacity .3s ease, visibility .3s ease;
    z-index: 2000;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* fade-out */
.modal-overlay.closing {
    opacity: 0;
    visibility: hidden;
}

/* ----------------------------------------------------
   MODAL BOX
----------------------------------------------------- */
.modal-content {
    background: #1e1e1e;
    padding: 2rem;
    border-radius: 18px;
    width: 90%;
    max-width: 520px;
    box-shadow: 0 0 35px rgba(0,0,0,0.8);
    text-align: center;
    transform: scale(0.95);
    opacity: 0;
    transition: opacity .3s ease, transform .3s ease;
}

.modal-overlay.active .modal-content {
    opacity: 1;
    transform: scale(1);
}

.modal-overlay.closing .modal-content {
    opacity: 0;
    transform: scale(0.92);
}

/* ----------------------------------------------------
   TITLE + SUBTITLE
----------------------------------------------------- */
.modal-title {
    margin: 0;
    font-size: 1.9rem;
    color: gold;
}

.modal-subtitle {
    color: #ccc;
    font-size: 1rem;
    margin-top: .4rem;
}

/* ----------------------------------------------------
   FEATURES LIST
----------------------------------------------------- */
.modal-features {
    list-style: none;
    margin: 1.2rem 0;
    padding: 0;
    text-align: left;
    font-size: 1rem;
}

.modal-features li {
    padding: .4rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* ----------------------------------------------------
   PURCHASE STEPS
----------------------------------------------------- */
.purchase-steps {
    background: rgba(255,255,255,0.05);
    padding: 1rem;
    border-radius: 10px;
    text-align: left;
    margin-top: 1.4rem;
}

.purchase-steps h3 {
    margin: 0 0 .6rem 0;
}

.purchase-steps ol {
    margin: 0;
    padding-left: 1.3rem;
}

.purchase-steps li {
    padding: .3rem 0;
}

/* ----------------------------------------------------
   BUTTONS
----------------------------------------------------- */
.modal-buttons {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.8rem;
}

.modal-btn {
    padding: 0.7rem 1.4rem;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    flex: 1;
    text-align: center;
    text-decoration: none;
    color: white;
    transition: background .25s, transform .15s;
}

.modal-btn:hover {
    transform: translateY(-2px);
}

/* Red close button */
.modal-close-btn {
    background: red;
}

.modal-close-btn:hover {
    background: #ad6565;
}

/* Green premium button */
.modal-premium-btn {
    background-color: green;
}

.modal-premium-btn:hover {
    background-color: #598859;
}

/* ----------------------------------------------------
   DISCORD FOOTER
----------------------------------------------------- */
.discord-footer {
    width: 100%;
    text-align: center;
    margin: 2rem 0 0 0;
}

.discord-footer a {
    display: inline-block;
}

.discord-logo {
    width: 50px;          /* adjust size as desired */
    height: auto;
    transition: transform 0.2s;
}

.discord-logo:hover {
    transform: scale(1.1);
}

.my-logo {
    width: 100px;
    height: auto;
    transition: transform 0.3s;
}

.my-logo:hover {
    transform: scale(1.25);
}

/* ----------------------------------------------------
   CAROUSEL
----------------------------------------------------- */
.charts-carousel {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    overflow: hidden;
    border-radius: 10px;
    background: #121212;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.carousel-track {
    display: flex;
    transition: transform 0.3s ease;
}

.carousel-item {
    min-width: 100%;
    max-height: 400px; /* or whatever works */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.carousel-item canvas {
    max-height: 100%;
    width: auto !important; /* let Chart.js scale proportionally */
    height: auto !important;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 12px;
    border-radius: 5px;
}

.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }

.carousel-btn:hover {
    background: rgba(0,0,0,0.7);
}

.checkin-btn {
    padding: 12px 18px;
    margin-bottom: 2rem;
    font-size: 18px;
    border-radius: 8px;
    border: none;
    color: white;
    cursor: pointer;
}

.checkin-btn.active {
    background: #3cb371; /* green */
}

.checkin-btn.disabled {
    background: #555;
    cursor: not-allowed;
}

/* ----------------------------------------------------
   MOBILE PORTRAIT FIX
----------------------------------------------------- */
@media (max-width: 600px) {

    /* Containers fill width with gentle padding */
    .container,
    .welcome-container,
    .swaps-container,
    .summary-wrapper {
        max-width: 100%;
        margin: 0.5rem;
        padding: 1.5rem;
        border-radius: 12px;
    }

    /* Headings slightly larger for readability */
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.4rem; }
    h3 { font-size: 1.2rem; }

    /* Base text for tables, labels, and modal text */
    p, td, th, label, .modal-subtitle, .modal-features li {
        font-size: 1rem;
    }

    /* Increase vertical spacing so layout doesn’t feel tiny */
    .summary-cards { gap: 20px; }
    .filters { gap: 15px; }
    .charts { gap: 25px; margin-bottom: 30px; }
    .swaps-table-container { margin-bottom: 25px; }
    .modal-content { padding: 1.8rem; }

    /* Filter select boxes and buttons stack nicely */
    .filters {
        flex-direction: column;
    }

    .filters select {
        width: 100%;
        padding: 10px;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    /* Carousel and charts scale nicely */
    .charts-carousel {
        max-width: 100%;
        margin: 15px auto;
    }

    .carousel-item canvas {
        width: 100% !important;
        height: auto !important;
        max-height: 280px;
    }
}
