/* ============================================
   Bitcoin Price Watch - Premium Styles
   Billion-dollar look with Bitcoin orange accents
   ============================================ */

/* CSS Variables */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --bg-card: rgba(17, 17, 17, 0.8);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(247, 147, 26, 0.4);
    
    --bitcoin-orange: #f7931a;
    --bitcoin-gold: #ffb347;
    --bitcoin-glow: rgba(247, 147, 26, 0.3);
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    
    --positive: #00d68f;
    --positive-bg: rgba(0, 214, 143, 0.1);
    --negative: #ff5757;
    --negative-bg: rgba(255, 87, 87, 0.1);
    
    --fear: #ea5545;
    --greed: #27ae60;
    
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--bitcoin-glow);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    background-image: 
        radial-gradient(ellipse at top, rgba(247, 147, 26, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(247, 147, 26, 0.02) 0%, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================
   3D Spinning Bitcoin Coins Background
   ============================================ */
#coins-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    perspective: 1000px;
}

.bitcoin-coin {
    position: absolute;
    width: 60px;
    height: 60px;
    transform-style: preserve-3d;
    animation: spin3d var(--spin-duration, 5s) linear infinite;
    opacity: var(--coin-opacity, 0.1);
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.3))
            drop-shadow(0 0 30px rgba(247, 147, 26, 0.15));
}

.coin-front,
.coin-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 50%;
}

.coin-front img,
.coin-back img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.coin-front { transform: rotateY(0deg); }
.coin-back { transform: rotateY(180deg); }

.bitcoin-coin::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, 
        #654321 0%, #8B6914 10%, #B8860B 25%,
        #DAA520 50%, #B8860B 75%, #8B6914 90%, #654321 100%
    );
    transform: translateY(-50%) rotateX(90deg) translateZ(0px);
    border-radius: 2px;
    opacity: 0.8;
}

.bitcoin-coin::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, 
        #654321 0%, #8B6914 10%, #B8860B 25%,
        #DAA520 50%, #B8860B 75%, #8B6914 90%, #654321 100%
    );
    transform: translateX(-50%) rotateY(90deg) translateZ(0px);
    border-radius: 2px;
    opacity: 0.8;
}

@keyframes spin3d {
    0% { transform: rotateY(0deg) rotateX(var(--tilt, 10deg)); }
    100% { transform: rotateY(360deg) rotateX(var(--tilt, 10deg)); }
}

.coin-depth-1 { --parallax-speed: 0.1; }
.coin-depth-2 { --parallax-speed: 0.2; }
.coin-depth-3 { --parallax-speed: 0.3; }
.coin-depth-4 { --parallax-speed: 0.4; }
.coin-depth-5 { --parallax-speed: 0.5; }

/* ============================================
   Main Content Container
   ============================================ */
.content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

/* ============================================
   Header
   ============================================ */
.header {
    padding: 0.5rem 0 2rem;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 2rem;
    color: var(--bitcoin-orange);
    font-weight: 700;
    text-shadow: 0 0 20px var(--bitcoin-glow);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.tagline {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 400;
}

.header-nav {
    display: flex;
    gap: 0.75rem;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-family);
    font-size: 0.875rem;
    font-weight: 500;
}

.nav-btn svg {
    width: 18px;
    height: 18px;
}

.nav-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--bitcoin-orange);
    color: var(--bitcoin-orange);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    padding: 1rem 0 2rem;
}

.hero-card {
    position: relative;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    overflow: hidden;
}

/* Animated gradient border */
.hero-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(
        45deg,
        transparent 30%,
        var(--bitcoin-orange) 50%,
        transparent 70%
    );
    border-radius: var(--radius-xl);
    z-index: -1;
    animation: borderGlow 3s linear infinite;
    opacity: 0.6;
}

.hero-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--bg-secondary);
    border-radius: calc(var(--radius-xl) - 2px);
    z-index: -1;
}

