/* GAIKA - Japanese Carry Trader's Data Terminal Styles */
/* Simplified Color Scheme: Black, White, Gold, Silver (Greys) */

:root {
    --black: #000000;
    --black-soft: #0a0a0a;
    --grey-dark: #1a1a1a;
    --grey-medium: #2a2a2a;
    --grey-light: #404040;
    --grey-lighter: #606060;
    --silver: #a0a0a0;
    --silver-light: #c0c0c0;
    --white: #ffffff;
    --white-soft: #f5f5f5;
    --gold: #d4af37;
    --gold-light: #f0d78c;
    --gold-dark: #b8941f;

    /* Tron blue (live indicator) */
    --tron-blue: #00f0ff;

    /* Semantic mappings */
    --bg-primary: var(--black);
    --bg-secondary: var(--grey-dark);
    --bg-tertiary: var(--grey-medium);
    --text-primary: var(--white);
    --text-secondary: var(--silver);
    --text-dim: var(--grey-lighter);
    --accent-primary: var(--gold);
    --accent-secondary: var(--gold-light);
    --border-color: var(--grey-light);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    padding: 30px 0;
    border-bottom: 2px solid var(--bg-tertiary);
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

.tagline {
    font-size: 0.95rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.header-info {
    text-align: right;
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Language Switcher */
.language-switcher {
    display: flex;
    gap: 8px;
    background: var(--bg-tertiary);
    padding: 6px;
    border-radius: 25px;
}

/* Make flags uniform size */
.lang-btn {
    min-width: 44px;
    text-align: center;
}

.lang-btn {
    padding: 8px 14px;
    background: transparent;
    border: none;
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.lang-btn.active {
    background: var(--gold);
    color: var(--bg-secondary);
}

.update-time {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--gold);
    font-weight: 600;
    border: 1px solid rgba(212, 175, 55, 0.25);
}

.live-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #00f0ff;
    box-shadow: 0 0 15px #00f0ff, 0 0 30px #00f0ff;
    animation: megaPulse 1s ease-in-out infinite !important;
    display: inline-block;
    margin-right: 8px;
}

@keyframes megaPulse {
    0% {
        background: #00f0ff;
        box-shadow: 0 0 15px #00f0ff, 0 0 30px #00f0ff, 0 0 45px rgba(0, 240, 255, 0.5);
        transform: scale(1);
        opacity: 1;
    }

    50% {
        background: #00ffff;
        box-shadow: 0 0 25px #00ffff, 0 0 50px #00ffff, 0 0 75px rgba(0, 255, 255, 0.8);
        transform: scale(1.3);
        opacity: 0.8;
    }

    100% {
        background: #00f0ff;
        box-shadow: 0 0 15px #00f0ff, 0 0 30px #00f0ff, 0 0 45px rgba(0, 240, 255, 0.5);
        transform: scale(1);
        opacity: 1;
    }
}

.update-clock,
.update-tz {
    color: #00f0ff !important;
    text-shadow: 0 0 15px rgba(0, 240, 255, 0.8) !important;
    font-weight: 700 !important;
}

@keyframes livePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.65);
        opacity: 1;
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 240, 255, 0);
        opacity: 0.95;
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 240, 255, 0);
        opacity: 1;
    }
}

.update-text {
    color: var(--gold);
}

