/* style.css - Modern Starfleet UI Theme */
:root {
    --bg-void: #030611;          /* Deep space black */
    --glass-bg: rgba(12, 19, 38, 0.45); /* Holographic transparent base */
    --text-primary: #e2ebf8;     /* Crisp starlight silver-white */
    --text-muted: #7184a3;       /* Subdued gray-blue terminal text */
    
    /* Neon LCARS Evolution Palette */
    --st-cyan: #00f0ff;          /* Science / Sensor arrays */
    --st-gold: #ffb700;          /* Operations / Engineering */
    --st-red: #ff3366;           /* Tactical / Alert states */
    --st-violet: #bc00dd;        /* Subspace Communications */
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-void);
    color: var(--text-primary);
    font-family: 'Segoe UI', Roboto, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    letter-spacing: 0.05em;
    background-image: 
        radial-gradient(circle at 80% 20%, rgba(0, 240, 255, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 10% 70%, rgba(255, 51, 102, 0.02) 0%, transparent 40%);
}

.starfleet-container {
    display: flex;
    min-height: 100vh;
}

/* --- Logo Placement Styling --- */
.st-logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 10px 20px 10px;
    width: 100%;
}

.st-logo {
    max-width: 100%;
    height: auto;
    max-height: 90px; /* Restricts the vertical growth on large displays */
    object-fit: contain;
    filter: drop-shadow(0 0 12px rgba(0, 240, 255, 0.15));
    transition: filter 0.3s ease;
}

.st-logo:hover {
    filter: drop-shadow(0 0 18px rgba(0, 240, 255, 0.35));
}

/* --- Left Vector Navigation Panel --- */
.st-sidebar {
    width: 280px;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(90deg, rgba(12,19,38,0.3) 0%, transparent 100%);
	flex-shrink: 0;
	overflow-y: auto !important;
    overflow-x: hidden !important;
}

.st-bracket-top, .st-bracket-bottom {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-muted);
    padding: 10px;
    border-left: 3px solid var(--text-muted);
}
.st-bracket-top { border-top: 3px solid var(--text-muted); border-top-left-radius: 8px; }
.st-bracket-bottom { border-bottom: 3px solid var(--text-muted); border-bottom-left-radius: 8px; }

.st-menu {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
    flex-grow: 1;
}

/* --- Modern Interactive UI Buttons --- */
.st-btn {
    display: block;
    text-decoration: none;
    padding: 14px 18px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
    border-left: 4px solid var(--text-muted);
    color: var(--text-primary);
}

.st-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateX(5px);
}

/* Contextual Borders per Sector */
.st-btn.nav-home { border-left-color: var(--st-cyan); }
.st-btn.nav-rpgx { border-left-color: var(--st-cyan); }
.st-btn.nav-holo { border-left-color: var(--st-cyan); }
.st-btn.nav-discord { border-left-color: var(--st-cyan); }
.st-btn.nav-admin { border-left-color: var(--text-muted); font-size: 0.75rem; opacity: 0.6; }
.st-btn.nav-sidebar { border-left-color: var(--st-gold); }
.st-btn.nav-roles { border-left-color: var(--st-red); }
.st-btn.nav-users { border-left-color: var(--st-violet); }

/* --- Viewscreen (Content Panel) --- */
.st-viewscreen {
    flex-grow: 1;
    padding: 40px 50px;
    display: flex;
    flex-direction: column;
	min-width: 0;
	overflow-x: hidden;
}

.st-header {
    position: relative;
    margin-bottom: 30px;
}

.st-header h1 {
    font-size: 2.2rem;
    font-weight: 300;
    text-transform: uppercase;
    margin: 10px 0 0 0;
    letter-spacing: 0.15em;
    text-shadow: 0 0 20px rgba(226, 235, 248, 0.2);
}

.header-line {
    height: 2px;
    background: linear-gradient(90deg, var(--st-cyan) 0%, rgba(0,240,255,0.1) 80%, transparent 100%);
    width: 100%;
}

.sector-tag {
    font-size: 0.7rem;
    color: var(--st-cyan);
    font-weight: bold;
    position: absolute;
    right: 0;
    top: -15px;
}

/* --- Holographic Glassmorphism Cards --- */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(113, 132, 163, 0.15);
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 0 !important;
    line-height: 1.7;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.division-panel {
    border-top: 3px solid var(--st-gold);
}

.division-panel h3 {
    margin-top: 0;
    font-size: 1.1rem;
    color: var(--st-gold);
    letter-spacing: 0.1em;
}

