/* Minimal mini-controls styles added by assistant */
.mini-controls{
  margin-top: .75rem;
  padding-top: .5rem;
  border-top: 1px solid rgba(255,255,255,.08);
}

.mini-controls-row{
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
}

.mini-block{
  flex: 1 1 240px;
}

.mini-title{
  font-size: .75rem;
  opacity: .8;
  margin-bottom: .35rem;
  letter-spacing: .04em;
}

.mini-sliders{
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: .75rem;
}

.mini-slider{
  flex: 1 1 240px;
}

.mini-slider-head{
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: .85rem;
  margin-bottom: .15rem;
}

.mini-slider-val{
  opacity: .85;
  font-variant-numeric: tabular-nums;
}

.disabled-by-balance {
    opacity: .45 !important;
    cursor: not-allowed !important;
}
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

/*
 * Dinastycoin Club - Cosmic Premium Theme
 * This CSS file provides a modern, premium look inspired by the project's concept art.
 * It includes a cosmic background, glassmorphism cards, glowing highlights, and responsive design tweaks.
 */

/* Reset & base styles */
body {
    font-family: 'Inter', sans-serif;
    background: #0b0d10 url('background_swirl.png') no-repeat center center fixed;
    background-size: cover;
    color: #f5f5f5;
    min-height: 100vh;
    position: relative;
    padding-bottom: 200px; /* Space for activity log */
}

/* Overlay gradient to darken the cosmic background slightly */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Darker overlay for improved contrast: helps text stand out against the cosmic background */
    background: rgba(0, 0, 0, 0.7);
    pointer-events: none;
    z-index: -1;
}

/* Ensure dropdown menu appears above all content */
.dropdown-menu {
    z-index: 3000;
}

/* Style for status messages: fixed overlay at top center */
#status_messages {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 900px;
    z-index: 4000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}
#status_messages.alert {
    color: #0b0d10;
    font-weight: 600;
}

/* Lighten form labels and input text for better contrast */
.form-check-label,
.form-label,
input.form-control,
label.form-check-label,
small {
    /* Brighten small text for better legibility on dark backgrounds */
    color: #efefef;
}

/* Lighten card subtitle text for readability */
.card-body p,
.card-body span,
.card-body small {
    color: #e5e5e5;
}

/* Increase visibility of legend and account description text */
/* Increase visibility of legend and account description text */
.card-body .text-muted {
    color: #cfcfcf !important;
}

/* ============================================
   HEADER STYLING - 3 ZONE LAYOUT
   ============================================ */
header {
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    position: relative;
    z-index: 2000;
    overflow: visible;
}

/* Topbar Container - 3 Zone Flexbox Layout */
.topbar-container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start; /* align to top so token baselines can match */
    width: 100%;
    column-gap: 1rem;
    row-gap: 0.6rem;
}

/* LEFT ZONE: Logo + Title + DCY */
.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.header-logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.topbar-title-group {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.topbar-title-group h4 {
    font-size: 1.1rem;
    font-weight: 700;
    white-space: nowrap;
}

.topbar-title-group .badge {
    font-size: 0.65rem;
    padding: 0.2em 0.4em;
    background: linear-gradient(145deg, #47362b, #292118);
    border: none;
}

/* CENTER ZONE: ETHV A + ETHV B - Truly Centered */
.topbar-center {
    display: flex;
    gap: 1.5rem;
    align-items: baseline; /* prefer baseline so tokens align with ETHV C */
    justify-content: center;
    flex: 1;
    min-width: 0;
}

/* Tokens row inside center column (ETHV A + ETHV B) */
.topbar-center-tokens{
    display:flex;
    justify-content:center;
    align-items:baseline;
    gap:14px;
    width:100%;
    margin-top:2px;
}

/* Center column: balances row + mode switch below */
.topbar-center-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    flex: 1;
    min-width: 0;
}

.topbar-mode {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 999px;
    padding: 0.25rem;
}

.mode-toggle-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.mode-toggle-btn {
    cursor: pointer;
    user-select: none;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.75);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 160ms ease;
}

.mode-toggle-input:checked + .mode-toggle-btn {
    /* Default checked style: Standard (light-blue) */
    background: linear-gradient(135deg, rgba(30,136,229,0.95), rgba(21,101,192,0.65));
    color: #0b0d10;
    box-shadow: 0 8px 20px rgba(30,136,229,0.25);
}

