/* ==========================================================================
   🎨 Premium "Sapphire Slate" Visual System — BondPro SA
   ========================================================================== */

:root {
    /* Base Palette */
    --bg-base: #06080e;
    --bg-surface: rgba(13, 18, 30, 0.65);
    --bg-card: rgba(20, 28, 46, 0.75);
    
    /* Interactive States & Accents */
    --color-sapphire: #3b82f6;
    --color-sapphire-glow: rgba(59, 130, 246, 0.5);
    --color-cyber-gold: #f59e0b;
    --color-gold-glow: rgba(245, 158, 11, 0.35);
    
    /* Chart & Series Colors */
    --series-1: #3b82f6; /* Principal */
    --series-2: #10b981; /* Interest */
    --series-3: #ef4444; /* Transfer Duty */
    --series-4: #8b5cf6; /* Transfer Atty */
    --series-5: #ec4899; /* Bond Atty */

    /* Neutral System */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #475569;
    --border-glass: rgba(255, 255, 255, 0.06);
    --border-glass-active: rgba(59, 130, 246, 0.3);

    /* Sizing & Shadows */
    --radius-xl: 20px;
    --radius-lg: 12px;
    --radius-md: 8px;
    --shadow-glow: 0 0 30px rgba(8, 11, 20, 0.5);
}

/* ==========================================================================
   ⚡ Reset & Foundation
   ========================================================================== */

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

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

h1, h2, h3, .brand-logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

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

.hidden {
    display: none !important;
}

/* ==========================================================================
   🌌 Ambient Background Canvas
   ========================================================================== */

.bg-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(130px);
    opacity: 0.18;
    pointer-events: none;
    z-index: -1;
    animation: float-glow 15s infinite alternate ease-in-out;
}

.glow-primary {
    background: var(--color-sapphire);
    top: -200px;
    left: -100px;
}

.glow-secondary {
    background: var(--color-cyber-gold);
    bottom: -200px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes float-glow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(80px, 50px) scale(1.2); }
}

/* ==========================================================================
   🧩 Reusable Glass Components
   ========================================================================== */

.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-glow);
    padding: 28px;
    transition: border 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   🏢 Header Area
   ========================================================================== */

.app-header {
    padding: 24px 0;
    border-bottom: 1px solid var(--border-glass);
    background: rgba(6, 8, 14, 0.5);
    backdrop-filter: blur(10px);
    margin-bottom: 40px;
}

.app-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    font-size: 2.2rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-glass);
}

.brand-text h1 {
    font-size: 1.8rem;
    letter-spacing: -0.5px;
    line-height: 1;
}

.brand-text h1 .accent {
    color: var(--color-sapphire);
}

.brand-text p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 600;
    margin-top: 2px;
}

/* ==========================================================================
   📈 Interactive Layout Frame
   ========================================================================== */

.calculator-wrapper {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    margin-bottom: 32px;
}

@media (max-width: 1024px) {
    .calculator-wrapper {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   🔘 Tab & Conditional Navigation
   ========================================================================== */

.calc-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 4px;
    margin-bottom: 32px;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 14px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--color-sapphire);
    color: #ffffff;
    box-shadow: 0 4px 15px var(--color-sapphire-glow);
}

.conditional-inputs {
    display: none;
    flex-direction: column;
    gap: 24px;
}

.conditional-inputs.show {
    display: flex;
}

/* ==========================================================================
   🎛️ Input Fields & Controllers
   ========================================================================== */

.input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}

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

.input-header label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.input-numeric {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 0 12px;
    transition: all 0.3s ease;
}

.input-numeric:focus-within {
    border-color: var(--color-sapphire);
    background: rgba(59, 130, 246, 0.05);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.currency-symbol, .suffix {
    color: var(--text-secondary);
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
}

.input-numeric input {
    background: none;
    border: none;
    color: var(--text-primary);
    padding: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    width: 130px;
    text-align: right;
    outline: none;
}

/* Firefox removes arrows */
.input-numeric input[type=number] {
    -moz-appearance: textfield;
}
.input-numeric input::-webkit-outer-spin-button,
.input-numeric input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Range Sliders Custom Core styling */
.custom-range {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    cursor: pointer;
}

.custom-range::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

.custom-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5), 0 0 0 6px rgba(59, 130, 246, 0.3);
    margin-top: -7px;
    transition: transform 0.2s, background 0.2s;
}

.custom-range:active::-webkit-slider-thumb {
    transform: scale(1.2);
    background: var(--color-sapphire);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: -4px;
}

/* ==========================================================================
   🔲 Custom Radio Tiles & Toggles
   ========================================================================== */

