/* ========================================
   ClipperAI — Brutalist Pop Design System
   Cream paper, thick borders, hot pink, lime, blue
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Archivo+Black&display=swap');

/* --- CSS Variables --- */
:root {
    /* Core palette */
    --bg-dark: #fef3c7;          /* cream paper (was bg-dark, kept name) */
    --bg-surface: #fffdf5;       /* paper card */
    --bg-window: #fffdf5;        /* paper card */
    --bg-titlebar: #0a0a0a;      /* black titlebar */
    --paper: #fffdf5;
    --ink: #0a0a0a;

    /* Pop colors */
    --neon-green: #bef264;       /* lime */
    --neon-pink: #ff3366;        /* hot pink */
    --neon-cyan: #3b82f6;        /* blue */
    --neon-yellow: #fbbf24;      /* amber */
    --neon-purple: #a855f7;      /* purple */

    --pop: #ff3366;
    --lime: #bef264;
    --blue: #3b82f6;
    --amber: #fbbf24;

    /* Text */
    --text-primary: #0a0a0a;
    --text-muted: #6b6b66;
    --text-bright: #0a0a0a;

    /* Win95 vars (kept for compat, restyled brutalist) */
    --win-border-light: #0a0a0a;
    --win-border-dark: #0a0a0a;
    --win-border-shadow: #0a0a0a;
    --win-bg: #fffdf5;
    --win-titlebar: #0a0a0a;

    /* Fonts */
    --font-body: 'Space Grotesk', system-ui, sans-serif;
    --font-heading: 'Archivo Black', sans-serif;
    --font-mono: 'Space Grotesk', monospace;

    /* Brutalist shadows (replace glows) */
    --glow-green: 4px 4px 0 var(--ink);
    --glow-pink: 4px 4px 0 var(--ink);
    --glow-cyan: 4px 4px 0 var(--ink);
    --shadow-sm: 4px 4px 0 var(--ink);
    --shadow-md: 6px 6px 0 var(--ink);
    --shadow-lg: 10px 10px 0 var(--ink);
}

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

html { font-size: 16px; height: 100%; }

body {
    font-family: var(--font-body);
    font-size: 16px;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    background-image: radial-gradient(circle, rgba(0,0,0,0.08) 1px, transparent 1px);
    background-size: 18px 18px;
    -webkit-font-smoothing: antialiased;
}

/* Disable old CRT scanline */
body::after { display: none !important; }

/* --- Typography --- */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--ink);
    text-shadow: none;
    letter-spacing: -0.5px;
    text-transform: uppercase;
    line-height: 1;
}

h1 { font-size: 40px; margin-bottom: 16px; letter-spacing: -1px; }
h2 { font-size: 28px; margin-bottom: 12px; }
h3 { font-size: 20px; margin-bottom: 8px; }
h4 { font-size: 16px; margin-bottom: 6px; }

p { font-size: 16px; }

a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    font-weight: 600;
    transition: color 0.15s;
}
a:hover {
    color: var(--pop);
    text-shadow: none;
}

/* --- Desktop Layout --- */
.desktop {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 0;
}

.desktop-area {
    flex: 1;
    padding: 40px 32px;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-start;
    align-content: flex-start;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}

/* --- Window / Card (Brutalist) --- */
.window {
    background: var(--paper);
    border: 4px solid var(--ink);
    border-radius: 0;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.window-titlebar {
    background: var(--ink);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: default;
    user-select: none;
    border-bottom: 4px solid var(--ink);
}

.window-title {
    font-family: var(--font-heading);
    font-size: 13px;
    color: var(--paper);
    text-shadow: none;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.window-title::before {
    content: '★';
    color: var(--lime);
    font-size: 14px;
}

.window-controls {
    display: flex;
    gap: 6px;
}

.window-btn {
    width: 22px;
    height: 22px;
    background: var(--paper);
    border: 2px solid var(--paper);
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 1;
    text-align: center;
    cursor: pointer;
    color: var(--ink);
    padding: 0;
    border-radius: 0;
    font-weight: 700;
    transition: background 0.1s;
}

.window-btn:hover { background: var(--pop); color: var(--paper); }

.window-body {
    padding: 28px 32px;
}

/* --- Buttons (Brutalist Pop) --- */
.btn {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 700;
    padding: 12px 22px;
    cursor: pointer;
    transition: all 0.1s;
    border: 3px solid var(--ink);
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
    background: var(--paper);
    color: var(--ink);
}

.btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--ink);
}