.update-clock {
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.update-tz {
    color: var(--text-secondary);
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Notification Banner */
.notification-banner {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 15px 50px 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    z-index: 3000;
    animation: slideDown 0.3s ease;
    min-width: 300px;
}

@keyframes slideDown {
    from {
        top: -100px;
        opacity: 0;
    }

    to {
        top: 20px;
        opacity: 1;
    }
}

.notification-banner.success {
    border-color: var(--gold);
}

.notification-banner.info {
    border-color: var(--gold);
}

.notification-banner.warning {
    border-color: var(--gold-light);
}

.notification-banner.error {
    border-color: var(--silver);
}

.notification-icon {
    font-size: 1.5rem;
}

.notification-text {
    color: var(--text-primary);
    font-size: 0.95rem;
    flex: 1;
}

.notification-close {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.notification-close:hover {
    color: var(--silver);
}

/* Hero Section - Charts */
.hero-section {
    margin-bottom: 60px;
}

.chart-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.chart-wrapper {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--bg-tertiary);
}

.chart-left {
    border-top: 3px solid var(--gold);
}

.chart-right {
    border-top: 3px solid var(--gold);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.chart-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.chart-symbol {
    padding: 10px 16px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 2px solid var(--gold);
    border-radius: 10px;
    color: var(--gold);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.2);
    min-width: 220px;
}

.chart-symbol:hover {
    border-color: #ffd700;
    background: linear-gradient(135deg, #333 0%, #222 100%);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    transform: translateY(-2px);
    color: #ffd700;
}

.chart-symbol:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.3);
    background: linear-gradient(135deg, #333 0%, #222 100%);
}

.chart-toggle {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chart-toggle:hover {
    background: var(--bg-secondary);
    border-color: var(--gold);
}

.chart-toggle.active {
    background: var(--gold);
    color: var(--bg-secondary);
    border-color: var(--gold);
}

/* Live Price Ticker */
.live-price-ticker {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(0, 255, 136, 0.05);
    border-left: 3px solid var(--gold);
    border-radius: 4px;
    margin-bottom: 15px;
}

.ticker-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

.ticker-change {
    font-size: 0.95rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
}

.ticker-change.positive {
    color: var(--gold);
    background: rgba(0, 255, 136, 0.1);
}

.ticker-change.negative {
    color: var(--silver);
    background: rgba(255, 0, 85, 0.1);
}

.chart-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
}

.chart-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.chart-badge.king {
    background: var(--gold);
    color: var(--bg-secondary);
}

.chart-badge.yield-king {
    background: var(--gold);
    color: var(--bg-secondary);
}

.tradingview-chart {
    height: 420px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.chart-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--text-secondary);
    font-weight: 700;
    letter-spacing: 0.3px;
}

/* Table Sections */
.table-section {
    margin-bottom: 60px;
}

.section-header {
    margin-bottom: 25px;
}

/* Table Filters */
.table-filters {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--gold);
}

.filter-btn.active {
    background: var(--gold);
    color: var(--bg-secondary);
    border-color: var(--gold);
}

