/* ── Neon Dark Theme: Custom Styles ── */

:root {
    --neon: #39FF14;
    --neon-dim: rgba(57, 255, 20, 0.3);
    --neon-glow: 0 0 15px rgba(57, 255, 20, 0.3), 0 0 30px rgba(57, 255, 20, 0.1);
    --neon-glow-strong: 0 0 20px rgba(57, 255, 20, 0.5), 0 0 40px rgba(57, 255, 20, 0.2);
    --bg-dark: #0a0a0f;
    --bg-card: #111118;
    --bg-input: #1a1a24;
    --border: #2a2a3a;
}

body {
    background-color: var(--bg-dark);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Glow Effects */
.glow { box-shadow: var(--neon-glow); }
.glow-strong { box-shadow: var(--neon-glow-strong); }
.glow-text { text-shadow: 0 0 10px rgba(57, 255, 20, 0.5); }
.glow-border { border-color: var(--neon-dim); }

/* Neon Button */
.btn-neon {
    background-color: var(--neon);
    color: #000;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}
.btn-neon:hover {
    box-shadow: var(--neon-glow-strong);
    transform: translateY(-1px);
}
.btn-neon:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Ghost Button */
.btn-ghost {
    background: transparent;
    color: var(--neon);
    border: 1px solid var(--neon-dim);
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    cursor: pointer;
}
.btn-ghost:hover {
    background: rgba(57, 255, 20, 0.1);
    border-color: var(--neon);
}

/* Danger Button */
.btn-danger {
    background: transparent;
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.4rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    cursor: pointer;
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

/* Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
}
.card-glow {
    border-color: var(--neon-dim);
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.05);
}

/* Inputs */
.input-dark {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: #e5e5e5;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    width: 100%;
    transition: border-color 0.2s;
}
.input-dark:focus {
    outline: none;
    border-color: var(--neon);
    box-shadow: 0 0 0 2px rgba(57, 255, 20, 0.15);
}
.input-dark::placeholder { color: #555; }

select.input-dark {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2339FF14' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

textarea.input-dark {
    min-height: 100px;
    resize: vertical;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}
.badge-neon {
    background: rgba(57, 255, 20, 0.15);
    color: var(--neon);
    border: 1px solid var(--neon-dim);
}
.badge-red {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.badge-blue {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}
.badge-yellow {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.3);
}
.badge-gray {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

/* Table */
.table-dark {
    width: 100%;
    border-collapse: collapse;
}
.table-dark th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    border-bottom: 1px solid var(--border);
}
.table-dark td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(42, 42, 58, 0.5);
    font-size: 0.875rem;
}
.table-dark tr:hover td {
    background: rgba(57, 255, 20, 0.03);
}

/* PnL Colors */
.pnl-positive { color: var(--neon); }
.pnl-negative { color: #ef4444; }

/* Sidebar Active */
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-radius: 0.5rem;
    color: #9ca3af;
    text-decoration: none;
    transition: all 0.15s;
    font-size: 0.9rem;
}
.nav-link:hover {
    color: #e5e5e5;
    background: rgba(255, 255, 255, 0.05);
}
.nav-link.active {
    color: var(--neon);
    background: rgba(57, 255, 20, 0.1);
    border: 1px solid var(--neon-dim);
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.08);
}

/* Flash Messages */
.flash { padding: 0.75rem 1rem; border-radius: 0.5rem; margin-bottom: 1rem; font-size: 0.875rem; }
.flash-success { background: rgba(57, 255, 20, 0.1); border: 1px solid var(--neon-dim); color: var(--neon); }
.flash-error { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: #ef4444; }
.flash-info { background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.3); color: #3b82f6; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* Stats Card */
.stat-value {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.2;
}
@media (min-width: 768px) {
    .stat-value {
        font-size: 1.5rem;
    }
}

/* ── Mobile Responsive ── */
@media (max-width: 767px) {
    /* Smaller card padding on mobile */
    .card {
        padding: 1rem;
    }

    /* Table: smaller text & padding */
    .table-dark th {
        padding: 0.5rem 0.5rem;
        font-size: 0.65rem;
    }
    .table-dark td {
        padding: 0.5rem 0.5rem;
        font-size: 0.75rem;
    }

    /* Badge smaller on mobile */
    .badge {
        padding: 0.15rem 0.4rem;
        font-size: 0.65rem;
    }

    /* Smaller page header on mobile */
    h1 {
        font-size: 1.25rem !important;
    }

    /* Flash smaller */
    .flash {
        font-size: 0.8rem;
        padding: 0.6rem 0.8rem;
    }

    /* Pagination smaller */
    .page-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }

    /* Inputs slightly smaller */
    .input-dark {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }

    /* Nav links smaller on mobile sidebar */
    .nav-link {
        font-size: 0.85rem;
        padding: 0.55rem 0.85rem;
    }

    /* Buttons smaller */
    .btn-neon, .btn-ghost {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
    }
}

/* Gallery */
.gallery-img {
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    transition: all 0.2s;
    cursor: pointer;
    object-fit: cover;
}
.gallery-img:hover {
    border-color: var(--neon-dim);
    box-shadow: var(--neon-glow);
}

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

/* Checkbox custom */
input[type="checkbox"] {
    accent-color: var(--neon);
    width: 1.1rem;
    height: 1.1rem;
}

/* Pagination */
.page-btn {
    padding: 0.4rem 0.8rem;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    border: 1px solid var(--border);
    color: #9ca3af;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s;
}
.page-btn:hover { border-color: var(--neon-dim); color: var(--neon); }
.page-btn.active { background: rgba(57, 255, 20, 0.15); color: var(--neon); border-color: var(--neon-dim); }
