/* Page-specific Styles - Mithril Signers */
/* Set root color variables */
:root {
    /* Stake Color Brackets */
    --stake-under1M: linear-gradient(180deg, rgba(29,72,119, 0.8), rgba(27,138,90, 0.8));
    --stake-1-10M: linear-gradient(180deg, rgba(27,138,90, 0.8), rgba(251,176,33, 0.8));
    --stake-10-25M: linear-gradient(180deg, rgba(251,176,33, 0.8), rgba(246,136,56, 0.8));
    --stake-25-50M: linear-gradient(180deg, rgba(246,136,56, 0.8), rgba(238,62,50, 0.8));
    --stake-50-75M: linear-gradient(180deg, rgba(238,62,50, 0.8), rgba(178, 34, 34, 0.8));
    --stake-75-100M: linear-gradient(180deg, rgba(178, 34, 34, 0.8), var(--alt-primary-color));
}

/* Structure Styles */
body {
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh; /* Modern support for mobile browser bars */
}

main {
    flex: 1;
}

/* Content Styles */
#mithril-logo {
    align-items: center;
    justify-items: center;
    text-align: center;
}

#mithril-header {
  text-align: center;
}

#stake-info, #signer-count {
    text-align: center;
    font-size: 0.8rem;
    color: var(--accent-color);
    padding-top: 0.5rem;
}

/* Mithril Capacity Bar */
.capacity-container {
    width: 100%;
    max-width: 600px;
    margin: 1.5rem auto;
    font-family: 'Michroma', sans-serif;
}

.cap-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.cap-label { color: var(--secondary-color); font-size: 1rem; }
.cap-value { color: var(--secondary-color); font-weight: bold; }

.cap-track {
    width: 100%;
    height: 1rem;
    background: var(--alt-primary-color);
    border-radius: 8px;
    border: 1px solid #333;
    overflow: hidden;
}

.cap-fill {
    background: linear-gradient(90deg, red, orange);
    width: 0%;
    height: 100%;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.cap-footer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--accent-color);
    margin-top: 10px;
    font-family: 'Epilogue', sans-serif;
}

/* End Mithril Capacity Bar */

/* Ticker Grid */
#ticker-grid {
  display: grid;
  /* Adjust 100px to be wider or narrower based on ticker lengths */
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.ticker-card {
  background-color: var(--alt-primary-color);
  border: 1px solid var(--secondary-color);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 400;
  font-family: 'Michroma', Arial, sans-serif;
  color: var(--secondary-color);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: fadeInUp 0.3s ease forwards;
}

.ticker-card:hover {
    color: var(--primary-color);
    background: linear-gradient(180deg, #fd1f0f, #f88a0d) !important;
    outline: 2px solid var(--secondary-color);
    scale: 1.1;
}

/* Container for the switches and their labels */
/* Styling for the Toggle Button */
.toggle-container {
    text-align: center;
    margin: 10px 0;
}

.switch-wrapper {
    display: inline-flex;
    align-items: center;
    margin: 10px 20px;
    vertical-align: middle;
    min-width: 170px;
}

.switch-label {
    display: inline-block; 
    width: 220x; 
    text-align: left;
    vertical-align: middle;
    margin-left: 12px;
    font-family: 'Michroma', sans-serif;
    font-size: 0.85rem;
    color: var(--secondary-color);
    cursor: pointer;
}

/* The switch container */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

/* Hide default HTML checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The slider track */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #444;
    transition: .4s;
    border-radius: 34px;
    border: 1px solid var(--secondary-color);
}

/* The sliding circle */
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Logic for "Checked" state */
input:checked + .slider {
    background: linear-gradient(180deg, #fd1f0f, #f88a0d);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--accent-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* Animation for sorting/filtering */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search Bar */
.search-container {
  position: sticky;
  display: flex;
  justify-content: center;
  padding: 10px 20px;
  backdrop-filter: blur(5px);
}

#ticker-search {
  width: 100%;
  max-width: 400px;
  padding: 12px 20px;
  color: var(--secondary-color);
  background-color: var(--alt-primary-color);
  border: 2px solid var(--secondary-color);
  border-radius: 25px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s;
}

#ticker-search:focus {
  border-color: var(--accent-color);
}

#no-results {
  font-family: 'Epilogue', Arial, sans-serif;
  font-size: 1rem;
  text-align: center; 
  padding: 40px; 
  color: var(--accent-color);
}

/* New Stake Color Toggle Styles */
/* Only apply colors when the toggle is active */
#ticker-grid.show-weight .ticker-card[data-bracket="under1M"] { background: var(--stake-under1M); }
#ticker-grid.show-weight .ticker-card[data-bracket="1-10M"] { background: var(--stake-1-10M); }
#ticker-grid.show-weight .ticker-card[data-bracket="10-25M"] { background: var(--stake-10-25M); }
#ticker-grid.show-weight .ticker-card[data-bracket="25-50M"] { background: var(--stake-25-50M); }
#ticker-grid.show-weight .ticker-card[data-bracket="50-75M"] { background: var(--stake-50-75M); }
#ticker-grid.show-weight .ticker-card[data-bracket="75-100M"] { background: var(--stake-75-100M); }
#ticker-grid.show-weight .ticker-card { color: var(--secondary-color); border-color: #fafaf980; border-width: 2px; }

.legend-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 10px;
    background: var(--alt-primary-color);
    border-radius: 10px;
    font-size: 0.8rem;
    color: var(--secondary-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Epilogue', Arial, sans-serif;
}

.swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
}

/* Match swatches to your card colors */
.under1M { background: var(--stake-under1M); }
.m1-10   { background: var(--stake-1-10M); }
.m10-25  { background: var(--stake-10-25M); }
.m25-50  { background: var(--stake-25-50M); }
.m50-75  { background: var(--stake-50-75M); }
.m75-100 { background: var(--stake-75-100M); }

/* Media Queries */
@media (max-width: 470px) {
  #ticker-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    padding: 10px;
  }
}