/* --- IBM i Portal Global Variables --- */
:root {
    --green: #00ff41;
    --dim-green: #008f11;
    --bg: #0a0a0a;
    --card-bg: #111;
    --white: #ffffff;
    --border-color: #222;
    --font-mono: 'Courier New', monospace;
}

/* --- General Reset & Typography --- */
body {
    background: var(--bg);
    color: var(--green);
    font-family: var(--font-mono);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    text-transform: uppercase;
    font-weight: bold;
}

.text-white-primary { color: var(--white) !important; }
.text-white-secondary { color: rgba(255, 255, 255, 0.8) !important; }
.text-dim { color: var(--dim-green) !important; }

/* --- Breadcrumbs --- */
.breadcrumb-container {
    padding: 10px 0;
    margin-bottom: 20px;
    font-size: 0.85rem;
    border-bottom: 1px dotted var(--dim-green);
}
.breadcrumb-container a {
    color: var(--green);
    text-decoration: none;
}
.breadcrumb-container a:hover { text-decoration: underline; }
.breadcrumb-container .sep { color: var(--dim-green); margin: 0 8px; }
.breadcrumb-container .current { color: var(--white); opacity: 0.8; }

/* --- Header & Navigation Elements --- */
.command-bar {
    background: #000;
    border: 1px solid var(--green);
    padding: 12px;
    margin-bottom: 20px;
}
.terminal-input {
    background: transparent;
    border: none;
    color: var(--green);
    outline: none;
    width: 60%;
    border-bottom: 1px solid var(--green);
}

/* CATEGORY BAR: ENHANCED FOR MULTIPLE CATEGORIES */
.cat-bar {
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    display: flex !important;
    flex-wrap: nowrap !important; /* Forces all categories onto ONE line */
    overflow-x: auto !important;  /* Enables horizontal scrolling */
    gap: 15px;
    align-items: center;
    -webkit-overflow-scrolling: touch; /* Smooth swipe for mobile */
    scrollbar-width: thin;
    scrollbar-color: var(--green) #000;
}

/* Custom Scrollbar for Chrome/Edge/Safari */
.cat-bar::-webkit-scrollbar { height: 4px; }
.cat-bar::-webkit-scrollbar-thumb { background: var(--green); border-radius: 10px; }

.cat-link {
    color: var(--dim-green);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 2px 8px;
    border: 1px solid transparent;
    transition: 0.2s;
    flex: 0 0 auto !important; /* Prevents the links from squishing */
    white-space: nowrap !important;
}
.cat-link:hover, .cat-active {
    color: var(--green);
    border: 1px solid var(--green);
}

/* --- Content Layout & Cards --- */
.column-header {
    border-bottom: 2px solid var(--green);
    margin-bottom: 20px;
    padding-bottom: 5px;
    color: var(--white);
}
.card {
    background: var(--card-bg);
    border: 1px solid var(--dim-green);
    border-radius: 0;
    margin-bottom: 15px;
    transition: transform 0.2s;
}
.btn-select {
    color: var(--green);
    border: 1px solid var(--dim-green);
    text-decoration: none;
    display: block;
    text-align: center;
    font-size: 0.8rem;
    padding: 8px;
    margin-top: 10px;
}
.btn-select:hover {
    background: var(--green);
    color: #000;
}

/* --- Featured Sections --- */
.featured-box {
    background: rgba(0, 255, 65, 0.05);
    border: 2px solid var(--green);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.2);
    margin-bottom: 30px;
    padding: 15px;
    position: relative;
}
.featured-label {
    position: absolute;
    top: -12px;
    left: 15px;
    background: var(--green);
    color: #000;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 10px;
}

