/* SET GLOBAL STYLES */
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    position: relative;
    min-height: 100vh;
    padding-bottom: 5rem;
    background: var(--background);
    font-family: "Helvetica", "Arial", sans-serif;
}

footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5rem;
    color: var(--text);
    text-align: center;
    padding: 1rem 0;
}

footer a {
    color: var(--text);
    text-decoration: none;
}

nav.navbar {
    background-color: var(--accent);
    box-shadow: 3px 3px 5px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 1rem;
    flex-wrap: nowrap;
    position: sticky;
    top: 0;
    z-index: 1000;
    gap: .5rem;
}
  
.nav-left, .nav-center, .nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}
  
.nav-center {
    flex: 1;
    flex-wrap: nowrap;
    overflow: hidden;
}
  
nav a {
    padding: 0.5rem 0.75rem;
    color: rgb(193 173 135);
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    border-radius: 4px;
    transition: background-color 200ms cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}
  
nav a:hover, nav a:focus-visible {
    opacity: 0.5;
}
  
.nav-right {
    gap: 0.5rem;
    display: flex;
    align-items: center;
}

.social-icons {
    display: flex;
    gap: .5rem;
}
  
.menu-button {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    display: none;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.sidebar-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
} 

.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 250px;
    max-width: 100%;
    background-color: var(--accent);
    box-shadow: -10px 0 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    padding: 0.5rem 1rem;
    transform: translateX(100%);
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
}
  
.sidebar.open {
    transform: translateX(0);
}
  
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-top: .5rem;
    margin-bottom: .5rem;
}
  
.sidebar-nav a {
    padding: 0.75rem 1rem;
    color: var(--text);
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
  
.sidebar-nav a:hover, .sidebar-nav a:focus-visible {
    opacity: 0.5;
}
  
.sidebar-social {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}
  
.close-sidebar {
    background: none;
    border: none;
    padding: 0.5rem;
    align-self: flex-end;
    cursor: pointer;
}

.social-icon {
    user-select: none;
    width: 1em;
    height: 1em;
    display: inline-block;
    flex-shrink: 0;
    fill: currentcolor;
    font-size: 1.5rem;
    color: rgb(131 116 92);
    transition: fill 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 800px) {
    .social-icons {
      display: none;
    }
}
  
@media (max-width: 450px) {
    .nav-center {
      display: none;
    }
    .menu-button {
      display: inline-flex;
    }
}

/* START OF NON-GLOBAL STYLES */

h1 {
    text-align: center;
    margin-top: 1rem;
}

.tabs {
    display: flex;
    justify-content: center;
    margin: 20px 0 20px 0;
    background-color: var(--accent);
}

.tab-link {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.2em;
    text-decoration: none;
    margin-right: 2em;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
}

.tab-link.active {
    color: rgb(193 173 135);
}

.tab-link:hover {
    opacity: 0.5;
}

/* STATS TAB START (GENERAL, GAMBA, WHEEL) */ 

#loading-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    justify-self: center;
    margin-bottom: 10px;
}

#loading-indicator-personal {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: 1.2rem;
}

#stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    max-width: clamp(320px, 90%, 900px);
    margin: 20px auto 40px auto;
    padding: 0 20px;
}

.stat-card {
    background: var(--accent-light);
    padding: 12px;
    border-radius: 6px;
    font-family: sans-serif;
    font-size: 14px;
}

.top-list-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}
  
.top-list-tab-link {
    background-color: var(--accent-light);
    color: var(--text);
    border: none;
    padding: 10px 16px;
    cursor: pointer;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.2s;
}
  
.top-list-tab-link.active {
    background-color: var(--secondary);
}
  
.top-list-tab-link:hover {
    background-color: var(--accent);
}  

.top-list-container {
    max-width: 600px;
    margin: auto;
}

.top-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0 2rem;
}

.top-list li.extra {
    display: none;
}

.top-list-item {
    background: var(--accent-light);
    margin: 0.5rem 0;
    padding: 0.75rem;
    border-radius: 4px;
}

.roulette-section, .slot-section {
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.roulette-section > h2,
.slot-section > h2 {
    max-width: clamp(320px, 90%, 900px);
    margin: 0 auto 12px auto;
    padding-left: 20px;
    box-sizing: border-box;
}

.roulette-section .top-list-tabs,
.slot-section .top-list-tabs {
    justify-content: center;
    margin-bottom: 16px;
}

.roulette-biggest {
    max-width: clamp(320px, 90%, 900px);
    display: flex;
    flex-direction: row;
    justify-self: center;
    margin-bottom: 20px;
    gap: 16px;
}

.slots-biggest {
    max-width: clamp(320px, 90%, 900px);
    display: flex;
    flex-direction: row;
    justify-self: center;
    margin-bottom: 20px;
    gap: 16px;
}

.stat-biggest-card {
    display: flex;
    align-items: center;
    background: var(--accent-light);
    border-radius: 12px;
    padding: 16px 20px;
    gap: 24px;
    max-width: 400px;
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.5);
    margin-bottom: 20px;
}
  
