/* =========================================
   SIGMA Token - Chart Styles
   Unified chart styling - single source of truth
   ========================================= */

/* ===== Chart Section Layout ===== */
.charts-section-wrapper {
    margin-top: var(--spacing-3xl);
}

.charts-section-title {
    font-size: var(--font-xl);
    margin-bottom: var(--spacing-xl);
    color: var(--text-primary);
    text-align: center;
}

.chart-title-emoji {
    margin-right: 8px;
}

/* ===== Chart Tabs ===== */
.chart-tabs-wrapper {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.chart-tab {
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chart-tab-active,
.chart-tab.active {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: none;
    color: #000;
}

.chart-tab-inactive {
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    color: var(--text-primary);
}

.chart-tab-inactive:hover {
    border-color: rgba(255, 215, 0, 0.5);
}

/* ===== Chart Container ===== */
.chart-container {
    position: relative;
    height: 600px;
    min-height: 500px;
    width: 100%;
    background: #131722;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-secondary);
    box-shadow: var(--shadow-lg);
}

.chart-container-visible {
    display: block;
    visibility: visible;
}

.chart-container-hidden {
    display: none;
    visibility: hidden;
}

/* Responsive chart heights */
@media (max-width: 768px) {
    .chart-container {
        height: 450px;
        min-height: 350px;
    }
}

@media (max-width: 480px) {
    .chart-container {
        height: 350px;
        min-height: 300px;
        border-radius: var(--radius-md);
    }
}

/* ===== Chart Iframe Styles ===== */
.chart-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Hidden iframe - invisible but maintains dimensions */
.charts-iframe-hidden {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    opacity: 0;
    pointer-events: none;
    display: block;
}

/* Visible iframe - fully interactive */
.charts-iframe-visible {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    opacity: 1;
    pointer-events: auto;
    z-index: 10;
    display: block;
}

/* ===== Loading Placeholder ===== */
.iframe-loading-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #131722;
    color: var(--text-secondary);
    z-index: 5;
}

.chart-loading-icon {
    width: 80px;
    height: 80px;
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-loading-text {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-weight: 500;
    opacity: 0.8;
    animation: chartLoadingPulse 1.5s ease-in-out infinite;
}

/* ===== Shimmer Effect ===== */
.chart-shimmer {
    width: 90%;
    max-width: 600px;
    height: 300px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.03) 0%,
        rgba(255, 255, 255, 0.08) 50%,
        rgba(255, 255, 255, 0.03) 100%
    );
    background-size: 200% 100%;
    animation: chartShimmer 2s infinite;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.chart-shimmer::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.chart-shimmer::after {
    content: '';
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    height: 200px;
    background: linear-gradient(
        to top,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.03) 50%,
        transparent 100%
    );
    border-radius: 8px;
}

/* ===== Loading Spinner ===== */
.iframe-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 215, 0, 0.2);
    border-top-color: #FFD700;
    border-radius: 50%;
    animation: chartSpin 1s linear infinite;
    margin-bottom: 20px;
}

.iframe-loading-text {
    font-size: 16px;
    margin: 0;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== Chart Disclaimer ===== */
.chart-disclaimer {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-md);
    background: rgba(255, 215, 0, 0.05);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 215, 0, 0.2);
    text-align: center;
}

.chart-disclaimer-text {
    color: var(--text-secondary);
    font-size: var(--font-sm);
    margin: 0;
}

/* ===== Chart Resources ===== */
.chart-resources-wrapper {
    text-align: center;
    margin-top: var(--spacing-2xl);
}

.chart-resources-title {
    font-size: var(--font-lg);
    margin-bottom: var(--spacing-lg);
    color: var(--text-secondary);
}

.chart-resources-links {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Ad Blocker Warning ===== */
.chart-adblock-warning {
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.3);
    border-radius: var(--radius-md);
    animation: fadeIn 0.3s ease;
}

.adblock-warning-content {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
}

.adblock-warning-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.adblock-warning-text {
    flex: 1;
}

.adblock-warning-text strong {
    color: #FFA500;
    display: block;
    margin-bottom: 4px;
}

.adblock-warning-text p {
    color: var(--text-secondary);
    font-size: var(--font-sm);
    margin: 0;
}

.adblock-warning-text a {
    color: #FFD700;
    text-decoration: underline;
}

.adblock-warning-text a:hover {
    color: #FFA500;
}

.adblock-warning-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.adblock-warning-close:hover {
    opacity: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Animations ===== */
@keyframes chartLoadingPulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

@keyframes chartShimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes chartSpin {
    to {
        transform: rotate(360deg);
    }
}
