:root {
    /* Local Specific Overrides or Additions if strictly necessary */
    --color-spring-green: #16C784;
    /* Mantendo cores específicas de trading não encontradas no global */
    --color-red-market: #EA3943;

    /* Mapping Local to Global for easier refactoring if needed, or using direct globals */
}

/* --- Global Overrides --- */
.main-header,
.main-footer {
    display: none !important;
}

#main-content {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* --- Layout Structure --- */
.inky-totem {
    width: 100vw;
    min-height: 100vh;
    padding: var(--spacing-lg);
    box-sizing: border-box;

    /* Forced dark background for the totem base */
    max-width: 100%;
    margin: 0 auto;
    margin-left: -15px;
    padding-bottom: var(--spacing-sm);
    padding-left: var(--spacing-xs);
    font-family: var(--font-family-base);

    position: relative;
    left: 12px;
}

/* Ensure background covers everything */
body {
    background-color: var(--bg);
    color: var(--text);
    min-height: 100svh;
    margin: 0;
    padding: var(--spacing-md);
    font-size: var(--font-size-base);
    font-family: var(--font-family-base);
    line-height: var(--line-height-base);
    display: grid;
    place-items: center;
    gap: var(--spacing-xl);
    box-sizing: border-box;
}

* {
    box-sizing: border-box;
}

.dashboard-container {
    padding: var(--spacing-xl);
    background: var(--surface);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    color: var(--text);
    position: relative;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 auto;
    box-shadow: var(--shadow-card);
    margin-bottom: 10px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
}

/* --- Token Info --- */
.token-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.token-icon {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background-color: var(--surface-2);
    object-fit: cover;
}

.token-name {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.15px;
    margin: 0;
    color: var(--text);
}

.token-sub {
    color: var(--primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-regular);
}

/* --- Price Display --- */
.price-display {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--spacing-sm);
}

.current-price {
    font-size: 8vh;
    font-weight: var(--font-weight-bold);
    color: var(--text);
}

.price-change {
    display: flex;
    align-items: center;
    gap: var(--spacing-xxs);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-regular);
    margin: -15px 0 0 20px;
}

.price-change .positive,
.price-change-arrow-positive {
    color: var(--color-spring-green);
}

.price-change .negative,
.price-change-arrow-negative {
    color: var(--color-red-market);
}

/* --- Currency Selector --- */
.currency-selector {
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--bg);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: var(--spacing-xxs);
    cursor: pointer;
}

.currency-selector:hover {
    background-color: var(--bg);

}

/* --- Columns --- */
.main-content {
    display: flex;
    gap: 40px;
    /* Mantido fixo para layout específico, ou usar var(--spacing-xxl) */
    flex-wrap: wrap;
}

.left-column,
.right-column {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* --- Stats Grid --- */
.stats-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.stats-row {
    display: flex;
    gap: var(--spacing-sm);
}

.stat-card {
    flex: 1;
    padding: var(--spacing-lg);
    background: var(--bg-card, linear-gradient(339deg, rgba(255, 255, 255, 0.03) 0%, rgba(88.27, 88.27, 88.27, 0.03) 100%));
    border-radius: var(--radius-md);
    outline: 0.50px rgba(255, 255, 255, 0.1) solid;
    outline-offset: -0.50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-label {
    color: var(--primary);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    margin-bottom: var(--spacing-xxs);
    font-weight: var(--font-weight-medium);
}

.stat-value,
.stat-value-min,
.stat-value-max {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--text);
}

.stat-sub {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    margin-top: var(--spacing-xxs);
}

.contract-address {
    display: flex;
    align-items: center;
    gap: var(--spacing-xxs);
    font-size: var(--font-size-sm);
    word-break: break-all;
    font-family: var(--font-family-mono);
}

.copy-icon {
    width: 12px;
    height: 12px;
    background: var(--primary);
    cursor: pointer;
    display: inline-block;
}

/* --- Chart --- */
.chart-controls {
    display: flex;
    gap: var(--spacing-sm);
    background: var(--surface);
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    outline: 0.50px rgba(255, 255, 255, 0.1) solid;
    outline-offset: -0.50px;
    overflow-x: auto;
}

.chart-btn {
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text);
    background: transparent;
    border: none;
    font-family: inherit;
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-quick);
}

.chart-btn:hover {
    background: var(--surface-2);
}

.chart-btn.active {
    background: var(--primary);
    color: #121212;
    /* Texto escuro para contraste com primária */
}

