/* ═══════════════════════════════════════════════════════════════
   DeltaExchange Trading Platform — Premium Dark Theme
   ═══════════════════════════════════════════════════════════════ */

/* Glass Cards */
.glass-card {
    background: linear-gradient(135deg, rgba(17, 25, 39, 0.8), rgba(15, 21, 32, 0.9));
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.08);
}

.glass-card-accent {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(34, 211, 238, 0.04));
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 16px;
}

/* Stat Cards */
.stat-card {
    background: linear-gradient(135deg, rgba(17, 25, 39, 0.9), rgba(15, 21, 32, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
}

.stat-card-profit::before {
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.4), transparent);
}

.stat-card-loss::before {
    background: linear-gradient(90deg, transparent, rgba(244, 63, 94, 0.4), transparent);
}

/* Inputs */
.input-field {
    width: 100%;
    padding: 0.5rem 0.875rem;
    background: rgba(9, 13, 19, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #e5e7eb;
    font-size: 0.8125rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.25rem;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #818cf8, #6366f1);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.3rem 0.875rem;
    font-size: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: #9ca3af;
    transition: all 0.2s;
}

.btn-sm:hover {
    border-color: rgba(99, 102, 241, 0.4);
    color: #e5e7eb;
    background: rgba(99, 102, 241, 0.06);
}

.btn-danger {
    background: rgba(244, 63, 94, 0.1);
    color: #f43f5e;
    border-color: rgba(244, 63, 94, 0.2);
}

.btn-danger:hover {
    background: rgba(244, 63, 94, 0.2);
    border-color: rgba(244, 63, 94, 0.4);
}

/* Badges */
.badge-success, .badge-filled, .badge-submitted, .badge-simulated {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.15rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 500;
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.badge-failed {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.15rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 500;
    background: rgba(244, 63, 94, 0.12);
    color: #fb7185;
    border: 1px solid rgba(244, 63, 94, 0.15);
}

.badge-ignored {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.15rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 500;
    background: rgba(156, 163, 175, 0.1);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.1);
}

.badge-dry_run, .badge-pending {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.15rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 500;
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.15);
}

/* HTMX */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline; }
.htmx-request.btn-primary { opacity: 0.7; pointer-events: none; }

/* Chart containers */
.chart-container {
    position: relative;
    border-radius: 16px;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(17, 25, 39, 0.8), rgba(15, 21, 32, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Mini stat inline */
.mini-stat {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    color: #6b7280;
}

.mini-stat .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

/* Win rate ring */
.win-rate-ring {
    position: relative;
    width: 120px;
    height: 120px;
}

.win-rate-ring svg {
    transform: rotate(-90deg);
}

.win-rate-ring .ring-bg {
    stroke: rgba(255, 255, 255, 0.05);
}

.win-rate-ring .ring-fill {
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.15); }

/* Nav link active indicator */
.nav-link { position: relative; }

/* Tables */
table th {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: #4b5563;
}

/* Animations */
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.2); }
    50% { box-shadow: 0 0 20px 4px rgba(99, 102, 241, 0.1); }
}

.fade-in { animation: fadeSlideIn 0.3s ease; }

/* Fee info box */
.fee-info-box { animation: fadeSlideIn 0.18s ease; }
.fee-formula-box { box-shadow: 0 0 8px rgba(234, 179, 8, 0.08); }
.fee-header-tip, .role-header-tip {
    cursor: help; color: #4b5563; font-size: 10px;
    vertical-align: middle; margin-left: 2px; opacity: 0.7; transition: opacity 0.15s;
}
.fee-header-tip:hover, .role-header-tip:hover { opacity: 1; color: #818cf8; }

/* PnL text helpers */
.pnl-positive { color: #34d399; }
.pnl-negative { color: #fb7185; }
.pnl-zero { color: #6b7280; }