.icon-wrapper {
    background: var(--secondary);
    border-radius: 12px;
    width: 72px;
    height: 72px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 40px;
    color: var(--accent-light);
    flex-shrink: 0;
}
  
.text-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
  
.biggest-username {
    font-size: 12px;
    text-transform: uppercase;
    color: #aaa;
    letter-spacing: 1.5px;
    margin-bottom: 6px;
    font-weight: 600;
}
  
.biggest-amount {
    font-size: 28px;
    font-weight: 800;
    color: white;
    line-height: 1.2;
    margin-bottom: 2px;
}

.biggest-title {
    font-size: 14px;
    text-transform: uppercase;
    color: var(--text);
    letter-spacing: 1.5px;
    margin-bottom: 6px;
    font-weight: 600;
    border-top: 2px solid var(--secondary);
}

.toggleButton {
    background: none;
    color: var(--text);
    padding: 0;
    border: none;
    cursor: pointer;
}

.toggleButton:hover {
    text-decoration: underline;
    text-decoration-color: var(--secondary);
}

#charts-here {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.chart-wrapper {
    width: 100%;
    max-width: 100%;
    height: auto;
    position: relative;
    margin: 1rem 0;
    text-align: -webkit-center
}
  
.chart-wrapper svg {
    display: block;
    width: 100%;
    height: auto;
}

#subscription-tiers {
    width: 100%;
    max-width: 800px; /* or any constraint */
    aspect-ratio: 1 / 1;
}

#subscription-frequency {
    max-width: 1500px;
    position: relative;
}
  
#subscription-frequency svg {
    width: 100%;
    height: 100%;
}

#messages-per-day-30d {
    max-width: 1500px;
    position: relative;
}
  
#messages-per-day-30d svg {
    width: 100%;
    height: 100%;
}

#messages-per-month {
    max-width: 1500px;
    position: relative;
}
  
#messages-per-month svg {
    width: 100%;
    height: 100%;
}

#chat-colors {
    max-width: 700px;
    position: relative;
}
  
#chat-colors svg {
    width: 100%;
    height: 100%;
}  

#wheel-prizes {
    width: 100%;
    max-width: 800px; /* or any constraint */
    aspect-ratio: 1 / 1;
}

#top-wheel-spinners {
    width: 100%;
    max-width: 800px; /* or any constraint */
    aspect-ratio: 1 / 1;
}

/* STATS TAB END */

/* PERSONAL TAB START */
#personal-stats {
    width: 100%;
    max-width: 400px;
    margin: 2rem auto;
    padding: 1rem 1.2rem;
    background: var(--accent-light);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgb(0 0 0 / 0.1);
}
  
#personal-stats h3 {
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: 1.4rem;
    border-bottom: 2px solid var(--secondary);
    padding-bottom: 0.4rem;
}
  
#searchWrapper {
    margin-bottom: 1.2rem;
    display: flex;
    flex-direction: column;
}
  
#searchBar {
    width: 100%;
    padding: 0.5rem 0.8rem;
    border: 2px solid var(--secondary);
    background-color: var(--accent-light);
    color: var(--text);
    border-radius: 4px;
    transition: border-color 0.3s ease;
}

::placeholder {
    color: var(--text);
    opacity: 0.7;
}
  
#searchBar:focus {
    outline: none;
    border-color: var(--text);
}
  
#results {
    font-size: 1rem;
    line-height: 1.45;
}
  
#results p {
    margin: 0.4rem 0;
}
  
#results strong {
    font-weight: 600;
}
  
#results h4 {
    font-weight: 600;
    margin: 1.2rem 0 0.5rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.3rem;
}
  
#results ul {
    margin-left: 1.4rem;
    padding-left: 0;
    list-style-type: disc;
}
  
#results li {
    margin: 0.3rem 0;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background-color 0.15s ease;
    cursor: default;
    list-style: none;
}
  
#results li:hover {
    background-color: var(--accent);
}

/* PERSONAL TAB END */

@media (max-width: 768px) {
    .roulette-biggest,
    .slots-biggest {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 768px) {
    .tabs {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .tab-link {
        margin: 0.25rem;
    }

    .top-list-container {
        padding: 0 1rem;
    }

    .top-list {
        margin-left: 0;
    }
}

@media (max-width: 380px){
    .stat-biggest-card {
        flex-direction: column;
        text-align: center;
    }
}
