/* ============================================
   PulseLedger - BTC Pulse Score Dashboard
   Dark Theme with Teal Accent
   ============================================ */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #16161f;
    --bg-card-hover: #1c1c28;
    --bg-input: #1a1a26;
    --border: #2a2a3a;
    --border-light: #3a3a4a;
    --text-primary: #e8e8f0;
    --text-secondary: #8888a0;
    --text-muted: #5a5a72;
    --accent: #0bb4aa;
    --accent-light: #14d9cc;
    --accent-dark: #089a92;
    --accent-glow: rgba(11, 180, 170, 0.15);
    --green: #22c55e;
    --red: #ef4444;
    --yellow: #eab308;
    --orange: #f97316;
    --blue: #3b82f6;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* --- Navbar --- */
.navbar {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.accent {
    color: var(--accent);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.nav-link:hover {
    color: var(--accent);
}

.nav-user {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: var(--font);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-light);
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-outline:hover {
    background: var(--accent-glow);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

/* --- Alerts --- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin: 16px 0;
    font-size: 0.9rem;
}

.alert-success { background: rgba(34, 197, 94, 0.1); color: var(--green); border: 1px solid rgba(34, 197, 94, 0.2); }
.alert-danger { background: rgba(239, 68, 68, 0.1); color: var(--red); border: 1px solid rgba(239, 68, 68, 0.2); }
.alert-info { background: rgba(59, 130, 246, 0.1); color: var(--blue); border: 1px solid rgba(59, 130, 246, 0.2); }

/* --- Hero (Landing) --- */
.hero {
    text-align: center;
    padding: 80px 0 40px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -1.5px;
    margin-bottom: 16px;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 48px;
}

.hero-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
    transition: border-color 0.2s;
}

.feature-card:hover {
    border-color: var(--accent);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.feature-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* --- How It Works --- */
.how-it-works {
    padding: 60px 0;
}

.how-it-works h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
}

.step {
    text-align: center;
}

.step-number {
    width: 48px;
    height: 48px;
    background: var(--accent-glow);
    border: 2px solid var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--accent);
    margin: 0 auto 16px;
}

.step h3 {
    margin-bottom: 8px;
}

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

/* --- Auth Pages --- */
.auth-container {
    display: flex;
    justify-content: center;
    padding: 60px 0;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
}

.auth-card h2 {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 28px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

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

.form-control {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font);
    transition: border-color 0.2s;
    outline: none;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-error {
    color: var(--red);
    font-size: 0.8rem;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.auth-footer a {
    color: var(--accent);
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* --- Dashboard --- */
.dashboard {
    padding: 32px 0 60px;
}

.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.dash-header h1 {
    font-size: 1.8rem;
}

.dash-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Score Hero */
.score-hero-section {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.score-main-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 60px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    min-width: 320px;
}

.score-ring-container {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 0 auto 20px;
}

.score-value-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-number {
    font-family: var(--font-mono);
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.score-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.signal-badge {
    display: inline-block;
    padding: 8px 24px;
    border-radius: 24px;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.signal-strong-buy { background: rgba(34, 197, 94, 0.15); color: var(--green); border: 1px solid rgba(34, 197, 94, 0.3); }
.signal-buy { background: rgba(11, 180, 170, 0.15); color: var(--accent); border: 1px solid rgba(11, 180, 170, 0.3); }
.signal-hold { background: rgba(234, 179, 8, 0.15); color: var(--yellow); border: 1px solid rgba(234, 179, 8, 0.3); }
.signal-sell { background: rgba(249, 115, 22, 0.15); color: var(--orange); border: 1px solid rgba(249, 115, 22, 0.3); }
.signal-strong-sell { background: rgba(239, 68, 68, 0.15); color: var(--red); border: 1px solid rgba(239, 68, 68, 0.3); }

.btc-price {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    margin-top: 40px;
}

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

/* Indicators Grid */
.indicators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.indicator-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    transition: border-color 0.2s;
}

.indicator-card:hover {
    border-color: var(--border-light);
}

.indicator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.indicator-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.indicator-category {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
    padding: 2px 8px;
    border-radius: 4px;
}

.indicator-score {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.indicator-bar {
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.indicator-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}

.indicator-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.indicator-source {
    margin-top: 8px;
    font-size: 0.7rem;
}

.indicator-source a {
    color: var(--accent);
    text-decoration: none;
}

.indicator-source a:hover {
    text-decoration: underline;
}

.indicator-methodology {
    margin-top: 8px;
    cursor: pointer;
    font-size: 0.75rem;
}

.methodology-toggle {
    color: var(--text-secondary);
    font-weight: 500;
}

.methodology-content {
    display: none;
    margin-top: 6px;
    color: var(--text-muted);
    line-height: 1.5;
    font-size: 0.72rem;
}

.indicator-methodology.expanded .methodology-toggle {
    color: var(--accent);
}

.indicator-methodology.expanded .methodology-content {
    display: block;
}

.methodology-formula {
    margin-top: 4px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-secondary);
}

/* Individual Indicator Charts */
.indicator-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

.indicator-chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.indicator-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.indicator-chart-card h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

.ind-chart-btns {
    display: flex;
    gap: 2px;
}

.ind-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.65rem;
}

.ind-btn.active {
    background: var(--accent-dark);
    color: #fff;
    border-color: var(--accent);
}

.ind-btn:hover {
    border-color: var(--accent);
}

.indicator-chart-card canvas {
    height: 150px !important;
}

@media (max-width: 640px) {
    .indicator-charts-grid {
        grid-template-columns: 1fr;
    }
}


/* Sidebar Navigation */
.dashboard-with-sidebar {
    display: flex;
    gap: 24px;
}

.sidebar-nav {
    flex: 0 0 220px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
    height: fit-content;
    position: sticky;
    top: 80px;
}

.sidebar-title {
    font-size: 0.9rem;
    color: var(--accent);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.sidebar-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-links li {
    margin-bottom: 4px;
}

.sidebar-link {
    display: block;
    padding: 8px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.82rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.sidebar-link:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--accent-glow);
    color: var(--accent);
    font-weight: 500;
}

.dashboard-main {
    flex: 1;
    min-width: 0;
}

@media (max-width: 768px) {
    .dashboard-with-sidebar {
        flex-direction: column;
    }
    .sidebar-nav {
        flex: none;
        position: static;
    }
}

/* Chart Controls */
.chart-controls {
    display: flex;
    gap: 4px;
}

.chart-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    font-family: var(--font);
    transition: all 0.2s;
}

.chart-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.chart-btn.active {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
}

/* Chart Container */
.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    min-height: 350px;
}

/* Loading */
.loading-placeholder {
    color: var(--text-muted);
    text-align: center;
    padding: 40px;
}

/* --- Footer --- */
.footer {
    border-top: 1px solid var(--border);
    padding: 24px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 60px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.2rem;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .dash-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .score-main-card {
        padding: 30px 20px;
        min-width: unset;
        width: 100%;
    }

    .indicators-grid {
        grid-template-columns: 1fr;
    }

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

    .auth-card {
        padding: 24px;
    }

    .nav-container {
        gap: 12px;
    }

    .logo-text {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }

    .score-number {
        font-size: 2.5rem;
    }

    .score-ring-container {
        width: 180px;
        height: 180px;
    }

    .score-ring-container canvas {
        width: 180px !important;
        height: 180px !important;
    }
}