/* Comparison Mode Toggle */
.comparison-mode {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-left: auto;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    transition: 0.4s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: var(--text-secondary);
    transition: 0.4s;
    border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider {
    background-color: var(--gold);
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(24px);
    background-color: var(--bg-secondary);
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.table-responsive {
    overflow-x: auto;
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--bg-tertiary);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead tr {
    border-bottom: 2px solid var(--bg-tertiary);
}

.data-table th {
    padding: 16px 20px;
    text-align: left;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.data-table th.sortable:hover {
    background: rgba(255, 255, 255, 0.02);
}

.sort-icon {
    margin-left: 5px;
    color: var(--text-dim);
    font-size: 0.8rem;
}

.data-table td {
    padding: 18px 20px;
    font-size: 1rem;
    border-bottom: 1px solid var(--bg-tertiary);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.pair-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    position: relative;
}

.pair-compare {
    display: none;
    margin-right: 10px;
    cursor: pointer;
    accent-color: var(--gold);
}

.live-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
    margin-left: 8px;
    animation: pulse 2s ease-in-out infinite;
}

.live-indicator.pulse {
    animation: flash 0.5s ease-in-out;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

@keyframes flash {

    0%,
    100% {
        background: var(--gold);
        box-shadow: 0 0 0 0 var(--gold);
    }

    50% {
        background: var(--gold-light);
        box-shadow: 0 0 10px 2px var(--gold-light);
    }
}

/* Spread Update Animation */
.spread-updated {
    animation: highlightRow 2s ease-in-out;
}

@keyframes highlightRow {

    0%,
    100% {
        background: transparent;
    }

    50% {
        background: rgba(0, 255, 136, 0.1);
    }
}

.broker-type {
    font-size: 0.7rem;
    color: var(--text-dim);
    font-weight: 400;
    text-transform: none;
}

/* Best Spread Highlighting */
.best-spread {
    color: var(--gold);
    font-weight: 700;
    background: rgba(0, 255, 136, 0.1);
    position: relative;
    padding-left: 24px !important;
    /* Make room for checkmark */
}

.best-spread::before {
    content: '✓';
    position: absolute;
    left: 8px;
    /* Adjust position */
    color: var(--gold);
    font-weight: 700;
}

.why-column {
    width: 35%;
}

.why-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Primary Table Special Styling */
.primary-table .data-table {
    font-size: 1.05rem;
}

.primary-table .section-header h2 {
    background: linear-gradient(135deg, var(--silver), var(--gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Secondary Table - Smaller */
.secondary-table .table-responsive {
    padding: 20px;
    background: rgba(21, 27, 61, 0.5);
}

.small-table {
    font-size: 0.85rem;
}

.small-table th,
.small-table td {
    padding: 12px 16px;
}

/* Explainer Cards */
.explainer-section {
    margin: 80px 0;
}

.explainer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.explainer-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 35px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--bg-tertiary);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.explainer-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 48px rgba(0, 255, 136, 0.2);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.explainer-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--gold);
}

.explainer-card p {
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.explainer-card p strong {
    color: var(--text-primary);
}

.explainer-card .highlight {
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(0, 255, 136, 0.1);
    border-left: 3px solid var(--gold);
    border-radius: 4px;
    color: var(--text-primary);
    font-weight: 600;
}

.explainer-card .highlight.warning {
    background: rgba(255, 237, 0, 0.1);
    border-left-color: var(--gold-light);
    color: var(--gold-light);
}

/* Commodities Table */
.commodities-table .section-header h2 {
    color: var(--gold-light);
}

/* Footer */
.footer {
    margin-top: 80px;
    padding: 40px 0;
    border-top: 2px solid var(--bg-tertiary);
}

.footer-content {
    text-align: center;
}

.disclaimer {
    color: var(--text-dim);
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 20px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.footer-note {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .explainer-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .chart-container {
        grid-template-columns: 1fr;
    }

    .logo h1 {
        font-size: 2rem;
    }

    .header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .header-info {
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 10px;
    }

    .update-time {
        width: 100%;
        justify-content: center;
    }

    .language-switcher {
        width: 100%;
        justify-content: space-between;
    }

    .table-responsive {
        padding: 16px;
    }

    .data-table th,
    .data-table td {
        padding: 10px;
        font-size: 0.82rem;
        white-space: nowrap;
    }

    .why-text {
        white-space: normal;
    }

    .why-column {
        width: auto;
    }

    .section-header h2 {
        font-size: 1.4rem;
    }

    .explainer-card {
        padding: 20px;
    }

    /* Bigger tap targets */
    .filter-btn,
    .calc-button,
    .broker-cta,
    #chat-send {
        min-height: 44px;
    }

    /* Floating buttons spacing */
    .chat-toggle {
        bottom: 85px;
        right: 20px;
    }

    .admin-toggle {
        bottom: 20px;
        right: 20px;
    }
}

/* Calculator Section */
.calculator-section {
    margin: 80px 0;
}

.calculator-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.calculator-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--bg-tertiary);
}

.calculator-card h3 {
    font-size: 1.4rem;
    margin-bottom: 25px;
    color: var(--gold);
}

.calc-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.calc-input {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.calc-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

.calc-button {
    margin-top: 10px;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--gold), var(--gold));
    border: none;
    border-radius: 8px;
    color: var(--bg-secondary);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calc-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 255, 136, 0.3);
}

.calc-result {
    display: none;
    margin-top: 20px;
    padding: 20px;
    background: rgba(0, 255, 136, 0.05);
    border-left: 3px solid var(--gold);
    border-radius: 8px;
}