@keyframes borderGlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Live Indicator */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    background: rgba(0, 214, 143, 0.1);
    border: 1px solid rgba(0, 214, 143, 0.3);
    border-radius: 100px;
    margin-bottom: 1.5rem;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--positive);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.live-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--positive);
    letter-spacing: 0.1em;
}

/* Price Display */
.price-container {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0.25rem;
}

.price-dollar {
    font-size: clamp(2rem, 6vw, 3.5rem);
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1;
    padding-top: 0.5rem;
}

.price-value {
    font-size: clamp(3.5rem, 12vw, 6rem);
    font-weight: 800;
    font-family: var(--font-family);
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.03em;
    transition: all 0.3s ease;
}

.price-value.pulse {
    animation: pricePulse 0.5s ease;
}

@keyframes pricePulse {
    0%, 100% { text-shadow: 0 0 0 transparent; }
    50% { text-shadow: 0 0 40px var(--bitcoin-orange); }
}

/* Price Meta (Change + ATH) */
.price-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.price-change {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 1.25rem;
}

.change-icon {
    font-weight: bold;
    font-size: 0.875rem;
}

.change-value {
    font-weight: 600;
    font-family: var(--font-mono);
}

.change-value.positive, .change-icon.positive { color: var(--positive); }
.change-value.negative, .change-icon.negative { color: var(--negative); }

.change-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ATH Badge */
.ath-badge {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: rgba(247, 147, 26, 0.1);
    border: 1px solid rgba(247, 147, 26, 0.3);
    border-radius: 100px;
    font-size: 0.875rem;
    color: var(--bitcoin-orange);
}

.ath-icon {
    font-size: 0.875rem;
}

/* Sparkline */
.sparkline-container {
    height: 60px;
    margin: 1.5rem auto;
    max-width: 400px;
}

#sparkline-chart {
    width: 100% !important;
    height: 100% !important;
}

/* Timeframe Toggle */
.timeframe-toggle {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.timeframe-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timeframe-btn:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.timeframe-btn.active {
    background: var(--bitcoin-orange);
    border-color: var(--bitcoin-orange);
    color: var(--bg-primary);
}

/* Last Updated */
.last-updated {
    font-size: 0.8125rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.refresh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--bitcoin-orange);
    color: var(--bitcoin-orange);
}

.refresh-icon {
    width: 16px;
    height: 16px;
}

.refresh-btn.refreshing .refresh-icon {
    animation: spinRefresh 1s linear infinite;
}

@keyframes spinRefresh {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   Modal Styles
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

/* Alert Form */
.alert-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.alert-condition {
    display: flex;
    gap: 0.75rem;
}

.alert-select {
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.9375rem;
    cursor: pointer;
}

.alert-input-wrapper {
    flex: 1;
    position: relative;
}

.alert-currency {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
}

.alert-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 1rem;
}

.alert-input:focus {
    outline: none;
    border-color: var(--bitcoin-orange);
}

.alert-current {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
}

.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: var(--bitcoin-orange);
    border: none;
    border-radius: var(--radius-md);
    color: var(--bg-primary);
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: var(--bitcoin-gold);
    transform: translateY(-1px);
}

.active-alerts {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.active-alerts h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.no-alerts {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
    padding: 1rem;
}

.alert-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.alert-item-text {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.alert-item-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
}

.alert-item-remove:hover {
    color: var(--negative);
}

/* Share Modal */
.share-preview {
    margin-bottom: 1.5rem;
}

.share-card {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-primary) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
}

.share-card-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.share-logo {
    color: var(--bitcoin-orange);
    font-weight: 700;
}