.manifest p {
    margin: 8px 0;
    font-size: 1.05rem;
}

.manifest .label {
    color: var(--text-muted);
    font-weight: bold;
    display: inline-block;
    width: 40px;
}

/* --- Modern Tactical Call to Action --- */
.action-download {
    display: inline-block;
    margin-top: 25px;
    padding: 15px 30px;
    background: transparent;
    color: var(--st-cyan);
    border: 1px solid var(--st-cyan);
    font-weight: bold;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.9rem;
    border-radius: 4px;
    letter-spacing: 0.1em;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
    transition: all 0.3s ease;
}

.action-download:hover {
    background: var(--st-cyan);
    color: var(--bg-void);
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.4);
    transform: translateY(-2px);
}

/* --- Trademark Footer --- */
.st-footer {
    margin-top: auto;
    padding-top: 30px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    border-top: 1px solid rgba(113, 132, 163, 0.1);
}

/* --- Form and Login Interface Additions --- */
.st-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.st-form textarea.st-input {
    min-height: 250px !important; /* Forces the box to be larger */
    resize: vertical;
}

.st-input {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--text-muted);
    border-radius: 4px;
    padding: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.st-input:focus {
    outline: none;
    border-color: var(--st-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
    background: rgba(12, 19, 38, 0.8);
}

.alert-box {
    background: rgba(255, 51, 102, 0.15);
    border-left: 4px solid var(--st-red);
    color: #ff88a3;
    padding: 12px;
    font-size: 0.85rem;
    font-weight: bold;
    border-radius: 0 4px 4px 0;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.st-btn.nav-violet { border-left-color: var(--st-cyan); }

/* --- Prominent Reworked Header Download Layout Deck --- */
.prominent-dl-deck {
    margin-top: 15px;
    display: flex;
    justify-content: flex-start;
}

.header-dl-btn {
    padding: 12px 35px !important;
    font-size: 0.95rem !important;
    border-radius: 4px !important;
    font-weight: 800 !important;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2) !important;
}

/* --- New Upper Hero Control Deck Layout --- */
.st-hero-deck {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.hero-left-wing {
    display: flex;
    align-items: center;
}

.hero-right-wing {
    display: flex;
    justify-content: flex-end;
}

/* --- Compact Upper Command Badge --- */
.command-top-badge {
    padding: 10px 20px !important;
    background: rgba(0, 0, 0, 0.4) !important;
    border-top: 2px solid var(--st-gold) !important;
    min-width: 240px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.command-top-badge .badge-title {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--st-gold);
    letter-spacing: 1px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.command-top-badge .badge-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.command-top-badge .b-lbl {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--st-cyan);
    font-weight: bold;
}

.command-top-badge .b-val {
    font-size: 0.85rem;
    color: #ffffff;
    font-weight: 600;
}

/* Master Layout Container */
/* Force the container to handle the full width shift */
.st-main-layout { display: flex; gap: 20px; }

/* When the sidebar is missing, force the layout-left to span full width */
.no-sidebar-layout {
    display: block !important; /* Removes flexbox rules */
}

.no-sidebar-layout .layout-left {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
}

/* Layout Weights */
.layout-left {
    flex: 2;
    max-width: 900px; /* Limits how wide the carousel gets */
    margin: 0 auto;   /* Centers the carousel within the layout */
}

.layout-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px; /* Consistent spacing between items */
    min-width: 300px;
}

.layout-right:empty {
    display: none;
}

/* --- Re-Proportioned Image Carousel Framework --- */
/* Container for the carousel */
.carousel-centering-wrapper {
    width: 100%;
    max-width: 800px; /* Limits width so it doesn't get 'too big' */
    margin: 20px auto; /* Centers it automatically */
}

/* Specific viewport sizing */
.st-carousel-viewport {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 250px; /* Reduced height to stop it from being too bulky */
    overflow: hidden;
    background-color: #000;
    position: relative; /* Essential for control positioning */
}

.st-carousel-track { display: flex; width: 100%; height: 100%; }

.st-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background-color: #000; /* Fallback */
}

/* The blurred, repeating background layer */
.st-slide::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: var(--slide-img);
    background-repeat: repeat-x;
    background-position: center;
    background-size: contain;
    filter: blur(20px); /* Adjust intensity here */
    opacity: 0.6;      /* Adjust how dark/noticeable the blur is */
    z-index: 1;
}

/* The clear, non-blurred image layer */
.st-slide::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: var(--slide-img);
    background-repeat: no-repeat; /* No repeat for the clear center */
    background-position: center;
    background-size: contain;
    z-index: 2;
}