.result-item {
    padding: 8px 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.result-item strong {
    color: var(--text-primary);
}

.highlight-result {
    font-size: 1.1rem;
    color: var(--gold) !important;
    font-weight: 700;
    padding: 12px 0;
}

.highlight-result strong {
    color: var(--gold);
}

.result-note {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--bg-tertiary);
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* Affiliate Section */
.affiliate-section {
    margin: 80px 0;
    padding: 60px 0;
    background: linear-gradient(180deg, rgba(0, 255, 136, 0.03), rgba(0, 212, 255, 0.03));
    border-radius: 24px;
}

.broker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.broker-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 2px solid var(--bg-tertiary);
    transition: all 0.3s ease;
    position: relative;
}

.broker-card.featured {
    border-color: var(--gold);
}

.broker-card.domestic {
    border-color: var(--text-dim);
    opacity: 0.8;
}

.broker-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 48px rgba(0, 255, 136, 0.2);
}

.broker-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 16px;
    background: var(--gold);
    color: var(--bg-secondary);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 12px;
    white-space: nowrap;
}

.broker-badge.best-spreads {
    background: var(--silver);
}

.broker-badge.domestic-badge {
    background: var(--text-dim);
}

.broker-logo {
    text-align: center;
    margin: 20px 0 25px 0;
}

.broker-logo h3 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
}

.broker-features {
    margin: 25px 0;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.feature-icon {
    color: var(--gold);
    font-weight: 700;
    min-width: 20px;
}

.broker-card.domestic .feature-icon {
    color: var(--text-dim);
}

.broker-cta {
    display: block;
    margin-top: 25px;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--gold), var(--gold));
    color: var(--bg-secondary);
    text-align: center;
    text-decoration: none;
    font-weight: 700;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.broker-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 255, 136, 0.4);
}

.broker-cta.domestic-cta {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.broker-note {
    margin-top: 15px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-dim);
    line-height: 1.4;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 39, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    border: 2px solid var(--gold);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--gold);
}

.modal-body {
    margin: 25px 0;
}

.modal-highlight {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 15px;
}

.modal-note {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 15px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.modal-button {
    flex: 1;
    padding: 14px 24px;
    border-radius: 8px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
}

.modal-button.primary {
    background: linear-gradient(135deg, var(--gold), var(--gold));
    color: var(--bg-secondary);
    border: none;
}

.modal-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 255, 136, 0.4);
}

.modal-button.secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--bg-tertiary);
}

.modal-button.secondary:hover {
    background: var(--bg-secondary);
}

.modal-disclaimer {
    margin-top: 20px;
    font-size: 0.75rem;
    color: var(--text-dim);
    text-align: center;
    line-height: 1.4;
}

/* Animation */
@keyframes glow {

    0%,
    100% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    }

    50% {
        box-shadow: 0 8px 32px rgba(0, 255, 136, 0.3);
    }
}

.primary-table .table-responsive {
    animation: glow 3s ease-in-out infinite;
}

/* Admin Panel */
.admin-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 500px;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 2px solid var(--gold);
    box-shadow: -10px 0 50px rgba(0, 0, 0, 0.8);
    z-index: 2000;
    overflow-y: auto;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

