/* ============================================================================
   GLOBAL THEME
   ============================================================================ */
:root {
    --bg: #101820;
    --fg: #e0e6ed;
    --widget-bg: #18222f;
    --header-bg: #223448;
    --header-text: #ffd966;
    --accent: #6db3ff;
}

body {
    background: var(--bg);
    color: var(--fg);
    font-family: "Segoe UI", sans-serif;
    margin: 0;
    padding: 1rem;
}

/* ============================================================================
   GRID LAYOUT – two widgets per row
   ============================================================================ */
.grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    align-items: start;
}

/* ============================================================================
   WIDGETS
   ============================================================================ */
.widget {
    background: var(--widget-bg);
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    transition: transform .2s ease;
}

.widget:hover {
    transform: scale(1.02);
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.6rem;
    border-bottom: 1px solid #2a3b4d;
    padding-bottom: 0.3rem;
}
.cv-thumb {
    width: 60px;
    height: auto;
    border-radius: 6px;
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
/* ---------------------------------------------
   COMMON VISITORS WIDGET
--------------------------------------------- */

#commonTable {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

#commonTable th {
    position: sticky;
    top: 0;
    background: #1d2735;
    z-index: 3;
}

#commonTable td,
#commonTable th {
    padding: 8px 10px;
    white-space: nowrap;
    text-align: left;
}

/* Thumbnail column size */
.thumb-cell {
    width: 75px;
}

.thumb {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 0 8px rgba(0,0,0,0.5);
    transition: transform 0.15s ease-in-out;
}

.thumb:hover {
    transform: scale(1.06);
}

/* Placeholder if no thumbnail found */
.thumb-placeholder {
    width: 70px;
    height: 70px;
    background: #2d3748;
    border-radius: 8px;
    opacity: 0.4;
}

/* Hover highlight */
#commonTable tbody tr:hover {
    background: rgba(255,255,255,0.05);
}

/* -----------------------------------------
   HD LIGHTBOX
----------------------------------------- */

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 10px;
    box-shadow: 0 0 25px rgba(0,0,0,0.7);
    transform: scale(0.85);
    transition: transform 0.25s ease-in-out;
}

.lightbox-overlay.active .lightbox-image {
    transform: scale(1);
}



/* ============================================================================
   SCROLL AREAS
   ============================================================================ */
.widget-body {
    max-height: 420px;          /* <- CONTROL WIDGET HEIGHT */
    overflow-y: auto;
    padding-right: 6px;
}

/* ============================================================================
   TABLES (unified rules, prevents layout break)
   ============================================================================ */
table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;         /* Ensures consistent column width */
}

/* Table headers */
th {
    background: var(--header-bg);
    color: var(--header-text) !important;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 0.5rem;
    text-align: left;
    white-space: nowrap;
}

/* Table cells */
td {
    padding: 0.45rem 0.5rem;
    white-space: nowrap;
}

/* Force correct table layout (fixes the “vertical stacking bug”) */
th, td {
    display: table-cell !important;
    vertical-align: middle;
}

/* Table rows */
tr {
    display: table-row !important;
}

/* Zebra shading */
tr:nth-child(even) { background: #1a2738; }
tr:nth-child(odd)  { background: #18222f; }

/* ============================================================================
   FORMS & INPUTS
   ============================================================================ */
input[type="number"],
input[type="text"],
button {
    background: #111a22;
    color: var(--fg);
    border: 1px solid #2f3f55;
    border-radius: 4px;
    padding: 3px 6px;
}

button {
    cursor: pointer;
    background: #2a3f5a;
    border-color: #3a5678;
}

button:hover {
    background: #3b5475;
}

/* Checkbox alignment fix */
label {
    color: var(--fg);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* ============================================================================
   SCROLLBAR (clean + subtle)
   ============================================================================ */
.widget-body::-webkit-scrollbar {
    width: 8px;
}
.widget-body::-webkit-scrollbar-track {
    background: #0d141b;
}
.widget-body::-webkit-scrollbar-thumb {
    background: #3a4b61;
    border-radius: 6px;
}
.widget-body::-webkit-scrollbar-thumb:hover {
    background: #516883;
}


/* ============================================================================
  Search Widget
   ============================================================================ */
.flight-search-widget {
    border: 1px solid #222;
    padding: 15px;
    margin-bottom: 20px;
    background: #0f0f0f;
    border-radius: 8px;
}

.flight-search-widget .widget-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.flight-search-widget .row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.flight-search-widget input,
.flight-search-widget select {
    background: #111;
    color: #eee;
    border: 1px solid #333;
    padding: 6px 10px;
    border-radius: 6px;
}

.flight-search-widget .btn {
    background: #0052ff;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
}

.flight-search-widget .btn:hover {
    background: #003ecc;
}
#spitTable {
    width: 100% !important;
    table-layout: fixed !important;
}

#spitTable th,
#spitTable td {
    white-space: normal !important;      /* WRAP */
    word-wrap: break-word !important;    /* WRAP CENTER & BREAK LONG STRINGS */
    overflow-wrap: break-word !important;
    display: table-cell !important;      /* override flex or block layout */
    position: static !important;         /* override absolute/flex children */
    max-width: 300px !important;
}

/* ============================================================================
   FURTHEST AIRCRAFT WIDGET – FIX COLUMN WRAPPING
   ============================================================================ */

/* Force wrapping + width on Type column */
#widget-furthest table#furthestTable th:nth-child(3),
#widget-furthest table#furthestTable td:nth-child(3) {
    width: 220px !important;
    max-width: 220px !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    line-height: 1.25;
}

/* Narrow RegNo + ICAO columns */
#widget-furthest table#furthestTable th:nth-child(1),
#widget-furthest table#furthestTable td:nth-child(1),
#widget-furthest table#furthestTable th:nth-child(2),
#widget-furthest table#furthestTable td:nth-child(2) {
    width: 70px !important;
    max-width: 70px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