.st-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.st-slide.active {
    opacity: 1;
    visibility: visible;
}

.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 15px;
    cursor: pointer;
    font-size: 24px;
    z-index: 10;
}

.carousel-control:hover {
    background: var(--st-cyan);
    color: #000;
    box-shadow: 0 0 12px var(--st-cyan);
}

.carousel-control.prev { left: 10px; }
.carousel-control.next { right: 10px; }

.st-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6); /* Semi-transparent glass */
    border: 1px solid rgba(0, 255, 255, 0.3); /* Cyan accent */
    color: var(--st-cyan); /* Matches your site's primary accent */
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

/* Positioning */
.st-carousel-btn.prev { left: 10px; }
.st-carousel-btn.next { right: 10px; }

/* Thematic Hover Effect */
.st-carousel-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: var(--st-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

/* Button Icon Size */
.st-carousel-btn svg {
    width: 20px;
    height: 20px;
}

.main-log-body {
    line-height: 1.5;
    font-size: 0.95rem;
	overflow: auto; /* Helps the container wrap its contents */
    padding: 20px;
}

/* Ensure images in the logs behave correctly */
.main-log-body img {
    max-width: 100%;       /* Prevents images from overflowing */
    height: auto;          /* Maintains aspect ratio */
    display: block;        /* Removes inline-block whitespace issues */
    margin: 15px auto;     /* Centers images nicely */
    #border-radius: 4px;    /* Optional: matches your glass aesthetic */
    #border: 1px solid rgba(0, 240, 255, 0.3); /* Subtle frame */
}

/* These classes are automatically added by Quill when you use the alignment tools */
.ql-align-center { text-align: center; }
.ql-align-justify { text-align: justify; }
.ql-align-right { text-align: right; }

/* --- Responsive Layout Corrections --- */
@media (max-width: 768px) {
    .st-hero-deck {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    .hero-right-wing {
        justify-content: flex-start;
    }
    .command-top-badge {
        width: 100%;
    }
    .st-carousel-viewport {
        height: 160px;
    }
}

/* =========================================================================
   MOBILE RESPONSIVE NAVIGATION OVERHAUL (SCREENS UNDER 992px)
   ========================================================================= */

/* Hide checkbox control */
.st-menu-toggle-input {
    display: none;
}

/* Hide mobile header completely on standard desktop layouts */
.st-mobile-bar {
    display: none;
}
.st-menu-backdrop {
    display: none;
}

@media (max-width: 992px) {
    /* Redefine grid container down to a clean, single scrollable block */
    .starfleet-container {
        display: block;
        padding-top: 60px; /* Leave space for the top header */
    }

    /* Fixed Top Menu Header Bar */
    .st-mobile-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 60px;
        background: #03060f;
        border-bottom: 2px solid var(--st-gold);
        padding: 0 20px;
        box-sizing: border-box;
        z-index: 9999;
        box-shadow: 0 4px 25px rgba(0,0,0,0.85);
    }

    .mobile-logo-zone {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .mobile-logo-zone img {
        height: 28px;
        width: auto;
    }

    .mobile-logo-zone span {
        font-family: monospace;
        font-weight: bold;
        color: var(--st-gold);
        letter-spacing: 1px;
        font-size: 0.9rem;
    }

    /* Standard Interactive Hamburger Symbol */
    .st-hamburger {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 24px;
        height: 16px;
        cursor: pointer;
    }

    .st-hamburger span {
        display: block;
        width: 100%;
        height: 2px;
        background: var(--st-cyan);
        border-radius: 2px;
        transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    /* --- Left Sliding Navigation Drawer --- */
    .st-sidebar {
        position: fixed !important; /* Forces it out of the document flow */
        top: 60px !important;       /* Aligns it below your header */
        left: -260px !important;    /* Starts it hidden off-screen */
        width: 260px !important;
        height: calc(100vh - 60px) !important;
        z-index: 9999 !important;   /* Stays above content */
        overflow-y: auto !important; /* Enables internal scroll for long menus */
        background: var(--bg-void) !important;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }
	
	.st-sidebar::-webkit-scrollbar {
        width: 6px;
    }
    .st-sidebar::-webkit-scrollbar-thumb {
        background: var(--st-cyan);
    }

    /* Hide standard brand block within mobile slide drawer */
    .st-logo-container {
        display: none;
    }

    /* Keep bracket graphics subtle inside the mobile menu drawer */
    .st-bracket-top, .st-bracket-bottom {
        font-size: 0.7rem;
        padding: 5px;
        margin: 5px 0;
        opacity: 0.7;
    }

    /* Container holding the links */
    .st-menu {
        padding-bottom: 50px; /* Space for the bottom bracket */
    }

    /* --- MOBILE BUTTON RESIZING (FIXES THE BLOCKS BEING TOO BIG) --- */
    /* --- FIXED MOBILE LINK SPECIFICITY DECK --- */
    body .starfleet-container .st-sidebar .st-menu .st-btn {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        
        /* OVERRIDE THE DESKTOP PADDING OVERFLOW BUTTON BUG */
        padding: 0 15px !important; /* 0px top/bottom removes the massive block appearance */
        
        height: 42px !important;
        min-height: 42px !important;
        width: 100% !important;
        font-size: 0.85rem !important;
        line-height: 1.2 !important;
        margin: 0 0 6px 0 !important;
        box-sizing: border-box !important;
        border-left: 4px solid rgba(255, 255, 255, 0.2) !important;
    }

    /* --- Translucent Blurred Backdrop --- */
     .st-menu-backdrop {
        position: fixed !important;
        top: 60px !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        z-index: 9990 !important;
    }

    /* --- Main Page Container Adjustments --- */
    .st-viewscreen {
        width: 100% !important;
        padding: 15px !important;
        box-sizing: border-box;
    }

    /* =========================================================================
       PURE CSS INTERACTIVE TOGGLE STATE LOGIC
       ========================================================================= */
    
    /* Slide the sidebar menu out smoothly when clicked */
    .st-menu-toggle-input:checked ~ .starfleet-container .st-sidebar {
        transform: translateX(260px);
    }

    /* Reveal the backdrop blur when menu is active */
    .st-menu-toggle-input:checked ~ .st-menu-backdrop {
        opacity: 1;
        visibility: visible;
    }

    /* Morph hamburger bars into a clean structural close 'X' */
    .st-menu-toggle-input:checked ~ .st-mobile-bar .st-hamburger span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
        background: var(--st-red);
    }

    .st-menu-toggle-input:checked ~ .st-mobile-bar .st-hamburger span:nth-child(2) {
        opacity: 0;
    }

    .st-menu-toggle-input:checked ~ .st-mobile-bar .st-hamburger span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
        background: var(--st-red);
    }

    /* Re-align structural layout grids for smaller viewports */
    .st-hero-deck {
    display: flex;
    flex-wrap: wrap; /* Allows the carousel to take its own row */
    gap: 15px;
}

    .hero-right-wing {
        justify-content: flex-start;
    }

    .command-top-badge {
        width: 100%;
    }

    .st-carousel-viewport {
        height: 150px; /* Keeps the top carousel compact on mobile web browsers */
    }
	
	.st-main-layout { flex-direction: column; }
    .layout-right { width: 100%; }
	
	/* Force inputs to fill the container, but never exceed it */
    input[type="text"], 
    input[type="number"], 
    input[type="email"],
    textarea, 
    select {
        width: 100% !important;
        max-width: 100% !important; /* Prevents overflow */
        padding: 10px !important;    /* Makes them easier to tap */
        box-sizing: border-box !important; /* Critical: includes padding in width */
        margin-bottom: 15px !important;
    }

    /* Ensure the form wrapper doesn't push the screen */
    form, .admin-form-container {
        width: 100% !important;
        overflow-x: hidden;
    }
}

.tox-notifications-container { display: none !important; }

/* 1. Editor container - matches your existing transparent background */
.tox.tox-tinymce {
	border: 1px solid rgba(0, 240, 255, 0.3) !important;
	background: rgba(0, 0, 0, 0.3) !important;
}

/* 2. Toolbar background */
.tox .tox-toolbar, .tox .tox-toolbar__overflow, .tox .tox-toolbar__primary {
	background: rgba(0, 0, 0, 0.4) !important;
}

/* 3. Toolbar buttons (make them white/grey to match) */
.tox .tox-tbtn { color: #fff !important; }
.tox .tox-tbtn:hover { background: rgba(0, 240, 255, 0.2) !important; }

/* 4. Dropdowns and Menus */
.tox .tox-menu { background: #1a1a1a !important; border: 1px solid #00f0ff !important; }
.tox .tox-collection__item { color: #fff !important; }
.tox .tox-collection__item:hover { background: rgba(0, 240, 255, 0.2) !important; }

/* 5. Status bar (remove the 'tiny' branding) */
.tox .tox-statusbar { display: none !important; }

.st-content a, 
.st-content a:visited, 
.st-content a:hover, 
.st-content a:active {
    color: var(--text-primary); 
    text-decoration: underline;
}