.share-card-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.share-card-change {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.share-card-change.positive { color: var(--positive); }
.share-card-change.negative { color: var(--negative); }

.share-card-footer {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.share-buttons {
    display: flex;
    gap: 0.75rem;
}

.share-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-option:hover {
    border-color: var(--bitcoin-orange);
    color: var(--bitcoin-orange);
}

/* ============================================
   Fear & Greed Index
   ============================================ */
.fear-greed-section {
    padding: 1rem 0 2rem;
}

.fear-greed-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.fg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.fg-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.fg-update {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.fg-gauge {
    margin-bottom: 1rem;
}

.fg-meter {
    position: relative;
    height: 12px;
    background: linear-gradient(to right, 
        #ea5545 0%, 
        #f46a38 25%, 
        #f9c80e 50%, 
        #87c55f 75%, 
        #27ae60 100%
    );
    border-radius: 100px;
    overflow: visible;
}

.fg-meter-fill {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 100px;
}

.fg-meter-pointer {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: var(--text-primary);
    border: 3px solid var(--bg-primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: left 0.5s ease;
    box-shadow: var(--shadow-sm);
}

.fg-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.625rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.fg-value {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.fg-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-family);
}

.fg-label {
    font-size: 1rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
}

.fg-label.extreme-fear { background: rgba(234, 85, 69, 0.2); color: #ea5545; }
.fg-label.fear { background: rgba(244, 106, 56, 0.2); color: #f46a38; }
.fg-label.neutral { background: rgba(249, 200, 14, 0.2); color: #f9c80e; }
.fg-label.greed { background: rgba(135, 197, 95, 0.2); color: #87c55f; }
.fg-label.extreme-greed { background: rgba(39, 174, 96, 0.2); color: #27ae60; }

/* ============================================
   Stats Grid
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: all 0.2s ease;
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(247, 147, 26, 0.1);
    border-radius: var(--radius-sm);
    color: var(--bitcoin-orange);
    flex-shrink: 0;
}

.stat-icon svg {
    width: 20px;
    height: 20px;
}

.stat-icon-large {
    width: 48px;
    height: 48px;
}

.stat-icon-large svg {
    width: 24px;
    height: 24px;
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-card-wide {
    grid-column: span 4;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(247, 147, 26, 0.05) 100%);
}

.stat-card-wide .stat-value {
    font-size: 1.75rem;
    color: var(--bitcoin-orange);
}

/* ============================================
   Calculator
   ============================================ */
.calculator {
    margin-bottom: 2.5rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    text-align: center;
}

.calculator-box {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Calculator Tabs */
.calc-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.25rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.calc-tab {
    flex: 1;
    padding: 0.625rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.calc-tab.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* Calculator Panels */
.calc-panel {
    display: none;
}

.calc-panel.active {
    display: block;
}

/* Convert Panel */
.convert-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.convert-input-group,
.convert-result-group {
    flex: 1;
    min-width: 180px;
}

.calc-label {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.input-wrapper {
    position: relative;
}

.input-prefix {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    color: var(--bitcoin-orange);
    font-weight: 600;
}

.btc-input {
    width: 100%;
    padding: 1rem 1rem 1rem 2.75rem;
    font-size: 1.25rem;
    font-family: var(--font-mono);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s ease;
}

.btc-input:focus {
    border-color: var(--bitcoin-orange);
    box-shadow: 0 0 0 3px rgba(247, 147, 26, 0.15);
}

.btc-input::placeholder {
    color: var(--text-muted);
}

.btc-input::-webkit-outer-spin-button,
.btc-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.btc-input[type=number] {
    -moz-appearance: textfield;
}

/* Preset Buttons */
.preset-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.preset-btn {
    flex: 1;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-btn:hover {
    border-color: var(--bitcoin-orange);
    color: var(--bitcoin-orange);
}

.convert-equals {
    font-size: 1.5rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.usd-result-box {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    padding: 1rem;
    background: var(--positive-bg);
    border: 1px solid rgba(0, 214, 143, 0.2);
    border-radius: var(--radius-sm);
}

.usd-symbol {
    font-size: 1.25rem;
    color: var(--positive);
    font-weight: 600;
}

.usd-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--positive);
}

.sats-display {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: center;
}

#sats-result {
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

/* DCA Panel */
.dca-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dca-row {
    display: flex;
    gap: 1rem;
}

.dca-field {
    flex: 1;
}

.dca-field label {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.dca-input,
.dca-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.9375rem;
}

.dca-input:focus,
.dca-select:focus {
    outline: none;
    border-color: var(--bitcoin-orange);
}

.dca-results {
    margin-top: 1.5rem;
}

.dca-results.hidden {
    display: none;
}

.dca-result-card {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.dca-stat {
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    text-align: center;
}

.dca-stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.dca-stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.dca-stat-value.highlight {
    color: var(--positive);
}

/* ============================================
   Chart Section
   ============================================ */
.chart-section {
    margin-bottom: 2.5rem;
}

.chart-description {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9375rem;
    margin-bottom: 1.25rem;
}

.chart-container {
    position: relative;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    height: 450px;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-muted);
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--bitcoin-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.chart-loading.hidden {
    display: none;
}

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

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.legend-color {
    width: 20px;
    height: 3px;
    border-radius: 2px;
}

.legend-price { background: var(--text-primary); }
.legend-powerlaw { background: var(--bitcoin-orange); }
.legend-halving { background: rgba(147, 51, 234, 0.7); }

/* ============================================
   Trust Section
   ============================================ */
.trust-section {
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.trust-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 214, 143, 0.1);
    border: 1px solid rgba(0, 214, 143, 0.2);
    border-radius: 100px;
    color: var(--positive);
    font-size: 0.8125rem;
    font-weight: 500;
}

.data-sources {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.sources-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.source-logos {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.source-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8125rem;
    transition: color 0.2s ease;
}

.source-link:hover {
    color: var(--bitcoin-orange);
}

.source-divider {
    color: var(--border-color);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    text-align: center;
    padding: 2rem 0 3rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.footer-logo {
    color: var(--bitcoin-orange);
    font-size: 1.25rem;
}

.footer-name {
    color: var(--text-primary);
}

.refresh-info {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.footer-copyright {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-card-wide {
        grid-column: span 2;
    }
    
    .fg-labels span:nth-child(2),
    .fg-labels span:nth-child(4) {
        display: none;
    }
}

@media (max-width: 600px) {
    .content {
        padding: 1rem;
    }
    
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-nav {
        width: 100%;
    }
    
    .nav-btn {
        flex: 1;
        justify-content: center;
    }
    
    .nav-btn-text {
        display: none;
    }
    
    .logo-text {
        font-size: 1.25rem;
    }
    
    .hero-card {
        padding: 1.5rem 1rem;
    }
    
    .price-value {
        font-size: clamp(2.5rem, 14vw, 4rem);
    }
    
    .price-meta {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .timeframe-toggle {
        flex-wrap: wrap;
    }
    
    .timeframe-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .stat-value {
        font-size: 1rem;
    }
    
    .stat-card-wide .stat-value {
        font-size: 1.25rem;
    }
    
    .convert-row {
        flex-direction: column;
    }
    
    .convert-equals {
        display: none;
    }
    
    .dca-row {
        flex-direction: column;
    }
    
    .chart-container {
        height: 300px;
        padding: 1rem;
    }
    
    .chart-legend {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .share-buttons {
        flex-direction: column;
    }
}

@media (max-width: 400px) {
    .content {
        padding: 0.75rem;
    }
    
    .preset-buttons {
        flex-wrap: wrap;
    }
    
    .preset-btn {
        min-width: calc(50% - 0.25rem);
    }
}

/* ============================================
   Accessibility
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .bitcoin-coin {
        animation: none !important;
        opacity: 0.05 !important;
    }
    
    .hero-card::before {
        animation: none !important;
    }
}

/* ============================================
   iOS Safe Areas
   ============================================ */
@supports (padding: env(safe-area-inset-bottom)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    .footer {
        padding-bottom: calc(3rem + env(safe-area-inset-bottom));
    }
}

/* ============================================
   Utility Classes
   ============================================ */
.hidden {
    display: none !important;
}

.loading {
    opacity: 0.5;
}

/* Focus styles for accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--bitcoin-orange);
    outline-offset: 2px;
}