.chart-area {
    width: 100%;
    height: 384px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 0.50px rgba(255, 255, 255, 0.1) solid;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* --- Market Ranges --- */
.market-ranges {
    display: flex;
    gap: var(--spacing-sm);
    padding: 0 var(--spacing-sm);
}

.range-card {
    flex: 1 1 calc(50% - 5px);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    outline: 0.50px rgba(255, 255, 255, 0.1) solid;
    outline-offset: -0.50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: auto;
    padding: var(--spacing-sm);
}

.range-label {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
}

.range-value {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    margin-top: 0;
    padding-top: 0.8rem;
}

.range-value.high {
    color: var(--color-spring-green);
}

.range-value.low {
    color: var(--color-red-market);
}

.range-value.avg {
    color: var(--text);
}

.range-value.range {
    color: var(--primary);
}

/* --- Carousel --- */
.carousel {
    --items: 6;
    --carousel-duration: 40s;
    --carousel-width: 100%;
    --carousel-item-width: 350px;
    --carousel-item-height: 150px;
    --carousel-item-gap: 1.5rem;

    position: relative;
    width: var(--carousel-width);
    height: var(--carousel-item-height);
    overflow: hidden;

    &[mask] {
        mask-image: linear-gradient(to right, transparent, black 5% 95%, transparent);
        -webkit-mask-image: linear-gradient(to right, transparent, black 5% 95%, transparent);
    }

    &[reverse]>article {
        animation-direction: reverse;
    }

    &:hover>article {
        animation-play-state: paused;
    }
}

@media (width > 600px) {
    .inky-carousel {
        --carousel-duration: 30s;
    }
}

.crypto-carousel>article {
    display: block;
    padding: var(--spacing-sm);
    gap: 0;
    border-radius: var(--radius-md);
    background: var(--clr-card-bg-light, white);
    /* Default light, dark handled by theme/mode query if needed or inline vars */
    /* Note: Theme mixin for cards might be better, but keeping simple for now */
    background: light-dark(white, rgba(255, 255, 255, 0.05));

    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-default), box-shadow var(--transition-default);

    will-change: transform;
    animation-name: inky-marquee;
    animation-duration: var(--carousel-duration) !important;
    animation-timing-function: linear;
    animation-iteration-count: infinite !important;
    animation-delay: calc(var(--carousel-duration) / var(--items) * 1 * var(--i) * -1);

    position: absolute;
    left: 100%;
}

/* Nth child for staggering */
.crypto-carousel>article:nth-child(1) {
    --i: 0;
}

.crypto-carousel>article:nth-child(2) {
    --i: 1;
}

.crypto-carousel>article:nth-child(3) {
    --i: 2;
}

.crypto-carousel>article:nth-child(4) {
    --i: 3;
}

.crypto-carousel>article:nth-child(5) {
    --i: 4;
}

.crypto-carousel>article:nth-child(6) {
    --i: 5;
}

.crypto-carousel>article:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    z-index: 10;
}

.crypto-content-wrapper {
    display: flex;
    flex-direction: column;
    height: 75%;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    margin: 10px;
}

.crypto-icon-svg {
    text-align: center;
    margin-bottom: var(--spacing-xxs);
}

.crypto-symbol {
    font-size: 1.9rem;
    /* Mantendo fixo para alinhar com design */
    font-weight: var(--font-weight-bold);
    margin: 0;
    color: var(--text);
}

.crypto-price {
    font-size: 2.2rem;
    font-weight: var(--font-weight-regular);
    margin: 0;
    color: var(--text-secondary);
}

.crypto-change {
    font-size: 1.9rem;
    font-weight: var(--font-weight-regular);
    margin: 0;
}

.crypto-change.positive {
    color: var(--color-spring-green);
}

.crypto-change.negative {
    color: var(--color-red-market);
}

.crypto-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
    margin-left: auto;
}

/* --- Media Queries --- */

@media (min-width: 850px) {

    .stats-row {
        height: 137px;
    }

    .inky-totem {
        left: 10px;
    }

    .range-card {
        flex: 1 1 calc(25% - 7.5px);
    }
}

@media (max-width: 1024px) {

    .inkryptus-grid,
    .feature-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .inkryptus-flex {
        flex-wrap: wrap !important;
        gap: var(--spacing-lg) !important;
    }

    .inkryptus-stat-block {
        flex: 1 1 45%;
        text-align: center;
    }

    section#event-blog .ibo-post-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 849px) {
    .inky-totem {
        margin-top: -10px !important;
        margin-left: -15px !important;

    }

    .current-price {
        font-size: 9.5vh;
    }

    .range-card {
        flex: 1 1 calc(50% - 5px);
    }
}