/* Highlight Standard mode when monthly threshold completed */
.mode-toggle-btn.standard-completed {
    border: 2px solid #28a745;
    box-shadow: 0 0 0 .2rem rgba(40,167,69,0.25);
}

/* Legend completed — same visual effect as standard-completed */
.mode-toggle-btn.legend-completed {
    border: 2px solid #28a745;
    box-shadow: 0 0 0 .2rem rgba(40,167,69,0.25);
}

/* Legend account keeps the original gold highlight */
#account_legend:checked + .mode-toggle-btn {
    background: linear-gradient(135deg, rgba(229,179,91,0.95), rgba(229,179,91,0.65));
    color: #0b0d10;
    box-shadow: 0 8px 20px rgba(229,179,91,0.25);
}

.mode-hint {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.65);
}

/* RIGHT ZONE: ETHV C + Language Switcher */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

/* Sticky top bar */
.topbar-sticky {
    position: sticky;
    top: 0;
    z-index: 2500;
    backdrop-filter: blur(10px);
}

/* Right column (ETHV C row + Next Month underneath, aligned under ETHV C) */
.topbar-right-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    flex-shrink: 0;
}

.topbar-right-top {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-right-bottom {
    width: 100%;
}

.topbar-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
    align-items: center;
}

.topbar-reset {
    white-space: nowrap;
    border-radius: 0.75rem;
    font-weight: 800;
}

.topbar-next-month {
    padding: 0.30rem 0.65rem;
    font-weight: 800;
    border-radius: 0.75rem;
    white-space: nowrap;
}

/* Next Month button pop animation (scale on click for 200ms) */
#next_month_btn {
    transition: transform 200ms cubic-bezier(.2,.8,.2,1);
}
#next_month_btn.pop {
    transform: scale(1.06);
}

/* Right-side header grid: ETHV items, language and action buttons (keeps left/logo untouched)
   Implemented as a 3-column grid so we can place:
     col1 = centered group for ETHV A/B + profiles
     col2 = spacer (explicit gap)
     col3 = action group column (ETHV C + language + buttons)
   This is CSS-only and does not change any DOM structure or JS hooks.
*/
.topbar-right-grid, .right-header-grid{
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

/* ETHV row: only ETHV C remains in the right column; align baseline to match center tokens */
.ethv-row{
    display: flex;
    width: fit-content;    /* shrink to the intrinsic width of the actions block */
    align-self: center;    /* center the ethv-row over the actions block */
    justify-content: center;/* center ETHV C inside the same width */
    align-items: baseline; /* baseline align with A/B */
    gap: 12px;
}

/* Remove the large offset: ETHV C will be centered via the row width */
.top-ethv-c{ margin-left: 0; }

/* Language row should center relative to the actions below */
.lang-row{
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Actions grid: make it a compact inline-flex so lang-row centering matches width */
.topbar-actions-grid{
    display: inline-flex;
    gap: 16px;
    width: fit-content;
    justify-content: flex-end;
}

/* Profiles (Standard/Legend pills) should be centered under ETHV A/B: place them in col1, row2 */
.topbar-center .profiles-row, .topbar-right-grid .profiles-row{
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    justify-self: center;
    align-self: center;
}

/* Keep token-item visuals consistent across the three columns */
.top-ethv .token-item{ display:flex; align-items:center; gap:8px; }
.top-ethv .token-value, .top-ethv .token-eur{ display:inline-block; }


/* Disabled buttons should look neutral (requested) */
button:disabled,
.btn:disabled {
    opacity: 1;
    filter: none;
    background: #6c757d !important;
    border-color: #6c757d !important;
    color: #e9ecef !important;
    cursor: not-allowed;
}

/* Merchant contribution mini stats */
.merchant-contrib .mini-stat {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 0.75rem;
    padding: 0.75rem;
}
.merchant-contrib .mini-stat-label {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.75);
}
.merchant-contrib .mini-stat-value {
    font-weight: 800;
    font-size: 1.05rem;
    margin-top: 0.25rem;
}
.merchant-contrib .mini-table-title {
    font-weight: 800;
    margin-bottom: 0.5rem;
}

/* Token Item Styling */
.token-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: #ffffff;
    white-space: nowrap;
}

.token-item i {
    color: #e5b35b;
    font-size: 0.9rem;
}

.token-item .token-value {
    color: #fff;
    font-weight: 700;
}

.token-item .token-eur {
    font-size: 0.75rem;
    color: #b3b3b3;
}