.radio-tiles {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.radio-tiles label.tile {
    position: relative;
    cursor: pointer;
}

.radio-tiles input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.radio-tiles span {
    display: block;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 10px 4px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.radio-tiles input[type="radio"]:checked + span {
    background: var(--color-sapphire);
    border-color: var(--color-sapphire);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

/* Custom Toggles */
.toggle-switch {
    position: relative;
    width: 100%;
}

.toggle-input {
    display: none;
}

.toggle-label {
    display: flex;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 4px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.toggle-state {
    flex: 1;
    text-align: center;
    padding: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    z-index: 2;
    transition: all 0.3s ease;
}

.toggle-input:checked ~ .toggle-label .toggle-state:first-child {
    color: var(--text-secondary);
    background: none;
}

.toggle-input:checked ~ .toggle-label .toggle-state:last-child {
    color: #ffffff;
    background: var(--color-sapphire);
    box-shadow: 0 4px 15px var(--color-sapphire-glow);
}

.toggle-input:not(:checked) ~ .toggle-label .toggle-state:first-child {
    color: #ffffff;
    background: var(--color-sapphire);
    box-shadow: 0 4px 15px var(--color-sapphire-glow);
}

.input-caption {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ==========================================================================
   💎 Quick Metric Cards (Dashboards)
   ========================================================================== */

.quick-metrics {
    margin-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 24px;
}

.metric-card.featured {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    border: 1px solid var(--border-glass-active);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.metric-label {
    display: block;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 8px;
}

.metric-value {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--color-cyber-gold);
    text-shadow: 0 0 20px var(--color-gold-glow);
    line-height: 1;
}

/* ==========================================================================
   📊 Financial Summary & Visualization
   ========================================================================== */

.results-pane h3 {
    margin-bottom: 20px;
    font-size: 1.25rem;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
}

.chart-container {
    position: relative;
    width: 230px;
    height: 230px;
    margin: 0 auto 32px;
}

.chart-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    width: 120px;
}

.chart-center-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.chart-center-val {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Breakdown List */
.breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.item-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.bullet {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.breakdown-item.color-1 .bullet { background: var(--series-1); }
.breakdown-item.color-2 .bullet { background: var(--series-2); }
.breakdown-item.color-3 .bullet { background: var(--series-3); }
.breakdown-item.color-4 .bullet { background: var(--series-4); }
.breakdown-item.color-5 .bullet { background: var(--series-5); }

.item-value {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
}

.breakdown-item.sub-item {
    background: rgba(255, 255, 255, 0.02);
    margin-top: 8px;
    padding: 14px 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
}

.breakdown-item.sub-item .item-label {
    font-weight: 600;
    color: var(--text-primary);
}

.item-value.highlight {
    color: var(--color-sapphire);
}

.item-value.gold-glow {
    color: var(--color-cyber-gold);
    text-shadow: 0 0 10px var(--color-gold-glow);
}

/* ==========================================================================
   ⚠️ Custom Information Alerts
   ========================================================================== */

.custom-alert {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    align-items: center;
}

.custom-alert.info {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #a7f3d0;
}

.alert-icon {
    font-size: 1.2rem;
}

/* ==========================================================================
   📢 Monetized Advertisement Slots
   ========================================================================== */

.ad-slot {
    background: rgba(0, 0, 0, 0.2);
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.ad-placeholder {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    text-align: center;
    padding: 10px;
}

.ad-leaderboard {
    width: 728px;
    height: 90px;
}

@media (max-width: 1100px) {
    .ad-leaderboard {
        width: 100%;
        height: auto;
        min-height: 90px;
    }
}

.ad-square {
    width: 100%;
    height: 250px;
    margin-top: 24px;
}

.ad-banner {
    width: 100%;
    height: 250px;
    margin: 40px 0;
}

.ad-square.sticky {
    position: sticky;
    top: 24px;
}

/* ==========================================================================
   📄 Search Optimized FAQ Accordion
   ========================================================================== */

.faq-section {
    margin-top: 40px;
    margin-bottom: 60px;
}

.faq-section h2 {
    font-size: 1.5rem;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
}

.faq-accordion details {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 18px 0;
    cursor: pointer;
}

.faq-accordion details:last-child {
    border-bottom: none;
}

.faq-accordion summary {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
    outline: none;
    user-select: none;
}

.faq-accordion details p {
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    padding-left: 20px;
}

.faq-accordion details strong {
    color: var(--color-sapphire);
}

/* ==========================================================================
   👣 Responsive Footer Area
   ========================================================================== */

.app-footer {
    border-top: 1px solid var(--border-glass);
    padding: 60px 0 30px;
    background: #030509;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

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

.footer-brand h3 {
    font-size: 1.8rem;
    margin-bottom: 12px;
}

.footer-brand h3 .accent {
    color: var(--color-sapphire);
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    max-width: 400px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--color-sapphire);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    padding-top: 24px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   📱 Small Device Specific Scaling
   ========================================================================== */

@media (max-width: 600px) {
    .radio-tiles {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .metric-value {
        font-size: 2rem;
    }
    
    .glass-panel {
        padding: 20px;
    }

    .app-header .container {
        justify-content: center;
        text-align: center;
    }
    
    .ad-leaderboard {
        display: none; /* Hide huge leaderboards on mobile */
    }
}