@media (max-width: 768px) {

    .inkryptus-grid,
    .feature-grid {
        grid-template-columns: 1fr !important;
    }

    .inkryptus-box,
    .inkryptus-card {
        width: 100% !important;
    }

    .inkryptus-flex {
        flex-direction: column !important;
        align-items: center !important;
    }

    #hero .inkryptus-grid,
    #venue .inkryptus-grid {
        display: flex !important;
        flex-direction: column !important;
    }

    #metrics .inkryptus-stat-number {
        font-size: 5rem !important;
    }

    iframe {
        height: 320px !important;
    }

    .inkryptus-button {
        display: block !important;
        margin: 1rem auto !important;
    }

    section#event-blog .ibo-post-grid {
        grid-template-columns: 1fr !important;
    }
}

@keyframes inky-marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc((var(--items) * (var(--carousel-item-width) + var(--carousel-item-gap))) * -1));
    }
}

/* Utilities */
.text-center {
    text-align: center;
}

.relative {
    position: relative;
}

/* New Utilities for Inline Style Removal */
.token-text-wrapper {
    bottom: 12px;
    position: relative;
}

.currency-code-text {
    font-size: 20px;
    font-weight: var(--font-weight-medium);
}

.currency-icon-placeholder {
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
}

.separator-line {
    margin: 10px 0;
    border-bottom: 1px solid var(--surface-3);
}

.crypto-icon-img {
    height: 32px;
    width: auto;
}

/* --- Light Theme Overrides --- */
body.light-theme .inky-totem {
    background-color: var(--light-bg);
}

body.light-theme .dashboard-container {
    background: var(--light-surface);
    box-shadow: var(--shadow-light-md);
    padding-bottom: 25px;
    margin-bottom: 18px;

}

body.light-theme .stat-card,
body.light-theme .range-card,
body.light-theme .chart-area,
body.light-theme .chart-controls {
    background: var(--light-surface-2);
    outline-color: rgba(0, 0, 0, 0.1);
    box-shadow: var(--shadow-light-sm);
    border-color: rgba(0, 0, 0, 0.05);
}

body.light-theme .chart-area {
    background: var(--light-surface);
}

/* CSS-only Chart Adaptation: Invert colors to make dark text/grid visible on light bg, then rotate hue to restore Green/Red semantics */
body.light-theme .chart-area canvas {
    filter: invert(1) hue-rotate(180deg);
}

body.light-theme .token-icon {
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-theme .currency-selector {
    background: #FFF;
    color: var(--dark-text);
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* Subtle border for definition */
}

body.light-theme .currency-selector:hover {
    background: #F2F2F2;
    /* Subtle grey hover */
}

body.light-theme .currency-icon-placeholder {
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-theme .chart-btn:hover {
    background: var(--light-surface-3);
    color: var(--dark-text);
}

body.light-theme .chart-btn.active {
    color: #121212;
    /* Keep contrast high on primary color */
}

/* Ensure text contrast in cards */
body.light-theme .range-label,
body.light-theme .stat-sub {
    color: var(--dark-text-secondary);
}

body.light-theme .stat-value,
body.light-theme .range-value.avg {
    color: var(--dark-text);
}

body.light-theme .crypto-carousel>article {
    background: var(--light-surface);
    box-shadow: var(--shadow-light-sm);
}

body.light-theme .crypto-symbol {
    color: var(--dark-text);
}

/* --- Floating Save Settings Button --- */
.save-settings-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #fbb03b36;
    color: #ffffff66;
    border: none;
    border-radius: 10%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s;
    z-index: 1000;
}

.save-settings-btn:hover {
    transform: scale(1.1);
    background-color: var(--primary-hover, #14b376);
    /* Fallback similar to primary */
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.save-settings-btn:active {
    transform: scale(0.95);
}

.save-settings-btn svg {
    fill: currentColor;
    width: 28px;
    height: 28px;
}

/* Saved Feedback Animation */
@keyframes savePulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(22, 199, 132, 0.7);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 15px rgba(22, 199, 132, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(22, 199, 132, 0);
    }
}

.save-settings-btn.saved {
    animation: savePulse 0.5s ease-out;
    background-color: var(--color-spring-green);
}