.btn:active {
    transform: translate(4px, 4px);
    box-shadow: 0 0 0 var(--ink);
}

.btn-win95 {
    background: var(--paper);
    color: var(--ink);
}

.btn-neon {
    background: var(--lime);
    color: var(--ink);
}

.btn-pink {
    background: var(--pop);
    color: var(--paper);
}

.btn-cyan {
    background: var(--blue);
    color: var(--paper);
}

.btn-sm { font-size: 12px; padding: 8px 14px; box-shadow: 3px 3px 0 var(--ink); }
.btn-sm:hover { box-shadow: 1px 1px 0 var(--ink); }

.btn-lg {
    font-size: 18px;
    padding: 18px 32px;
    font-family: var(--font-heading);
    box-shadow: var(--shadow-md);
}
.btn-lg:hover { box-shadow: 3px 3px 0 var(--ink); }

/* --- Top Nav Bar (replaces taskbar) --- */
.taskbar {
    position: sticky;
    top: 0;
    bottom: auto;
    left: 0;
    right: 0;
    height: auto;
    background: var(--ink);
    backdrop-filter: none;
    border-top: none;
    border-bottom: 4px solid var(--ink);
    display: flex;
    align-items: center;
    padding: 14px 32px;
    gap: 12px;
    z-index: 1000;
    color: var(--paper);
}

.start-btn {
    font-family: var(--font-heading);
    font-size: 18px;
    padding: 4px 12px;
    background: transparent;
    border: none;
    color: var(--paper);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    height: auto;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}
.start-btn:hover { background: transparent; }
.start-btn:active { background: transparent; }

.start-btn-icon {
    width: 0;
    height: 0;
    background: none;
    display: none;
}

.start-btn::before {
    content: 'CLIPPER';
    font-family: var(--font-heading);
    color: var(--paper);
}
.start-btn::after {
    content: 'AI';
    font-family: var(--font-heading);
    background: var(--pop);
    color: var(--paper);
    padding: 2px 8px;
    transform: rotate(-2deg);
    display: inline-block;
}

/* Hide the original "Start" text */
.start-btn { font-size: 0; }
.start-btn::before, .start-btn::after { font-size: 18px; }

.taskbar-info {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    height: auto;
    border: none;
    border-radius: 0;
    background: transparent;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--paper);
    font-weight: 600;
}

.taskbar-info > span {
    padding: 6px 12px;
    border: 2px solid var(--paper);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 11px;
    font-weight: 700;
}

.taskbar-divider {
    display: none;
}

/* --- Top Nav Links (start menu repurposed) --- */
.start-menu {
    position: static;
    bottom: auto;
    left: auto;
    width: auto;
    background: transparent;
    border: none;
    border-radius: 0;
    display: flex !important;
    z-index: 1;
    box-shadow: none;
    margin-left: 32px;
}

.start-menu.active { display: flex; }

.start-menu-header { display: none; }

.start-menu-items {
    margin-left: 0;
    padding: 0;
    display: flex;
    gap: 4px;
}

.start-menu-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    color: var(--paper);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.1s;
    border: 2px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.start-menu-item:hover {
    background: var(--paper);
    color: var(--ink);
}

.start-menu-item.active {
    background: var(--lime);
    color: var(--ink);
    border-color: var(--paper);
}

.start-menu-item-icon {
    width: auto;
    text-align: center;
    font-size: 14px;
    display: none;
}

.start-menu-separator {
    width: 2px;
    height: 24px;
    background: var(--paper);
    margin: 0 6px;
    border: none;
    align-self: center;
}

/* --- Cards / Grid --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.card {
    background: var(--paper);
    border: 4px solid var(--ink);
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: all 0.15s;
}

.card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0 var(--ink);
    border-color: var(--ink);
}

/* --- Tier Cards --- */
.tier-card {
    background: var(--paper);
    border: 4px solid var(--ink);
    padding: 28px;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow-md);
    transition: all 0.15s;
}

.tier-card.featured {
    background: var(--lime);
    box-shadow: var(--shadow-lg);
    transform: rotate(-1deg);
}