/* DCY Item special styling */
.dcy-item {
    background: rgba(229, 179, 91, 0.15);
    padding: 0.35rem 0.65rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(229, 179, 91, 0.3);
}

.dcy-item i {
    color: #ffc107;
}

header .badge {
    font-size: 0.75rem;
    padding: 0.25em 0.5em;
    background: linear-gradient(145deg, #47362b, #292118);
    border: none;
}

/* Token summary styling - keeping for backwards compatibility */
#token_summary span {
    font-weight: 600;
    font-size: 0.875rem;
    color: #ffffff;
}
#token_summary span i {
    color: #e5b35b;
}
#token_summary small {
    font-size: 0.75rem;
    color: #d7d7d7;
}

/* Language selector */
.dropdown-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease;
}
.dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
}
.dropdown-menu {
    background-color: #1f222a;
    border: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    /* Ensure the language dropdown stays above all content and background effects */
    z-index: 5000;
    /* Allow scrolling if there are more items than fit in the viewport */
    max-height: 50vh;
    overflow-y: auto;
}
.dropdown-item {
    color: #f5f5f5;
}
.dropdown-item:hover, .dropdown-item:focus {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Navigation pills */
.nav-pills .nav-link {
    color: #f5f5f5;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 2rem;
    padding: 0.5rem 1rem;
    margin-right: 0.25rem;
    transition: all 0.2s ease;
}
.nav-pills .nav-link i {
    color: #e5b35b;
}
.nav-pills .nav-link.active {
    background: linear-gradient(145deg, #e5b35b, #ffa726);
    color: #0b0d10;
    box-shadow: 0 4px 12px rgba(255, 167, 38, 0.4);
}
.nav-pills .nav-link.active i {
    color: #0b0d10;
}
.nav-pills .nav-link:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Ensure only the active tab pane is visible. Bootstrap normally handles this,
   but add a minimal rule to protect against structural regressions. */
.tab-pane { display: none; }
.tab-pane.show.active { display: block; }


/* Card styling: glassmorphism effect */
.card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(6px);
    border-radius: 1rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.card-title {
    color: #f5f5f5;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Improve general text readability inside cards */
.card-body,
.form-check-label,
.form-label {
    color: #e0e0e0;
}

/* Lighten muted text for better contrast */
.text-muted {
    color: #b3b3b3 !important;
}
.card-body hr {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Buttons */
.btn-success {
    background: linear-gradient(145deg, #36d09d, #2bb673);
    border: none;
    color: #0b0d10;
    font-weight: 600;
    border-radius: 0.75rem;
}
.btn-success:hover {
    background: linear-gradient(145deg, #2bb673, #36d09d);
}
.btn-primary {
    background: linear-gradient(145deg, #1e88e5, #1565c0);
    border: none;
    color: #fff;
    font-weight: 600;
    border-radius: 0.75rem;
}
.btn-primary:hover {
    background: linear-gradient(145deg, #1565c0, #1e88e5);
}
.btn-warning {
    background: linear-gradient(145deg, #ffa726, #f57c00);
    border: none;
    color: #0b0d10;
    font-weight: 600;
    border-radius: 0.75rem;
}
.btn-warning:hover {
    background: linear-gradient(145deg, #f57c00, #ffa726);
}
.btn-outline-primary,
.btn-outline-success {
    border-radius: 0.75rem;
    font-weight: 600;
    color: #e5b35b;
    border-color: #e5b35b;
}
.btn-outline-primary:hover,
.btn-outline-success:hover {
    background: #e5b35b;
    color: #0b0d10;
}
.btn-outline-danger {
    border-radius: 0.75rem;
    font-weight: 600;
    color: #e53935;
    border-color: #e53935;
}
.btn-outline-danger:hover {
    background: #e53935;
    color: #f5f5f5;
}

/* Disabled wallet display */
.disabled-wallet {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Status messages */
#status_messages {
    z-index: 1000;
}
/* Base alert style to make message overlays blend with premium theme */
.alert {
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
/* Success messages (e.g. purchases, spends) */
.alert-success {
    background-color: rgba(60, 180, 75, 0.9); /* green with opacity */
    color: #ffffff;
}
/* Info messages (e.g. scenario applied) */
.alert-info {
    background-color: rgba(70, 130, 180, 0.9); /* blue with opacity */
    color: #ffffff;
}
/* Warning messages */
.alert-warning {
    background-color: rgba(255, 193, 7, 0.9);
    color: #0b0d10;
}
/* Error messages */
.alert-danger {
    background-color: rgba(211, 47, 47, 0.9);
    color: #ffffff;
}

/* Table styling */
.table-dark {
    --bs-table-bg: rgba(255, 255, 255, 0.05);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.07);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.1);
}
.table-dark thead th {
    color: #e5b35b;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}
.table-dark tbody td {
    color: #f5f5f5;
}
.table-dark tbody tr {
    transition: background-color 0.2s ease;
}
.table-dark tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Range slider custom style for market price slider */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    height: 0.25rem;
    border-radius: 0.5rem;
    background: linear-gradient(90deg, #ffa726 0%, #ffa726 var(--market-progress), rgba(255,255,255,0.2) var(--market-progress), rgba(255,255,255,0.2) 100%);
    outline: none;
    transition: opacity 0.2s;
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: #e5b35b;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(229, 179, 91, 0.6);
    transition: background 0.2s;
}
input[type=range]::-webkit-slider-thumb:hover {
    background: #f8c476;
}
input[type=range]::-moz-range-thumb {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: #e5b35b;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(229, 179, 91, 0.6);
    transition: background 0.2s;
}
input[type=range]::-moz-range-thumb:hover {
    background: #f8c476;
}

/* Burnings header: duplicated sliders next to title */
.burn-sliders{
    display:flex;
    align-items:center;
    gap:12px;
}

.burn-sliders .small-slider{
    width:170px;
    min-width:140px;
}

.burn-sliders .form-range{
    width:170px;
    height:0.25rem;
}

@media (max-width: 768px){
    .burn-sliders{ display:none; }
}

/* Scenario dropdown styling */
#predefined_scenarios_select {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f5f5f5;
    border-radius: 0.5rem;
}
#predefined_scenarios_select option {
    color: #0b0d10;
    background: #f5f5f5;
}

/* Inline layout for scenario selector + action buttons (safe, CSS only) */
.scenario-inline {
    display: flex;
    align-items: center;
    gap: 12px;
}

.scenario-inline select {
    flex: 1 1 auto;
    min-width: 220px;
}

.scenario-inline button {
    white-space: nowrap;
}

/* Withdraw buttons alignment: keep left + right withdraw buttons visually identical */
.withdraw-row{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 6px 0 10px 0;
    align-items: center;
}

.withdraw-row button,
.withdraw-row .btn{
    width: 100%;
    height: 42px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

@media (max-width: 900px){
    .withdraw-row{ grid-template-columns: 1fr; }
}

/* Small two-column top row labels */
.small-buttons-row .small-label{
        font-size: 0.85rem;
        font-weight: 700;
        opacity: 0.9;
}
.small-buttons-row .small-label + .d-flex{ margin-top: 6px; }
.small-buttons-row .btn-sm{ padding: 0.25rem 0.5rem; }

/* Profile dropdown matches scenario styling */
#profile_select {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f5f5f5;
    border-radius: 0.5rem;
}
#profile_select option {
    color: #0b0d10;
    background: #f5f5f5;
}

/* ============================================
   ACTIVITY LOG BANNER (BOTTOM)
   ============================================ */
.activity-log {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 17, 21, 0.97);
    border-top: 1px solid rgba(229, 179, 91, 0.3);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    z-index: 1500;
    max-height: 200px;
    display: flex;
    flex-direction: column;
}

.activity-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(229, 179, 91, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.activity-log-title {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: #e5b35b;
}

.activity-log-title i {
    color: #ffc107;
}

.activity-log-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.activity-log-actions .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

.activity-log-actions .btn-outline-secondary {
    color: #b3b3b3;
    border-color: #b3b3b3;
}

.activity-log-actions .btn-outline-secondary:hover {
    background: #b3b3b3;
    color: #0b0d10;
}

.activity-log-actions .btn-outline-danger {
    color: #e53935;
    border-color: #e53935;
}

.activity-log-actions .btn-outline-danger:hover {
    background: #e53935;
    color: #fff;
}

/* Inline activity log preview styling (appears next to the title when collapsed) */
.activity-log-title-row{
    display:flex;
    align-items:center;
    gap:.75rem;
    min-width:0;
}
.activity-log-preview{
    font-size:.85rem;
    opacity:.85;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    max-width:60vw;
    color: rgba(255,255,255,0.85);
}
/* Optional: when expanded, slightly mute the preview */
.activity-log:not(.is-collapsed) .activity-log-preview{
    opacity: .55;
}

/* Log List Area */
.activity-log-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
    /* show ~3 entries, scroll for the rest */
    max-height: 105px;
}

.activity-log-list::-webkit-scrollbar {
    width: 6px;
}

.activity-log-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.activity-log-list::-webkit-scrollbar-thumb {
    background: rgba(229, 179, 91, 0.4);
    border-radius: 3px;
}
/* COLLAPSE / EXPAND */
.activity-log {
  transition: max-height 220ms ease;
}

.activity-log.is-collapsed {
  max-height: 48px; /* only header visible */
}

.activity-log.is-collapsed .activity-log-list {
  display: none;
}

/* Preview element: visible only when collapsed. Shows a single-line summary of the latest log entry */
#logPreview {
    display: none;
    align-items: center;
    padding: 0.35rem 1rem;
    font-size: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    gap: 0.5rem;
}

.activity-log.is-collapsed #logPreview {
    display: flex;
}

/* Ensure the preview's details don't wrap and ellipsize */
#logPreview .log-details {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}


.activity-log-list::-webkit-scrollbar-thumb:hover {
    background: rgba(229, 179, 91, 0.6);
}

/* Log Entry Styling */
.log-entry {
    display: flex;
    align-items: flex-start;
    padding: 0.35rem 1rem;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.2s ease;
}

.log-entry:hover {
    background: rgba(255, 255, 255, 0.03);
}

.log-entry:last-child {
    border-bottom: none;
}

.log-timestamp {
    color: #888;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 0.75rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
    min-width: 70px;
}

.log-action {
    color: #e5b35b;
    font-weight: 600;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.log-details {
    color: #d0d0d0;
    flex: 1;
    word-break: break-word;
}

.log-delta {
    color: #4caf50;
}

.log-delta.negative {
    color: #f44336;
}

/* Empty log state */
.log-empty {
    text-align: center;
    color: #666;
    padding: 1rem;
    font-style: italic;
    font-size: 0.85rem;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 1200px) {
    .topbar-container {
        gap: 0.75rem;
    }
    
    .topbar-center {
        gap: 1rem;
    }
    
    .token-item {
        font-size: 0.8rem;
    }
}

@media (max-width: 992px) {
    .topbar-container {
        grid-template-columns: 1fr;
        justify-items: center;
    }
    
    .topbar-left {
        width: 100%;
        justify-content: center;
    }
    
    .topbar-center {
        flex: none;
        width: auto;
    }
    
    .topbar-right-col { width: 100%; align-items: center; }
    .topbar-actions-grid { max-width: 520px; }
}

@media (max-width: 768px) {
    .topbar-container {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 0.75rem;
    }
    
    .topbar-left,
    .topbar-center-col,
    .topbar-right-col {
        width: 100%;
        justify-content: center;
        gap: 0.5rem;
    }

    .topbar-actions-grid {
        width: 100%;
        max-width: 520px;
    }
    
    .topbar-title-group h4 {
        font-size: 1rem;
    }
    
    .token-item {
        font-size: 0.75rem;
    }
    
    .dcy-item {
        padding: 0.25rem 0.5rem;
    }
    
    #token_summary span {
        width: 50%;
        margin-bottom: 0.5rem;
    }
    
    .nav-pills .nav-link {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    /* Activity Log mobile adjustments */
    .activity-log {
        max-height: 150px;
    }
    
    .activity-log-header {
        padding: 0.375rem 0.75rem;
    }
    
    .activity-log-title {
        font-size: 0.8rem;
    }
    
    .log-entry {
        padding: 0.25rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .log-timestamp {
        font-size: 0.7rem;
        min-width: 55px;
    }
    
    body {
        padding-bottom: 160px;
    }
}

@media (max-width: 576px) {
    .topbar-left {
        flex-direction: column;
        text-align: center;
    }
    
    .topbar-title-group {
        align-items: center;
    }
    
    .topbar-center {
        flex-direction: column;
        gap: 0.35rem;
    }
    
    .topbar-right {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .activity-log-list {
        max-height: 100px;
    }
}

/* ============================
   STANDARD (LIGHT) THEME FIXES
   ============================ */

body.standard-theme {
    background: #f4f6fb;
    color: #101318;
}

body.standard-theme::before {
    background: rgba(255,255,255,0.0);
}

body.standard-theme .card {
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(16,19,24,0.10);
    box-shadow: 0 8px 24px rgba(16,19,24,0.08);
    color: #101318;
}

body.standard-theme .card-title,
body.standard-theme h5,
body.standard-theme h6,
body.standard-theme p {
    color: #101318;
}

body.standard-theme .text-muted {
    color: rgba(16,19,24,0.65) !important;
}

/* Burn table readability (Bootstrap table-dark overrides) */
body.standard-theme .table-dark {
    --bs-table-bg: rgba(255,255,255,0.98);
    --bs-table-striped-bg: rgba(16,19,24,0.035);
    --bs-table-striped-color: #101318;
    --bs-table-color: #101318;
    --bs-table-hover-color: #101318;
    --bs-table-active-color: #101318;
}

body.standard-theme .table-dark th,
body.standard-theme .table-dark td {
    color: #101318 !important;
    opacity: 1 !important;
}

body.standard-theme .table-dark thead th {
    background: rgba(16,19,24,0.06) !important;
    color: #101318 !important;
}
/* =========================================================
   STANDARD (LIGHT) – FORCE CONTENT TEXT TO DARK
   EXCLUDES: TOP BANNER + ACTIVITY LOG
   Paste this at the END of style.css
   ========================================================= */

body.standard-theme :where(*)
  :not(header):not(header *)
  :not(.topbar-container):not(.topbar-container *)
  :not(.activity-log):not(.activity-log *) {
  color: #101318 !important;
  opacity: 1 !important;
}

/* Headings (content only) */
body.standard-theme :where(h1,h2,h3,h4,h5,h6)
  :not(header):not(header *)
  :not(.topbar-container):not(.topbar-container *)
  :not(.activity-log):not(.activity-log *) {
  color: #0b0d12 !important;
}

/* Muted text still muted but readable (content only) */
body.standard-theme :where(.text-muted, small, .form-text)
  :not(header):not(header *)
  :not(.topbar-container):not(.topbar-container *)
  :not(.activity-log):not(.activity-log *) {
  color: rgba(16, 19, 24, 0.70) !important;
  opacity: 1 !important;
}

/* Inputs / selects / textarea readable (content only) */
body.standard-theme :where(input, textarea, select)
  :not(header):not(header *)
  :not(.topbar-container):not(.topbar-container *)
  :not(.activity-log):not(.activity-log *) {
  color: #101318 !important;
  background-color: #ffffff !important;
}

/* Placeholder readable (content only) */
body.standard-theme :where(input::placeholder, textarea::placeholder)
  :not(header):not(header *)
  :not(.topbar-container):not(.topbar-container *)
  :not(.activity-log):not(.activity-log *) {
  color: rgba(16, 19, 24, 0.45) !important;
  opacity: 1 !important;
}

/* Tables readability (content only) */
body.standard-theme :where(table, th, td)
  :not(header):not(header *)
  :not(.topbar-container):not(.topbar-container *)
  :not(.activity-log):not(.activity-log *) {
  color: #101318 !important;
  opacity: 1 !important;
}

body.standard-theme :where(thead th)
  :not(header):not(header *)
  :not(.topbar-container):not(.topbar-container *)
  :not(.activity-log):not(.activity-log *) {
  background: rgba(16, 19, 24, 0.06) !important;
  color: #0b0d12 !important;
}

/* Kill Bootstrap washed-out opacity inside content only */
body.standard-theme :where(.opacity-50, .opacity-75)
  :not(header):not(header *)
  :not(.topbar-container):not(.topbar-container *)
  :not(.activity-log):not(.activity-log *) {
  opacity: 1 !important;
}


/* Mode toggle: stacked label lines (Standard / Legend) */
.mode-toggle-btn {
    flex-direction: column;
    align-items: center;
    line-height: 1.05;
}
.mode-toggle-btn .mode-top {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.mode-toggle-btn .mode-sub {
    font-size: 0.70rem;
    font-weight: 700;
    opacity: 0.75;
}
/* FORCE Buy/Spend into 2 real columns (only this section) */
.ethv-two-cols{
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 1rem !important;
  align-items: start !important;
  width: 100% !important;
}

/* Ensure each side stays in its own column */
.ethv-two-cols .ethv-col{
  min-width: 0;
}

/* Visual alignment */
.ethv-two-cols .ethv-col-buy{
  text-align: left;
}

.ethv-two-cols .ethv-col-spend{
  text-align: right;
}

/* Keep the switch text readable even if container is right-aligned */
.ethv-two-cols .ethv-col-spend .form-check{
  text-align: left;
  margin-left: auto;
  max-width: 520px;
}

/* Mobile: stack */
@media (max-width: 767.98px){
  .ethv-two-cols{
    grid-template-columns: 1fr !important;
  }
  .ethv-two-cols .ethv-col-spend{
    text-align: left;
  }
  .ethv-two-cols .ethv-col-spend .form-check{
    margin-left: 0;
    max-width: 100%;
  }
}
/* Title + description on same row */
#step-acquire .buyspend-title-row{
  display:flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

#step-acquire .buyspend-desc{
  margin: 0;
}

/* Optional: keep the description from becoming too wide */
@media (min-width: 768px){
  #step-acquire .buyspend-desc{
    max-width: 720px;
  }
}

/* Ensure the withdraw areas above each wallet column reserve the same space
     so the wallet cards begin aligned vertically even if button heights differ.
     Uses the parent .col-lg-6 that contains the withdraw buttons and applies
     the rule to the immediate .mb-3 wrapper (common in this layout).
     Note: this uses :has(), which is supported by modern browsers (2024+).
*/
.col-lg-6:has(#withdraw_ethvb_btn) > .mb-3,
.col-lg-6:has(#withdraw_ethva_btn) > .mb-3 {
    min-height: 0; /* reduced reserved height */
    display: flex;
    align-items: center; /* center items vertically in tighter space */
    gap: 12px;
}

.col-lg-6:has(#merchant_withdraw_btn) > .mb-3 {
    min-height: 0; /* reduced reserved height */
    display: flex;
    align-items: center;
    justify-content: flex-end; /* keep merchant withdraw to the right */
}

/* Ensure buttons don't wrap and change height unexpectedly */
.col-lg-6:has(#withdraw_ethvb_btn) > .mb-3 .btn,
.col-lg-6:has(#withdraw_ethva_btn) > .mb-3 .btn,
.col-lg-6:has(#merchant_withdraw_btn) > .mb-3 .btn {
    white-space: nowrap;
}
/* Wallets tab: reduce vertical whitespace above cards */
#step-benefit .col-lg-6 > .mb-3{
    margin-bottom: .5rem !important;
}

/* Reduce reserved height for top toolbars (was 64px) */
.col-lg-6:has(#withdraw_ethvb_btn) > .mb-3,
.col-lg-6:has(#withdraw_ethva_btn) > .mb-3,
.col-lg-6:has(#merchant_withdraw_btn) > .mb-3{
    min-height: 0 !important;      /* or 36px if you want */
    align-items: center !important; /* instead of flex-end */
}
/* =========================================================
   COMPACT MODE (Content only)
   Smaller fonts + tighter spacing to reduce scrolling.
   Excludes: header + activity log (keep them readable)
   ========================================================= */

:root{
  --content-font-size: 0.92rem;   /* ~14.7px if browser base is 16px */
  --content-line-height: 1.22;
  --content-p-margin: 0.35rem;
  --content-small-size: 0.82rem;
  --content-label-size: 0.88rem;
  --content-card-padding-y: 0.85rem;
}

/* Apply only to main content area (NOT header, NOT activity log) */
body :where(main, .container, .container-fluid)
  :not(header):not(header *)
  :not(.activity-log):not(.activity-log *) {
  font-size: var(--content-font-size);
  line-height: var(--content-line-height);
}

/* Tighten paragraph spacing inside cards */
.card-body :where(p){
  margin-bottom: var(--content-p-margin);
  line-height: var(--content-line-height);
}

/* Make “small” and helper texts smaller */
.card-body :where(small, .form-text, .text-muted){
  font-size: var(--content-small-size) !important;
  line-height: 1.18;
}

/* Labels + checkbox labels a bit smaller */
:where(.form-label, .form-check-label){
  font-size: var(--content-label-size);
  line-height: 1.18;
}

/* Card paddings slightly reduced (content only) */
.card .card-body{
  padding-top: var(--content-card-padding-y);
  padding-bottom: var(--content-card-padding-y);
}

/* Reduce vertical spacing in Bootstrap stacks */
.mb-4{ margin-bottom: 1rem !important; }
.mb-3{ margin-bottom: 0.75rem !important; }
.mt-4{ margin-top: 1rem !important; }

/* Nav pills a bit tighter (still clickable) */
.nav-pills .nav-link{
  padding: 0.42rem 0.85rem;
  font-size: 0.92rem;
}

/* Tables slightly tighter */
.table :where(th, td){
  padding-top: 0.45rem !important;
  padding-bottom: 0.45rem !important;
  line-height: 1.18;
}

/* Mobile: keep readable but still compact */
@media (max-width: 576px){
  :root{
    --content-font-size: 0.90rem;
    --content-line-height: 1.20;
  }
}

/* Tighten vertical spacing around Buy/Spend/Withdraw groups in Wallets */
/* Use :has() to scope to the specific mb-3 wrappers that contain these controls */
.col-lg-6 > .mb-3:has(.buy_ethva),
.col-lg-6 > .mb-3:has(.spend_merchant),
.col-lg-6 > .mb-3:has(#withdraw_ethvb_btn),
.col-lg-6 > .mb-3:has(#withdraw_ethva_btn),
.col-lg-6 > .mb-3:has(#merchant_withdraw_btn) {
    margin-top: 0.25rem; /* reduce top gap */
    margin-bottom: 0.4rem; /* reduce bottom gap */
    padding-top: 0; 
    padding-bottom: 0;
}

/* Counteract any utility margin helper (e.g., mt-3) on the merchant withdraw button */
#merchant_withdraw_btn {
    margin-top: 0.4rem !important;
}

/* Make the small quick buttons a tighter cluster */
.buy_ethva.btn-sm, .spend_merchant.btn-sm {
    padding: 0.28rem 0.6rem;
    margin: 0 0.25rem;
}

/* Ensure the centered container doesn't add extra vertical spacing */
.d-flex.justify-content-center.w-100 {
    margin-top: 0;
    margin-bottom: 0;
}

/* Fix input readability (Legend / dark UI) */
.form-control,
input.form-control,
input[type="number"],
input[type="text"]{
    color: #111 !important;
    -webkit-text-fill-color: #111 !important; /* Safari/iOS */
    opacity: 1 !important;
}

.form-control::placeholder,
input[type="number"]::placeholder,
input[type="text"]::placeholder{
    color: rgba(0,0,0,.45) !important;
    opacity: 1 !important;
}

/* Monthly progress bar styling: compact, matching dimensions for BUY and SPEND */
.monthly-progress {
    height: 14px; /* ensure same height */
    margin-top: 8px; /* compact spacing */
}
.monthly-progress .progress-bar {
    transition: width 160ms ease;
}
.monthly-progress-text {
    font-size: 0.9rem; /* match existing progress text size */
    margin-top: 6px;
    text-align: left;
    color: inherit;
}
.progress-bar-spend {
    /* soft blue gradient for spend bar */
    background: linear-gradient(145deg, #63a4ff, #1e88e5);
}

/* Grid layout to align BUY and SPEND controls perfectly */
.ethv-grid{
    display:grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto auto;
    column-gap: 24px;
    row-gap: 10px;
    align-items:start;
}
.buy-title{ grid-column:1; grid-row:1; }
.spend-title{ grid-column:2; grid-row:1; }

.buy-controls{ grid-column:1; grid-row:2; }
.spend-controls{ grid-column:2; grid-row:2; display:grid; grid-template-columns: auto 1fr; column-gap:16px; align-items:center; }

.buy-progress{ grid-column:1; grid-row:3; }
.spend-progress{ grid-column:2; grid-row:3; }

.buy-label{ grid-column:1; grid-row:4; font-size:0.95rem; opacity:0.95; }
.spend-label{ grid-column:2; grid-row:4; font-size:0.95rem; opacity:0.95; }

/* Spend controls nested layout */
.spend-buttons{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.spend-toggle{ justify-self:stretch; align-self:center; max-width:520px; }
.spend-toggle .form-check{ margin:0; }
.spend-toggle .form-check-label{ line-height:1.2; }
.spend-toggle small{ display:block; margin-top:4px; opacity:0.85; font-size:0.9rem; }

/* Visual dimming when toggle unavailable */
.disabled-toggle { opacity: 0.55; }

/* Ensure both progress bars have identical spacing/height */
.progress{ height: 14px; }
.monthly-progress .progress-bar { transition: width 160ms ease; }

/* Gold gradient for completed progress */
.progress-complete {
    background: linear-gradient(
        90deg,
        #cfa94a,
        #e6c66a,
        #f5e08a
    ) !important;
    box-shadow: 0 0 8px rgba(207, 169, 74, 0.6);
}

/* Network card header layout for the Save Scenario button */
.network-header-row { display:flex; align-items:center; justify-content:space-between; gap:12px; }
#save_scenario_btn { white-space:nowrap; }