/* --- Video Layout Adjustments --- */
.video-card-row {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}
.thumb-mini {
    width: 120px;
    height: 70px;
    min-width: 120px;
    object-fit: cover;
    border: 1px solid var(--dim-green);
}
.video-details {
    flex: 1;
    min-width: 0;
}
.video-details h5, .video-details h6 {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* --- Utility Classes --- */
.text-dim { color: #666; font-family: var(--font-mono); }
.hover-green:hover { color: var(--green) !important; }

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container { padding: 15px; }
    .terminal-input { width: 100%; }
}

/* --- Missing Admin Dashboard Specific Styles --- */
.menu-container {
    max-width: 900px;
    margin: 40px auto;
}

.terminal-header {
    border-left: 4px solid var(--green);
    padding-left: 20px;
    margin-bottom: 40px;
}

.menu-card {
    display: block;
    background: #111;
    border: 1px solid #333;
    padding: 20px;
    margin-bottom: 15px;
    text-decoration: none;
    transition: 0.2s;
}

.menu-card:hover {
    border-color: var(--green);
    background: rgba(0, 255, 65, 0.05);
    transform: translateX(10px);
}

.menu-title {
    color: var(--green);
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.menu-desc {
    color: #8b949e;
    font-size: 0.85rem;
}

.alert-terminal {
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid var(--green);
    color: var(--green);
    padding: 15px;
    margin-bottom: 25px;
    font-family: var(--font-mono);
}

.opacity-50 { opacity: 0.5; }

/* --- Admin Management Page Specific Styles --- */

/* Admin Table Layout */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 0.85rem;
    border: 1px solid #333;
}

.admin-table th {
    background: #1a1a1a;
    color: var(--green);
    text-transform: uppercase;
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid var(--green);
}

.admin-table td {
    padding: 10px;
    border-bottom: 1px solid #222;
    vertical-align: middle;
    color: var(--white);
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-table tr:hover {
    background: rgba(0, 255, 65, 0.03);
}

/* Terminal Buttons & Status Toggles */
.btn-terminal {
    display: inline-block;
    padding: 4px 10px;
    border: 1px solid var(--dim-green);
    color: var(--green);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    transition: 0.2s;
    background: transparent;
}

.btn-terminal:hover {
    background: var(--green);
    color: #000;
}

.status-on {
    color: var(--green) !important;
    border-color: var(--green) !important;
}

.status-off {
    color: #ff4141 !important;
    border-color: #ff4141 !important;
}

.text-keywords {
    color: #8b949e;
    font-style: italic;
    font-size: 0.7rem;
}

/* Styling for WYSIWYG output */
.full-text {
    color: var(--white);
    line-height: 1.8;
}
.full-text h2, .full-text h3 { color: var(--green); margin-top: 25px; }
.full-text ul { padding-left: 20px; border-left: 1px solid var(--dim-green); }
.full-text table { width: 100%; border: 1px solid #333; margin: 20px 0; }
.full-text td, .full-text th { padding: 10px; border: 1px solid #222; }

/* --- USER-FACING PAGE SPECIFIC STYLES --- */

/* Shared Content Wrappers */
.content-wrapper-terminal {
    max-width: 900px;
    margin: 40px auto;
    border: 1px solid var(--dim-green);
    background: rgba(0, 20, 0, 0.4);
    padding: 40px;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.05);
}

/* Contact Page Styles */
.contact-container {
    max-width: 700px;
    margin: 60px auto;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 40px;
}
.email-link {
    display: inline-block;
    color: var(--green);
    text-decoration: none;
    font-size: 1.2rem;
    padding: 10px 20px;
    border: 1px dashed var(--dim-green);
    transition: 0.3s;
}
.email-link:hover { background: rgba(0, 255, 65, 0.1); border-style: solid; }

/* Search & Tag Styles */
.btn-terminal-tag {
    background: transparent;
    border: 1px solid var(--green);
    color: var(--green);
    padding: 4px 12px;
    text-transform: uppercase;
    font-size: 0.8rem;
    text-decoration: none;
    display: inline-block;
}
.btn-terminal-tag:hover { background: var(--green); color: #000; }

/* Privacy & Legal Elements */
.highlight-tag {
    color: var(--green);
    background: rgba(0, 255, 65, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
}

/* AI Processor Dashboard */
.ai-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-top: 20px; }
.ai-box { background: #111; border-left: 3px solid var(--green); padding: 15px; }

/* --- [RETAINED] USER-FACING & GLOBAL STYLES --- */
:root {
    --green: #00ff41;
    --dim-green: #008f11;
    --bg: #0a0a0a;
    --card-bg: #111;
    --white: #ffffff;
    --border-color: #222;
    --font-mono: 'Courier New', monospace;
}

/* ... existing body, h1, .btn-terminal-tag, .content-wrapper-terminal, etc ... */

/* --- [NEW] ADMIN PANEL INTERFACE STYLES --- */

/* Main Dashboard Cards (admin_home.php) */
.menu-card {
    display: block;
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    padding: 25px;
    margin-bottom: 20px;
    text-decoration: none;
    transition: 0.3s;
    border-left: 4px solid var(--dim-green);
}
.menu-card:hover {
    border-color: var(--green);
    background: #111;
    transform: translateX(10px);
}
.menu-title { color: var(--green); font-size: 1.1rem; font-weight: bold; margin-bottom: 5px; }
.menu-desc { color: #888; font-size: 0.85rem; }

/* Statistics Grid */
.stat-box {
    background: #000;
    border: 1px solid var(--dim-green);
    padding: 15px;
    text-align: center;
}
.stat-value { font-size: 1.5rem; color: var(--green); font-weight: bold; display: block; }
.stat-label { font-size: 0.7rem; color: var(--dim-green); text-transform: uppercase; }

/* Admin Inputs & Forms */
.terminal-input {
    background: #000;
    border: 1px solid var(--dim-green);
    color: var(--green);
    padding: 10px;
    font-family: var(--font-mono);
    outline: none;
}
.terminal-input:focus { border-color: var(--green); box-shadow: 0 0 10px rgba(0, 255, 65, 0.2); }

/* Record Details & Debug Console (record_details.php) */
.record-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1px;
    background: #222;
    border: 1px solid #222;
}
.detail-label { background: #0d0d0d; padding: 12px; color: var(--dim-green); font-size: 0.8rem; font-weight: bold; }
.detail-value { background: #000; padding: 12px; color: #fff; font-size: 0.9rem; word-break: break-all; }

.debug-console { background: #050505; border: 1px solid #222; padding: 20px; margin-top: 40px; }
.json-block { background: #000; border: 1px solid #1a1a1a; padding: 15px; color: #00ff41; font-size: 0.8rem; overflow-x: auto; }

 /* Statistics Box Styling */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;
            margin-bottom: 30px;
            border: 1px dashed #30363d;
            padding: 20px;
            background: rgba(0, 255, 65, 0.02);
        }
        .stat-item { font-family: 'Fira Code', monospace; }
        .stat-label { color: #8b949e; font-size: 0.75rem; text-transform: uppercase; display: block; }
        .stat-value { color: #00ff41; font-size: 1.2rem; font-weight: bold; }

/* Prevents horizontal overflow across the whole site */
body, html {
    overflow-x: hidden;
}

/* Forces long buttons or links to wrap text if they hit the edge */
.btn {
    white-space: normal !important;
    word-wrap: break-word;
}

/* ==========================================================================
   HOMEPAGE & TERMINAL SPECIFIC RESTORATION
   ========================================================================== */

/* 1. Horizontal Scrollable Category Bar */
.cat-bar { 
    display: flex; 
    overflow-x: auto; 
    white-space: nowrap; 
    padding-bottom: 12px; 
    margin-bottom: 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--dim-green) var(--bg);
}

/* Scrollbar Aesthetics for Chrome/Safari */
.cat-bar::-webkit-scrollbar { height: 5px; }
.cat-bar::-webkit-scrollbar-track { background: var(--bg); }
.cat-bar::-webkit-scrollbar-thumb { background: var(--dim-green); border-radius: 10px; }

/* 2. Category Filter Links */
.cat-link { 
    color: var(--dim-green); 
    text-decoration: none; 
    margin-right: 18px; 
    font-size: 0.8rem;
    padding: 5px 12px;
    border: 1px solid transparent;
    font-family: var(--font-mono);
    transition: 0.2s;
}
.cat-link:hover { color: var(--green); border: 1px solid var(--green); text-shadow: 0 0 5px var(--green); }
.cat-active { color: var(--green); border: 1px solid var(--green); font-weight: bold; }

/* 3. Terminal Action Buttons (.btn-select) */
.btn-select { 
    background: transparent; 
    color: var(--green); 
    border: 1px solid var(--green); 
    font-size: 0.7rem; 
    padding: 4px 12px; 
    text-decoration: none; 
    display: inline-block;
    font-family: var(--font-mono);
    transition: 0.3s;
}
.btn-select:hover { 
    background: var(--green); 
    color: #000; 
    box-shadow: 0 0 12px var(--green); 
}

/* 4. Column & Content Elements */
.column-header { 
    border-left: 4px solid var(--green); 
    padding-left: 12px; 
    color: var(--white); 
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.thumb-mini { 
    width: 100px; 
    height: 56px; 
    object-fit: cover; 
    border: 1px solid var(--border-color); 
}

.featured-box { 
    border: 1px solid var(--green) !important; 
    background: #000; 
    padding: 15px; 
    margin-bottom: 20px; 
}

/* --- TILE HOVER RECONSTRUCTION --- */

/* 1. Base Card State */
.card {
    background: var(--card-bg);
    border: 1px solid var(--dim-green); /* The "Dim" state */
    border-radius: 0;
    margin-bottom: 15px;
    transition: all 0.3s ease; /* Ensures border, shadow, and lift are all smooth */
}

/* 2. The Glow Effect (Hover) */
.card:hover {
    border-color: var(--green); /* Lights up the border */
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.25); /* The subtle terminal glow */
    transform: translateY(-3px); /* Gives it a "lift" when the user hovers */
    cursor: pointer;
    background: rgba(0, 255, 65, 0.02); /* Very faint green tint inside the card */
}

/* 3. Sync the Thumbnail Border */
.thumb-mini {
    width: 100px;
    height: 56px;
    object-fit: cover;
    border: 1px solid var(--border-color);
    transition: border-color 0.3s ease;
}

.card:hover .thumb-mini {
    border-color: var(--green); /* Thumbnail border lights up with the card */
}

/* 4. Sync the Button Glow */
.card:hover .btn-select {
    background: var(--green);
    color: #000;
    box-shadow: 0 0 12px var(--green); /* Matches your existing button hover */
}