.admin-header {
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    padding: 25px;
    border-bottom: 2px solid var(--bg-tertiary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.admin-header h2 {
    font-size: 1.5rem;
    color: var(--gold);
    margin: 0;
}

.close-admin {
    background: transparent;
    border: 2px solid var(--text-dim);
    color: var(--text-primary);
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-admin:hover {
    border-color: var(--silver);
    color: var(--silver);
    transform: rotate(90deg);
}

.admin-content {
    padding: 25px;
}

.admin-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--bg-tertiary);
}

.admin-section:last-child {
    border-bottom: none;
}

.admin-section h3 {
    font-size: 1.2rem;
    color: var(--gold);
    margin-bottom: 20px;
}

.spread-editor,
.affiliate-editor,
.data-manager,
.stats-display {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.spread-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.spread-row label {
    min-width: 60px;
    color: var(--text-secondary);
    font-weight: 600;
}

.spread-inputs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 15px 0;
}

.admin-input {
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.admin-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

/* Admin Sidebar Menu */
.admin-content {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.admin-menu {
    min-width: 200px;
    background: rgba(42, 42, 42, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 10px;
    border: 1px solid var(--bg-tertiary);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-menu-item {
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.admin-menu-item.active {
    background: var(--gold);
    color: var(--bg-primary);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

/* Admin Content Layout */
.admin-panels {
    flex: 1;
    background: rgba(26, 26, 26, 0.3);
    border-radius: 12px;
    padding: 25px;
    border: 1px solid var(--bg-tertiary);
}

.admin-section h3 {
    font-size: 1.4rem;
    color: var(--gold);
    margin-bottom: 25px;
    border-bottom: 1px solid var(--bg-tertiary);
    padding-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-button {
    padding: 12px 24px;
    background: var(--gold);
    border: none;
    border-radius: 8px;
    color: var(--bg-primary);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.full-width {
    width: 100%;
}

.affiliate-add-card,
.ai-settings-card {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.affiliate-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 15px;
}

.stats-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.input-hint {
    display: block;
    margin-top: 8px;
    color: var(--silver);
    font-size: 0.8rem;
}

.data-actions,
.stats-actions,
.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Affiliate Manage Cards */
.affiliate-manage-card {
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
}

.affiliate-manage-card:hover {
    border-color: var(--gold);
    transform: translateX(5px);
}

.affiliate-card-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.affiliate-info {
    flex: 1;
}

.affiliate-url {
    font-size: 0.8rem;
    color: var(--silver);
    margin: 4px 0;
}

.affiliate-url code {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    word-break: break-all;
    font-family: monospace;
}

.affiliate-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.affiliate-actions {
    display: flex;
    gap: 8px;
}

.admin-button.small {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.admin-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.3);
}

.admin-button.secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.admin-button.secondary:hover {
    background: var(--bg-secondary);
}

.admin-button.danger {
    background: var(--silver);
    color: white;
}

.admin-button.danger:hover {
    box-shadow: 0 6px 20px rgba(255, 0, 85, 0.3);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stat-value {
    color: var(--gold);
    font-weight: 700;
    font-size: 1.1rem;
}

/* Admin Toggle Button */
.admin-toggle {
    display: none;
    /* admin-only; shown after unlock */
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--gold), var(--gold));
    border: none;
    border-radius: 50%;
    font-size: 1.8rem;
    color: var(--bg-secondary);
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 255, 136, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
}

.admin-toggle:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 12px 32px rgba(0, 255, 136, 0.6);
}

/* AI Chatbot Widget */

/* Discrete copy button for bot messages */
.chat-message.bot-message {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bot-message-content {
    word-wrap: break-word;
}

.bot-message-actions {
    display: flex;
    gap: 8px;
    opacity: 1;
    transition: opacity 0.2s ease;
    align-self: flex-end;
}

.copy-btn {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    width: 28px;
    height: 28px;
    line-height: 26px;
    text-align: center;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: rgba(212, 175, 55, 0.1);
    transform: scale(1.05);
}

.chat-toggle {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--gold), var(--gold));
    border: none;
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--bg-secondary);
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
}

.chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(0, 212, 255, 0.6);
}

.chat-widget {
    position: fixed;
    bottom: 100px;
    right: 100px;
    width: 380px;
    height: 500px;
    background: var(--bg-secondary);
    border: 2px solid var(--gold);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8);
    z-index: 1500;
    display: none;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.chat-widget.open {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-header {
    background: var(--bg-secondary);
    padding: 15px 20px;
    border-bottom: 2px solid var(--gold);
    border-radius: 14px 14px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.chat-icon {
    font-size: 1.5rem;
}

.chat-minimize {
    background: transparent;
    border: 1px solid var(--text-dim);
    color: var(--text-secondary);
    font-size: 1.5rem;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-minimize:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 3px;
}

.chat-message {
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 85%;
    line-height: 1.5;
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    background: var(--gold);
    color: var(--bg-secondary);
    align-self: flex-end;
    margin-left: auto;
}

.bot-message {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-left: 3px solid var(--gold);
    align-self: flex-start;
}

.chat-input-area {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid var(--bg-tertiary);
    background: var(--bg-secondary);
    border-radius: 0 0 14px 14px;
}

#chat-input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

#chat-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

#chat-send {
    padding: 10px 20px;
    background: var(--gold);
    border: none;
    border-radius: 8px;
    color: var(--bg-secondary);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

#chat-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
}

/* Responsive - Calculators & Brokers */
@media (max-width: 1200px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }

    .broker-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-panel {
        width: 400px;
    }
}

@media (max-width: 768px) {
    .broker-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        padding: 30px 20px;
    }

    /* =========================================================================
   RESPONSIVE DESIGN (MOBILE OPTIMIZATION)
   ========================================================================= */

    @media (max-width: 768px) {

        /* --- Layout & Containers --- */
        .container {
            padding: 10px;
            width: 100%;
            box-sizing: border-box;
        }

        .header {
            flex-direction: column;
            gap: 15px;
            text-align: center;
        }

        .header-info {
            width: 100%;
            justify-content: center;
            flex-wrap: wrap;
            gap: 10px;
        }

        /* --- Charts (Hero) --- */
        .hero-section {
            margin-top: 15px;
        }

        .chart-container {
            grid-template-columns: 1fr;
            /* Stack vertically */
            gap: 20px;
        }

        .chart-header {
            flex-direction: column;
            align-items: flex-start;
            gap: 10px;
        }

        .chart-controls {
            width: 100%;
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            justify-content: space-between;
        }

        .chart-symbol {
            flex-grow: 1;
            /* Dropdown takes available space */
            min-width: 200px;
        }

        /* --- Tables --- */
        .table-responsive {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            border-radius: 8px;
            border: 1px solid var(--border-color);
        }

        .data-table th,
        .data-table td {
            white-space: nowrap;
            /* Prevent ugly wrapping */
            padding: 10px;
            font-size: 0.85rem;
        }

        /* --- Filtering & Controls --- */
        .table-filters {
            flex-direction: column;
            /* Stack filter buttons */
            gap: 10px;
            align-items: stretch;
        }

        .filter-btn {
            width: 100%;
            /* Full width buttons */
            text-align: center;
            padding: 10px;
        }

        .comparison-mode {
            width: 100%;
            justify-content: space-between;
            margin-top: 5px;
            padding: 10px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 8px;
        }

        /* --- Cards & Grid Layouts --- */
        .broker-grid,
        .explainer-grid,
        .calculator-grid,
        .stats-card-grid {
            grid-template-columns: 1fr;
            /* Stack everything */
        }

        .broker-card.domestic {
            grid-column: auto;
        }

        /* Reset span */

        /* --- Admin Panel --- */
        #admin-panel {
            width: 100%;
            height: 100vh;
            top: 0;
            right: 0;
            bottom: 0;
            border-radius: 0;
            margin: 0;
            max-height: 100vh;
            overflow-y: auto;
            z-index: 9999;
        }

        .admin-panels {
            grid-template-columns: 1fr;
            display: flex;
            flex-direction: column;
        }

        .admin-menu {
            flex-direction: row;
            overflow-x: auto;
            padding: 10px;
            border-right: none;
            border-bottom: 1px solid var(--border-color);
            white-space: nowrap;
        }

        .admin-menu-item {
            flex: 0 0 auto;
            /* Don't shrink */
            padding: 8px 16px;
        }

        /* --- Chat Widget --- */
        .chat-widget {
            width: 90%;
            left: 5%;
            right: 5%;
            bottom: 80px;
            height: 500px;
            max-height: 70vh;
            z-index: 2000;
        }

        .chat-toggle {
            bottom: 20px;
            right: 20px;
            width: 56px;
            height: 56px;
            font-size: 28px;
        }

        /* --- Typography & Misc --- */
        h1 {
            font-size: 1.6rem;
        }

        h2 {
            font-size: 1.3rem;
        }

        .tagline {
            font-size: 0.9rem;
            margin-bottom: 10px;
        }
    }