/**
 * ARISE — Hacker Theme Styles
 * Dark terminal aesthetic with green/cyan accents.
 */

/* ─── Base ────────────────────────────────────────────────────────── */
* {
    scrollbar-width: thin;
    scrollbar-color: #1e2d3d #0a0e17;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #0a0e17;
}

::-webkit-scrollbar-thumb {
    background: #1e2d3d;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2e3d4d;
}

::selection {
    background: #00ff4133;
    color: #00ff41;
}

/* ─── Scanline Overlay (subtle CRT effect) ───────────────────────── */
.scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
}

/* ─── Cards ───────────────────────────────────────────────────────── */
.card {
    background: #111827;
    border: 1px solid #1e2d3d;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.card:hover {
    border-color: #2e3d4d;
}

.card-header {
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #9ca3af;
    border-bottom: 1px solid #1e2d3d;
    background: #0f1729;
}

.card-body {
    padding: 16px;
}

/* ─── Charts ──────────────────────────────────────────────────────── */
.chart-wrap {
    position: relative;
    max-width: 320px;
    margin: 0 auto;
}

/* ─── Tabs ────────────────────────────────────────────────────────── */
.tab-btn {
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    background: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.tab-btn:hover {
    color: #d1d5db;
    background: #ffffff08;
}

.tab-btn.active {
    color: #00ff41;
    border-bottom-color: #00ff41;
}

.tab-btn .tab-icon {
    font-size: 8px;
    vertical-align: middle;
    margin-right: 4px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── DataTables Theme Override ───────────────────────────────────── */
.dataTables_wrapper {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 12px;
    color: #9ca3af;
}

table.dataTable {
    border-collapse: collapse !important;
    width: 100% !important;
}

table.dataTable thead th {
    background: #0f1729 !important;
    color: #00ff41 !important;
    border-bottom: 1px solid #1e2d3d !important;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 10px 12px !important;
}

table.dataTable tbody td {
    background: #111827 !important;
    color: #d1d5db !important;
    border-bottom: 1px solid #1a2332 !important;
    padding: 8px 12px !important;
    font-size: 12px;
}

table.dataTable tbody tr:hover td {
    background: #1a2332 !important;
    color: #00ff41 !important;
}

table.dataTable tbody tr {
    cursor: default;
}

/* Clickable inbox rows */
#inboxTable tbody tr {
    cursor: pointer;
}

#inboxTable tbody tr:hover td {
    background: #00ff4111 !important;
}

/* DataTables toolbar */
.dt-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    flex-wrap: wrap;
    gap: 8px;
}

.dt-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    flex-wrap: wrap;
    gap: 8px;
}

.dataTables_length {
    color: #6b7280;
}

.dataTables_length select {
    background: #0a0e17;
    color: #00ff41;
    border: 1px solid #1e2d3d;
    border-radius: 4px;
    padding: 4px 8px;
    font-family: inherit;
    font-size: 12px;
    margin: 0 4px;
}

.dataTables_filter {
    color: #00d4ff;
}

.dataTables_filter input {
    background: #0a0e17;
    color: #00ff41;
    border: 1px solid #1e2d3d;
    border-radius: 4px;
    padding: 6px 12px;
    font-family: inherit;
    font-size: 12px;
    margin-left: 8px;
    outline: none;
    transition: border-color 0.2s;
}

.dataTables_filter input:focus {
    border-color: #00ff41;
    box-shadow: 0 0 0 1px #00ff4133;
}

.dataTables_info {
    color: #4b5563;
    font-size: 11px;
}

.dataTables_paginate {
    display: flex;
    gap: 4px;
}

.dataTables_paginate .paginate_button {
    padding: 4px 10px;
    border: 1px solid #1e2d3d;
    border-radius: 4px;
    color: #6b7280 !important;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.15s;
    background: #0a0e17 !important;
}

.dataTables_paginate .paginate_button:hover {
    background: #1e2d3d !important;
    color: #00ff41 !important;
    border-color: #00ff41 !important;
}

.dataTables_paginate .paginate_button.current {
    background: #00ff4122 !important;
    color: #00ff41 !important;
    border-color: #00ff41 !important;
    font-weight: 700;
}

.dataTables_paginate .paginate_button.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.dataTables_processing {
    background: #111827ee !important;
    color: #00ff41 !important;
    border: 1px solid #1e2d3d !important;
    font-size: 12px;
    padding: 8px 16px !important;
    border-radius: 6px;
}

/* Sorting arrows */
table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::after {
    opacity: 0.5 !important;
    color: #00ff41 !important;
}

table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::after {
    opacity: 1 !important;
}

/* ─── Modal ───────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-overlay.hidden {
    display: none;
}

.modal-container {
    background: #111827;
    border: 1px solid #1e2d3d;
    border-radius: 8px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 40px rgba(0, 255, 65, 0.05);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #1e2d3d;
    background: #0f1729;
    gap: 16px;
}

.modal-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

/* ─── Utility ─────────────────────────────────────────────────────── */
.tabular-nums {
    font-variant-numeric: tabular-nums;
}

.text-right {
    text-align: right;
}

/* Responsive */
@media (max-width: 640px) {
    .card-body {
        padding: 12px;
    }

    .chart-wrap {
        max-width: 260px;
    }

    .tab-btn {
        padding: 8px 10px;
        font-size: 11px;
    }
}

/* ─── Glow Effect on Active Elements ─────────────────────────────── */
.tab-btn.active {
    text-shadow: 0 0 8px #00ff4166;
}

#totalCount {
    text-shadow: 0 0 12px #ffb00066;
}

h1 {
    text-shadow: 0 0 20px #00ff4133;
}