.tier-card.current {
    background: var(--blue);
    color: var(--paper);
}
.tier-card.current .tier-name,
.tier-card.current .tier-price,
.tier-card.current .tier-features li { color: var(--paper); }
.tier-card.current .tier-features li::before { color: var(--lime); }

.tier-name {
    font-family: var(--font-heading);
    font-size: 22px;
    color: var(--ink);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.tier-card.featured .tier-name { color: var(--ink); }

.tier-price {
    font-family: var(--font-heading);
    font-size: 48px;
    color: var(--ink);
    margin-bottom: 16px;
    line-height: 1;
}

.tier-price span { font-size: 16px; color: var(--text-muted); font-family: var(--font-body); }

.tier-features {
    list-style: none;
    text-align: left;
    margin-bottom: 24px;
}

.tier-features li {
    padding: 6px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 500;
    border-bottom: 1px dashed rgba(0,0,0,0.15);
}

.tier-features li::before {
    content: '★';
    color: var(--pop);
    font-weight: bold;
    font-size: 14px;
}

.tier-badge {
    position: absolute;
    top: -16px;
    right: 16px;
    background: var(--pop);
    color: var(--paper);
    font-family: var(--font-heading);
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 0;
    border: 3px solid var(--ink);
    text-transform: uppercase;
    transform: rotate(4deg);
    letter-spacing: 1px;
}

/* --- Progress Bar (Brutalist) --- */
.progress-bar {
    width: 100%;
    height: 24px;
    background: var(--paper);
    border: 3px solid var(--ink);
    border-radius: 0;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--pop);
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 8px,
        rgba(0,0,0,0.15) 8px,
        rgba(0,0,0,0.15) 16px
    );
    transition: width 0.5s ease;
    border-radius: 0;
    border-right: 3px solid var(--ink);
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 700;
    color: var(--ink);
    text-shadow: 0 0 4px rgba(255,255,255,0.6);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Tables --- */
.retro-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    border: 3px solid var(--ink);
    background: var(--paper);
}

.retro-table th {
    background: var(--ink);
    color: var(--paper);
    padding: 12px 16px;
    text-align: left;
    border-bottom: 3px solid var(--ink);
    font-family: var(--font-heading);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.retro-table td {
    padding: 12px 16px;
    border-bottom: 2px solid var(--ink);
    font-weight: 500;
}

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

.retro-table tr:hover td {
    background: var(--lime);
}

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-family: var(--font-heading);
    font-size: 11px;
    border: 2px solid var(--ink);
    letter-spacing: 1px;
    border-radius: 0;
    text-transform: uppercase;
    background: var(--paper);
    color: var(--ink);
}

.badge-green { background: var(--lime); color: var(--ink); }
.badge-pink { background: var(--pop); color: var(--paper); }
.badge-cyan { background: var(--blue); color: var(--paper); }
.badge-yellow { background: var(--amber); color: var(--ink); }

/* --- Forms (Brutalist) --- */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-input, .form-select {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 500;
    padding: 14px 16px;
    background: var(--paper);
    color: var(--ink);
    border: 3px solid var(--ink);
    width: 100%;
    border-radius: 0;
    transition: all 0.15s;
}

.form-input::placeholder, .form-select::placeholder {
    color: #aaa;
    font-weight: 400;
}

.form-input:focus, .form-select:focus {
    outline: none;
    background: var(--lime);
    box-shadow: var(--shadow-sm);
}

/* --- Toggle Switch --- */
.toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 6px 0;
    font-weight: 600;
}

.toggle-track {
    width: 48px;
    height: 26px;
    background: var(--paper);
    border: 3px solid var(--ink);
    border-radius: 0;
    position: relative;
    transition: all 0.15s;
}

.toggle-track::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    width: 18px;
    height: 18px;
    background: var(--ink);
    border-radius: 0;
    transition: all 0.15s;
}

.toggle.active .toggle-track {
    background: var(--lime);
    border-color: var(--ink);
}

.toggle.active .toggle-track::after {
    left: 25px;
    background: var(--ink);
    box-shadow: none;
}

/* --- QR Code Container --- */
.qr-container {
    background: var(--paper);
    padding: 16px;
    display: inline-block;
    margin: 16px 0;
    border: 3px solid var(--ink);
    box-shadow: var(--shadow-md);
}

.qr-container img { display: block; }

