/* Hide scrollbars for all elements */
* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
::-webkit-scrollbar,
*::-webkit-scrollbar { display: none; }

/* ─── Animations ─── */
@keyframes flicker {
    0%   { opacity: 1; }
    50%  { opacity: 0.5; }
    100% { opacity: 1; }
}
.flicker { animation: flicker 1.5s infinite; }

@keyframes glassShimmer {
    0%   { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes floatGlass {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-5px); }
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Custom fonts ─── */
@font-face { font-family: chaney;   src: url("/static/fonts/chaney.otf"); }
@font-face { font-family: rany;     src: url("/static/fonts/rany.otf"); }
@font-face { font-family: consolas; src: url("/static/fonts/consolas.ttf"); }

h1, h2, h3, h4, h5, h6 { font-family: chaney; }
* { font-family: rany; }

/* ─── Base layout ─── */
html, body { height: 100%; margin: 0; }
footer { height: var(--sb-footer-h); }
li > .active { background-color: transparent !important; border-radius: 4px !important; }

/* ─── Structural variables ─── */
:root {
    --sb-navbar-h: 80px;
    --sb-footer-h: 56px;
    --sb-w: 260px;
}

body { padding-top: var(--sb-navbar-h); }

/* ─── Global utilities ─── */
a { text-decoration: none !important; }
.btn { border-radius: 4px !important; }
.color-waker-green-header { font-family: chaney, Serif !important; }
.custom-container { max-height: 90%; min-height: 90%; overflow-x: hidden; min-width: 99%; max-width: 99%; }

/* ─── Navbar ─── */
.custom-navbar-styling-hover {
    -webkit-transition: background 0.8s;
    transition: background 0.8s;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: var(--sb-navbar-h);
    z-index: 500;
}

/* ─── Modal ─── */
.modal-body { max-height: 80vh; overflow-y: scroll; padding: 10px; }

/* ─── Table shapes ─── */
.table {
    border-collapse: separate;
    border-spacing: 0 1px;
    border-radius: 4px;
    overflow: hidden;
}
.table thead tr:first-child th:first-child { border-top-left-radius: 4px; }
.table thead tr:first-child th:last-child  { border-top-right-radius: 4px; }
.table tbody tr:last-child td:first-child  { border-bottom-left-radius: 4px; }
.table tbody tr:last-child td:last-child   { border-bottom-right-radius: 4px; }

/* ─── Glass component shapes ─── */
.glass-card {
    border-radius: 16px;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
                background 0.45s ease, border-color 0.45s ease, box-shadow 0.45s ease;
}
.glass-card:hover { transform: translateY(-3px); }

.glass-card-neutral {
    border-radius: 16px;
}

.btn-eye {
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0.55;
    display: flex;
    align-items: center;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
}
.btn-eye:hover { opacity: 1; color: inherit; }


.glass-card-lg {
    border-radius: 20px;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.45s ease, border-color 0.45s ease;
}

.glass-card-sm { border-radius: 12px; }

.icon-badge {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.35s ease, box-shadow 0.35s ease;
}
.icon-badge:hover { transform: scale(1.05); }

.stat-badge {
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.list-item {
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.list-item:hover { padding-left: 20px; }

.search-input {
    padding: 10px 16px;
    border-radius: 10px;
    width: 100%;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}
.search-input:focus { outline: none; }

.domain-search-container {
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.btn-waker {
    padding: 10px 24px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.btn-waker::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}
.btn-waker:hover::before { left: 100%; }
.btn-waker:hover         { transform: translateY(-3px); }

.btn-export {
    padding: 10px 24px;
    border-radius: 10px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-export:hover { transform: translateY(-3px); }

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-width: 2px;
    border-style: solid;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.progress-container { border-radius: 8px; padding: 12px; margin-top: 12px; }
.progress-item       { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.progress-item:last-child { margin-bottom: 0; }
.progress-icon       { width: 20px; text-align: center; }

.chart-container {
    border-radius: 14px;
    padding: 20px;
    height: 350px;
    overflow-y: auto;
}
.chart-bar-item  { margin-bottom: 15px; }
.chart-bar-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.chart-bar-track { height: 24px; border-radius: 6px; overflow: hidden; position: relative; }
.chart-bar-fill  { height: 100%; border-radius: 6px; transition: width 0.8s ease; display: flex; align-items: center; padding: 0 10px; min-width: 30px; }
.chart-bar-value { font-size: 0.75rem; font-weight: 700; }
.chart-no-data   { display: flex; align-items: center; justify-content: center; height: 100%; }
.loading-data    { display: flex; align-items: center; justify-content: center; height: 100%; }

.glass-button {
    padding: 12px 28px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.glass-button:hover { transform: translateY(-4px); }

.glass-panel   { border-radius: 20px; padding: 32px; transition: border-color 0.4s ease, box-shadow 0.4s ease; }
.glass-badge   { padding: 6px 14px; border-radius: 20px; font-weight: 700; font-size: 0.8rem; letter-spacing: 0.5px; display: inline-block; }
.glass-input   { padding: 12px 16px; border-radius: 10px; transition: all 0.3s ease; font-size: 0.95rem; }
.glass-input:focus { outline: none; }
.glass-tooltip { padding: 12px 16px; border-radius: 10px; font-size: 0.85rem; }
.float-glass   { animation: floatGlass 3s ease-in-out infinite; }
.glass-divider { height: 1px; margin: 20px 0; }

/* ─────────────────────────────────────────────
   WAKER SIDEBAR — structural
   ───────────────────────────────────────────── */
#waker-sidebar {
    top: var(--sb-navbar-h);
    height: calc(100vh - var(--sb-navbar-h));
    --bs-offcanvas-width: var(--sb-w);
}

#waker-sidebar .offcanvas-header {
    padding: 16px 14px 14px;
    flex-direction: column;
    align-items: flex-start;
}

.sb-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.sb-brand-name {
    font-family: chaney, sans-serif;
    font-size: 1.05rem;
    letter-spacing: 0.18em;
}

#waker-sidebar .offcanvas-body {
    padding: 0;
    display: flex;
    flex-direction: column;
}

.sb-nav {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 10px 16px;
}

.sb-section-label {
    font-family: 'JetBrains Mono', consolas, monospace;
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 14px 8px 6px;
    margin: 0;
}

.sb-divider {
    height: 1px;
    margin: 8px 4px;
    border: none;
}

.sb-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    transition: background 0.22s ease, color 0.22s ease;
    font-size: 0.9rem;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    line-height: 1.4;
}

.sb-item i {
    font-size: 1.05rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    transition: color 0.22s ease;
}

.sb-item.is-active {
    border-left: 2px solid transparent;
    padding-left: 10px;
}

.sb-badge {
    margin-left: auto;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    flex-shrink: 0;
}

.sb-status-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    font-size: 0.85rem;
}

.sb-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sb-foot {
    height: var(--sb-footer-h);
    padding: 0 10px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.sb-user {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.sb-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: chaney, sans-serif;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.sb-user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.sb-user-name {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sb-user-role {
    font-size: 0.68rem;
    font-family: consolas, monospace;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.sb-open-btn {
    position: fixed;
    top: calc(var(--sb-navbar-h) + 12px);
    left: 12px;
    z-index: 1050;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    cursor: pointer;
    opacity: 0.18;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.25s ease;
}
.sb-open-btn:hover { opacity: 1; }

body.sb-shown .sb-open-btn {
    opacity: 0;
    pointer-events: none;
}

.sb-main {
    padding-bottom: calc(var(--sb-footer-h) + 8px);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sb-footer-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--sb-footer-h);
    z-index: 50;
    display: flex;
    align-items: center;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 768px) {
    body.sb-shown .sb-main       { margin-left: var(--sb-w); }
    body.sb-shown .sb-footer-bar { left: var(--sb-w); }
}

/* ─────────────────────────────────────────────
   THEME SWITCHER — structural
   ───────────────────────────────────────────── */
.theme-switcher {
    display: flex;
    align-items: center;
    gap: 2px;
    border-radius: 10px;
    padding: 3px;
}

.theme-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 7px;
    border: none;
    background: transparent;
    font-size: 0.78rem;
    font-family: rany, sans-serif;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
    white-space: nowrap;
}
.theme-btn i { font-size: 0.82rem; }

/* ─── Sidebar dropdown ─── */
.sb-item-child {
    padding-left: 34px;
    font-size: 0.84rem;
}
.sb-chevron {
    transition: transform 0.22s ease;
    font-size: 0.7rem;
    flex-shrink: 0;
}
.sb-dropdown-toggle[aria-expanded="true"] .sb-chevron {
    transform: rotate(180deg);
}
.sb-sub-nav { padding: 2px 0 4px; }

/* ─── Glass table ─── */
.glass-table-wrapper {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.glass-table {
    margin-bottom: 0 !important;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.glass-table thead tr th {
    white-space: nowrap;
    font-weight: 700;
}
.glass-table tbody tr td {
    transition: background 0.18s ease, color 0.18s ease;
}

/* ─── Toast ─── */
.toast-container-waker {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 400px;
    width: calc(100vw - 48px);
}

.waker-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 14px 20px;
    border-radius: 14px;
    min-width: 280px;
    position: relative;
    overflow: hidden;
    pointer-events: all;
    animation: toastSlideIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.waker-toast.hiding {
    animation: toastSlideOut 0.28s ease forwards;
}

@keyframes toastSlideIn {
    from { transform: translateX(36px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
@keyframes toastSlideOut {
    from { transform: translateX(0);    opacity: 1; max-height: 200px; margin-bottom: 0; }
    to   { transform: translateX(36px); opacity: 0; max-height: 0;     margin-bottom: -10px; }
}

.waker-toast-icon {
    font-size: 1.1rem;
    width: 22px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 2px;
}
.waker-toast-content { flex: 1; min-width: 0; }
.waker-toast-header {
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 3px;
}
.waker-toast-body {
    font-size: 0.83rem;
    line-height: 1.45;
    word-break: break-word;
}
.waker-toast-close {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
    transition: opacity 0.18s ease;
    opacity: 0.45;
}
.waker-toast-close:hover { opacity: 1; }

.waker-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
}
.waker-toast-progress-bar {
    height: 100%;
    width: 100%;
    animation: toastProgress linear forwards;
    transform-origin: left;
}
@keyframes toastProgress {
    from { width: 100%; }
    to   { width: 0%;   }
}

/* ─── OSINT modal helpers (theme-agnostic structure) ─── */
.osint-notes-area {
    resize: none;
    font-size: 0.85rem;
    line-height: 1.6;
    min-height: 200px;
    flex: 1;
}
.osint-threat-col { width: 210px; }

.osint-domain-tag {
    font-family: monospace;
    font-size: 0.95rem;
}

.osint-section-label {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Vertical threat-level meter — equal-height segments fill the column */
.threat-meter {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 200px;
}
.threat-lvl {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: left;
    border: 1px solid transparent;
    background: transparent;
    width: 100%;
    cursor: pointer;
    transition: all 0.15s ease;
}
.threat-meter--readonly .threat-lvl { cursor: default; }
.threat-lvl__num {
    font-size: 1.05rem;
    font-weight: 700;
    opacity: 0.8;
    min-width: 14px;
}
.threat-lvl__name { letter-spacing: 0.02em; }

/* Screenshot frame */
.osint-screenshot-frame {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    border: 1px dashed transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 0.25rem;
}
.osint-screenshot-frame img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 9px;
}
.osint-screenshot-ph {
    text-align: center;
    font-size: 0.72rem;
}
.osint-screenshot-ph i {
    font-size: 1.7rem;
    display: block;
    margin-bottom: 4px;
}

/* ─── Scan status badges ─── */
.scan-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    padding: 3px 10px;
    border-radius: 99px;
    white-space: nowrap;
}

/* Animated pulse dot (running state) */
.scan-pulse {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 6px;
    animation: scanPulse 1.4s ease-in-out infinite;
}
@keyframes scanPulse {
    0%, 100% { opacity: 1;   transform: scale(1);   }
    50%       { opacity: 0.4; transform: scale(0.7); }
}

/* Disabled icon button (theme-agnostic) */
.btn-icon:disabled,
.btn-icon[disabled] {
    opacity: 0.2;
    cursor: not-allowed;
    pointer-events: none;
}

/* ─── Scan group accordion ─── */
.scan-group-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    border-radius: 5px;
    font-size: 0.78rem;
    flex-shrink: 0;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

/* Sub-rows: indent all content 1 tab to the right vs primary rows */
.scan-sub-row td {
    padding-left: 2rem !important;
}
.scan-sub-row td:first-child {
    padding-left: 1rem !important;
    border-left: 2px solid transparent; /* coloured per-theme */
}
.scan-sub-indent {
    font-size: 0.75rem;
    line-height: 1;
    opacity: 0.3;
}

/* Readonly notes textblock */
.osint-textblock {
    font-size: 0.85rem;
    line-height: 1.65;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    white-space: pre-wrap;
    flex: 1;
}
