/* =============================================
   BitcoinWatcher — Vibrant Dark + Neon Orange
   ============================================= */

:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-tertiary: #1e293b;
    --bg-card: #172033;
    --border-color: #2d3a52;
    --border-highlight: #F7931A;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --bitcoin-orange: #F7931A;
    --bitcoin-orange-light: #FFB347;
    --bitcoin-orange-dark: #c57415;
    --bitcoin-gold: #FFD700;
    --neon-orange: #FF6B35;
    --neon-blue: #38bdf8;
    --neon-purple: #a78bfa;
    --neon-green: #4ade80;
    --success: #22c55e;
    --danger: #ef4444;
    --info: #38bdf8;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 20px rgba(247, 147, 26, 0.3);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
}

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

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-primary);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(247, 147, 26, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(56, 189, 248, 0.03) 0%, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    margin: 0;
    font-weight: 700;
}

a {
    color: var(--bitcoin-orange);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--bitcoin-orange-light);
    text-shadow: 0 0 8px rgba(247, 147, 26, 0.5);
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--bitcoin-orange); }

/* Main app layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.98) 0%, rgba(17, 24, 39, 0.9) 100%);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.app-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-header .logo-icon {
    width: 40px;
    height: 40px;
    color: var(--bitcoin-orange);
    filter: drop-shadow(0 0 8px rgba(247, 147, 26, 0.6));
    animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(247, 147, 26, 0.4)); }
    50% { filter: drop-shadow(0 0 16px rgba(247, 147, 26, 0.8)); }
}

.app-header .logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.app-header .logo-text span {
    color: var(--bitcoin-orange);
    text-shadow: 0 0 12px rgba(247, 147, 26, 0.5);
}

.app-header .logo-text .logo-subtitle {
    font-size: 0.75em;
    font-weight: 500;
    color: var(--text-secondary);
    text-shadow: none;
}

.app-header .header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.app-main {
    flex: 1;
    padding: 24px;
}

.app-footer {
    padding: 16px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--border-color) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

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

/* Modal overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* === SPARK PARTICLES (injected by JS, must be global) === */
.spark-particle {
    position: absolute;
    width: 5px;
    height: 5px;
    background: var(--bitcoin-orange);
    border-radius: 50%;
    pointer-events: none;
    z-index: 20;
    animation: sparkFly 0.7s ease-out forwards;
}

@keyframes sparkFly {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--dx), var(--dy)) scale(0);
    }
}

/* Ambient floating particles */
.ambient-particle {
    position: absolute;
    bottom: 20px;
    width: 3px;
    height: 3px;
    background: var(--bitcoin-orange);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    z-index: 3;
    animation: floatUp 5s ease-out forwards;
}

@keyframes floatUp {
    0% { opacity: 0; transform: translateY(0) scale(0.5); }
    15% { opacity: 0.6; }
    100% { opacity: 0; transform: translateY(-180px) scale(0); }
}

/* Stamp effect on blocks */
.stamp-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0) rotate(-15deg);
    font-size: 0.9rem;
    font-weight: 900;
    color: var(--neon-green);
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.8);
    pointer-events: none;
    white-space: nowrap;
    animation: stampAppear 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    z-index: 30;
    letter-spacing: 2px;
}

@keyframes stampAppear {
    0% { transform: translate(-50%, -50%) scale(0) rotate(-15deg); opacity: 0; }
    40% { transform: translate(-50%, -50%) scale(1.2) rotate(-12deg); opacity: 1; }
    60% { transform: translate(-50%, -50%) scale(1) rotate(-12deg); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0.8) rotate(-12deg); opacity: 0; }
}

/* Hash fly clone (injected by JS into document.body) */
.hash-fly-clone {
    position: fixed;
    font-family: 'Courier New', monospace;
    color: var(--neon-blue);
    text-shadow: 0 0 8px rgba(56, 189, 248, 0.8), 0 0 20px rgba(56, 189, 248, 0.4);
    pointer-events: none;
    z-index: 9999;
    white-space: nowrap;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Screen shake */
.screen-shake {
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px) rotate(-0.5deg); }
    40% { transform: translateX(4px) rotate(0.5deg); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(2px); }
}

/* Blazor error UI */
#blazor-error-ui {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    bottom: 0;
    box-shadow: var(--shadow-lg);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    border-top: 2px solid var(--danger);
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: var(--danger);
    padding: 1rem;
    color: white;
    border-radius: var(--radius-sm);
}

/* Responsive */
@media (max-width: 768px) {
    .app-header { padding: 12px 16px; }
    .app-main { padding: 16px; }
    .app-header .logo-text { font-size: 1.1rem; }
}