/* --- Payment Address --- */
.payment-address {
    background: var(--amber);
    border: 3px solid var(--ink);
    border-radius: 0;
    padding: 14px 16px;
    font-family: var(--font-mono);
    font-size: 13px;
    word-break: break-all;
    color: var(--ink);
    font-weight: 600;
    cursor: pointer;
    position: relative;
}

.payment-address:hover::after {
    content: 'CLICK TO COPY';
    position: absolute;
    top: -28px;
    right: 0;
    font-family: var(--font-heading);
    font-size: 10px;
    color: var(--ink);
    background: var(--lime);
    padding: 4px 8px;
    border: 2px solid var(--ink);
}

/* --- Status Indicator --- */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 0;
    margin-right: 8px;
    border: 2px solid var(--ink);
}

.status-dot.pending { background: var(--amber); animation: blink 1s infinite; }
.status-dot.confirmed { background: var(--lime); }
.status-dot.expired { background: #888; }
.status-dot.failed { background: var(--pop); }
.status-dot.completed { background: var(--lime); }
.status-dot.processing { background: var(--blue); animation: blink 1s infinite; }

/* --- Animations --- */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
}

.animate-flicker { animation: none; }

/* --- Style Grid (for settings) --- */
.style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.style-option {
    background: var(--paper);
    border: 3px solid var(--ink);
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.1s;
    font-size: 13px;
    font-weight: 600;
    border-radius: 0;
    box-shadow: 3px 3px 0 var(--ink);
}

.style-option:hover {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--ink);
}

.style-option.active {
    background: var(--blue);
    color: var(--paper);
    box-shadow: 3px 3px 0 var(--ink);
}

/* --- Clip List --- */
.clip-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border: 3px solid var(--ink);
    background: var(--paper);
    transition: all 0.1s;
    margin-bottom: 10px;
    box-shadow: 3px 3px 0 var(--ink);
}

.clip-item:hover {
    background: var(--lime);
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--ink);
}

.clip-hook {
    flex: 1;
    color: var(--ink);
    font-weight: 600;
}

.clip-date {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Loading / HTMX Indicator --- */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { display: inline-block; }

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4) infinite;
}

@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

/* --- Chain Selector --- */
.chain-selector {
    display: flex;
    gap: 12px;
}

.chain-option {
    flex: 1;
    padding: 16px;
    text-align: center;
    border: 3px solid var(--ink);
    cursor: pointer;
    transition: all 0.1s;
    background: var(--paper);
    box-shadow: 3px 3px 0 var(--ink);
    font-weight: 600;
}

.chain-option:hover {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--ink);
}

.chain-option.selected {
    background: var(--lime);
}

.chain-option .chain-name {
    font-family: var(--font-heading);
    font-size: 12px;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Error Pages --- */
.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.error-code {
    font-family: var(--font-heading);
    font-size: 120px;
    color: var(--pop);
    text-shadow: 6px 6px 0 var(--ink);
    margin-bottom: 16px;
    letter-spacing: -4px;
}

.error-message {
    font-size: 20px;
    color: var(--text-muted);
    margin-bottom: 32px;
    font-weight: 500;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .desktop-area { padding: 24px 16px; gap: 16px; }
    .window-body { padding: 20px; }
    h1 { font-size: 32px; }
    h2 { font-size: 22px; }
    .card-grid { grid-template-columns: 1fr; }
    .taskbar { padding: 12px 16px; flex-wrap: wrap; }
    .start-menu-items { gap: 2px; flex-wrap: wrap; }
    .start-menu-item { padding: 6px 10px; font-size: 11px; }
    .style-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}

@media (max-width: 480px) {
    .desktop-area { padding: 16px 12px; }
    .window-body { padding: 16px; }
    h1 { font-size: 26px; }
    .btn-lg { font-size: 14px; padding: 14px 20px; }
    .style-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-row { gap: 8px; }
    .stat-box { min-width: 80px; padding: 12px; }
    .stat-value { font-size: 24px; }
    .error-code { font-size: 80px; }
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 14px; }
::-webkit-scrollbar-track { background: var(--bg-dark); border-left: 2px solid var(--ink); }
::-webkit-scrollbar-thumb { background: var(--ink); border-radius: 0; border: 2px solid var(--bg-dark); }
::-webkit-scrollbar-thumb:hover { background: var(--pop); }
