/* style.css */

/*
  BountyNet Galactic - Stylesheet
  -------------------------------
  This file contains all custom styles for the BountyNet application.
  It utilizes CSS custom properties (variables) for theming and consistency.
  The design aims for a futuristic, cyberpunk aesthetic.
*/

/* --- Root Variables --- */
:root {
    --primary-color: #0a0a14; /* Deep space blue/black */
    --secondary-color: #141428; /* Darker interface elements */
    --accent-color-neon: #00ffff; /* Cyan - primary accent */
    --accent-color-hot: #ff00ff; /* Magenta - secondary accent */
    --accent-color-warning: #ffdd00; /* Bright Yellow - warnings, credits */
    --accent-color-critical: #ff3300; /* Red - high threat, errors */
    --accent-color-success: #00dd00; /* Bright Green - success, nominal status */
    --text-color: #f0f0f0; /* Primary text color (light) */
    --text-color-dark: #1a1a1a; /* Text on bright backgrounds (e.g., buttons) */
    --text-muted: #9090a0; /* Muted text, subtitles */
    --border-color: #404060; /* Borders, separators */
    --font-display: 'Orbitron', sans-serif; /* Titles, prominent text */
    --font-tech: 'Share Tech Mono', monospace; /* Technical readouts, status text */
    --font-body: 'Aldrich', sans-serif; /* General body text */
    --glitch-color1: rgba(0, 255, 255, 0.5); /* Cyan for glitch effect */
    --glitch-color2: rgba(255, 0, 255, 0.5); /* Magenta for glitch effect */
}

/* --- Global Resets & Base Styles --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--primary-color);
    color: var(--text-color);
    line-height: 1.7; /* Improved readability */
    overflow-x: hidden; /* Prevent horizontal scrollbars */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative; /* For pseudo-elements and absolute positioning */
}

/* --- Parallax Background Layers --- */
.parallax-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -10; overflow: hidden;
}
.parallax-layer {
    position: absolute;
    top: -10%; left: -10%;
    width: 120%; height: 120%;
    background-repeat: no-repeat;
    background-position: center center;
    /* REMOVE or COMMENT OUT this line if present: */
    /* transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94); */
    will-change: transform;
}

#parallax-layer-0 { /* Deepest, faintest, most spread out stars */
    background-image:
        radial-gradient(0.5px 0.5px at 10% 30%, rgba(200,200,255,0.2), transparent),
        radial-gradient(0.75px 0.75px at 70% 80%, rgba(180,180,230,0.15), transparent);
    background-size: 800px 800px, 1000px 1000px;
    background-repeat: repeat;
    /* z-index: -14; */
}

#parallax-layer-1 { /* Mid-deep, slightly larger/brighter, more dense */
    background-image:
        radial-gradient(1px 1px at 25% 25%, rgba(220,220,255,0.4), transparent),
        radial-gradient(0.75px 0.75px at 80% 60%, rgba(200,200,255,0.3), transparent),
        radial-gradient(1.2px 1.2px at 50% 75%, rgba(230,230,255,0.35), transparent);
    background-size: 500px 500px, 600px 600px, 500px 500px;
    background-repeat: repeat;
    /* z-index: -13; */
}

#parallax-layer-2 { /* Mid-ground, more distinct stars */
    background-image:
        radial-gradient(1.5px 1.5px at 20% 70%, rgba(240,240,255,0.7), transparent),
        radial-gradient(1px 1px at 60% 30%, rgba(220,220,255,0.6), transparent),
        radial-gradient(2px 2px at 85% 50%, white, transparent); /* A few brighter ones */
    background-size: 350px 350px, 400px 400px, 500px 500px;
    background-repeat: repeat;
    /* z-index: -12; */
}

#parallax-layer-3 { /* Foreground, could be larger "dust" or a very subtle grid */
    background-image:
        radial-gradient(2.5px 2.5px at 15% 45%, rgba(200,220,255,0.1), transparent), /* Faint, larger "dust" */
        radial-gradient(3px 3px at 75% 65%, rgba(180,200,230,0.08), transparent);
    background-size: 150px 150px, 200px 200px; /* More dense for foreground particles */
    background-repeat: repeat;
    opacity: 0.7; /* Adjust opacity for the layer */
    /* Or your grid:
    background-image:
        repeating-linear-gradient(transparent, transparent 49px, rgba(0, 255, 255, 0.03) 50px),
        repeating-linear-gradient(90deg, transparent, transparent 49px, rgba(0, 255, 255, 0.03) 50px);
    background-size: 50px 50px;
    opacity: 0.5;
    */
    /* z-index: -11; */
}

/* Optional: A very subtle nebula/color wash layer behind or between star layers */
/* This could be a new layer or combined with an existing one if it's just a color wash */
#parallax-layer-nebula-wash { /* Example, place it appropriately in z-index */
    background:
        radial-gradient(ellipse at 70% 30%, rgba(0, 100, 100, 0.05) 0%, transparent 70%),
        radial-gradient(ellipse at 30% 70%, rgba(100, 0, 100, 0.04) 0%, transparent 60%);
    background-size: 100vw 100vh; /* Cover viewport */
    background-repeat: no-repeat;
    /* z-index: -13; */ /* Example z-index */
}

/* --- Scanline & Noise Overlay --- */
body::after {
    content: "";
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    background:
        repeating-linear-gradient(transparent, transparent 1px, rgba(0, 255, 255, 0.02) 2px, rgba(0, 255, 255, 0.02) 3px), /* Horizontal scanlines */
        repeating-linear-gradient(90deg, rgba(255,0,255,0.01) 0px, rgba(255,0,255,0.01) 1px, transparent 1px, transparent 4px); /* Vertical noise */
    pointer-events: none; /* Allow clicks through overlay */
    z-index: 9990; /* Above parallax, below modals */
    animation: screen-flicker 20s infinite linear, noise 0.5s infinite steps(2);
}
@keyframes screen-flicker { /* Subtle opacity change for screen effect */
    0%, 100% { opacity: 0.9; }
    50% { opacity: 0.7; }
}
@keyframes noise { /* Shifting background for noise effect */
    0% { background-position: 0 0; }
    100% { background-position: 4px 4px; }
}

/* --- General Layout & Content Containers --- */
header, .main-container, footer {
    position: relative; /* Ensure z-index stacking works correctly */
    z-index: 1;
}
.container {
    width: 95%;
    max-width: 1400px; /* Max content width */
    margin: 0 auto; /* Center content */
    padding: 20px;
}
.main-container {
    flex-grow: 1; /* Allow main content to fill available vertical space */
}

/* --- Header Section --- */
header {
    background: linear-gradient(135deg, rgba(20, 20, 40, 0.85), rgba(10, 10, 20, 0.95));
    border-bottom: 3px solid var(--accent-color-neon);
    padding: 20px 0;
    margin-bottom: 40px;
    box-shadow: 0 0 25px var(--accent-color-neon), 0 0 10px var(--accent-color-hot) inset;
    text-align: center;
    position: relative; /* For corner borders */
}
/* Header corner accents */
header::before, header::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: var(--accent-color-neon);
    border-style: solid;
}
header::before { top: 10px; left: 10px; border-width: 3px 0 0 3px; } /* Top-left corner */
header::after { bottom: 10px; right: 10px; border-width: 0 3px 3px 0; } /* Bottom-right corner */

#site-title-container {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--accent-color-neon);
    text-shadow: 0 0 8px var(--accent-color-neon), 0 0 15px var(--accent-color-neon), 0 0 2px var(--text-color);
    letter-spacing: 3px;
    margin-bottom: 5px;
    position: relative; /* For glitch layer */
}
/* Glitch effect on title text */
.glitch-layer {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    overflow: hidden;
}
.glitch-layer span { /* Individual glitch text elements */
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0; /* Hidden by default */
}
#site-title-container:hover .glitch-layer span { animation: glitch-text 0.3s infinite; }
#site-title-container:hover .glitch-layer span:nth-child(1) { color: var(--glitch-color1); animation-delay: 0.01s; }
#site-title-container:hover .glitch-layer span:nth-child(2) { color: var(--glitch-color2); animation-delay: 0.02s; }

@keyframes glitch-text { /* Animation for text displacement and opacity */
    0%, 100% { transform: translate(0,0); opacity: 0.8; }
    25% { transform: translate(2px, -2px); }
    50% { transform: translate(-2px, 2px); opacity: 0.5; }
    75% { transform: translate(2px, 2px); }
}

.header-subtitle {
    font-family: var(--font-tech);
    color: var(--text-muted);
    font-size: 1rem;
    text-transform: uppercase;
}
.user-status {
    font-family: var(--font-tech);
    color: var(--accent-color-warning); /* Base color for the status line */
    font-size: 0.9rem;
    margin-top: 5px;
    letter-spacing: 1px;
}
.user-status span { color: var(--text-color); } /* Default color for status values */
#user-credits { color: var(--accent-color-warning); text-shadow: 0 0 5px var(--accent-color-warning); }
#secure-link-status { color: var(--accent-color-success) !important; } /* Override for secure status */
#userAliasDisplay { color: var(--text-color); font-weight: bold; }
#changeAliasLink {
    color: var(--accent-color-neon);
    text-decoration: none;
    font-size: 0.8em;
    margin-left: 5px;
    opacity: 0.7;
    transition: opacity 0.3s;
}
#changeAliasLink:hover { opacity: 1; text-decoration: underline; }


/* --- Bounty Board & Cards --- */
.bounty-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); /* Responsive grid */
    gap: 35px;
}
.bounty-card {
    background-color: var(--secondary-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0; /* Padding handled by inner elements */
    position: relative;
    overflow: hidden; /* For image container and banner */
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
                box-shadow 0.6s ease-in-out, border-color 0.6s ease-in-out;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5), 0 0 5px var(--border-color) inset;
    display: flex;
    flex-direction: column; /* Stack elements vertically */
}
.bounty-card:hover {
    transform: translateY(-10px) scale(1.03); /* Lift and scale effect */
    box-shadow: 0 10px 30px rgba(0,0,0,0.7), 0 0 25px var(--accent-color-neon), 0 0 15px var(--accent-color-hot) inset;
    border-color: var(--accent-color-neon);
}

/* Bounty Card Image */
.bounty-image-container {
    width: 100%;
    height: 250px;
    overflow: hidden;
    position: relative;
    border-bottom: 2px solid var(--border-color);
}
.bounty-mugshot {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensure image covers container */
    filter: grayscale(0.6) sepia(0.3) contrast(1.1) brightness(0.85);
    transition: transform 0.5s ease, filter 0.5s ease;
}
.bounty-card:hover .bounty-mugshot {
    transform: scale(1.1); /* Zoom effect on hover */
    filter: grayscale(0.2) sepia(0.1) contrast(1.2) brightness(1); /* Enhance image on hover */
}

/* Bounty Card Content Area */
.bounty-content {
    padding: 20px;
    position: relative;
    z-index: 1; /* Above any potential pseudo-elements of parent */
    background-color: var(--secondary-color); /* Ensure consistent background */
    flex-grow: 1; /* Allow content to fill card height */
    display: flex;
    flex-direction: column;
}
.bounty-card-header { margin-bottom: 15px; }
.bounty-card-header h2 {
    font-family: var(--font-display);
    color: var(--accent-color-neon);
    font-size: 2rem;
    margin: 0 0 5px 0;
    line-height: 1.1;
    font-weight: 700;
}
.bounty-card-header .alias {
    font-family: var(--font-tech);
    font-size: 1rem;
    color: var(--text-muted);
    font-style: italic;
}
.bounty-details {
    font-family: var(--font-tech);
    font-size: 0.95rem;
    margin-bottom: 15px;
    flex-grow: 1; /* Allow details to take available space */
}
.bounty-details p { margin-bottom: 10px; }
.bounty-details strong { color: var(--accent-color-neon); margin-right: 8px; }

/* Bounty Meta Information (Amount & Threat Level) */
.bounty-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto; /* Push to bottom of .bounty-content */
    gap: 10px; /* Space between amount and threat level */
}
.bounty-amount {
    font-family: var(--font-display);
    font-size: 2.2rem;
    color: var(--accent-color-warning);
    text-shadow: 0 0 8px var(--accent-color-warning);
    font-weight: 700;
    white-space: nowrap; /* Prevent wrapping */
    flex-shrink: 0; /* Prevent shrinking if threat level text is long */
}
.bounty-amount span { /* "CRD" unit */
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 5px;
}

/* Threat Level Indicators */
.threat-level {
    font-family: var(--font-display);
    font-size: 0.9rem;
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
}
.threat-low { background-color: var(--accent-color-success); color: var(--text-color-dark); }
.threat-medium { background-color: var(--accent-color-warning); color: var(--text-color-dark); } /* Not used in current HTML, but defined */
.threat-high {
    background-color: var(--accent-color-critical);
    color: var(--text-color);
    animation: pulse-warning 2s infinite ease-in-out;
}
.threat-extreme {
    background-color: var(--accent-color-hot);
    color: var(--text-color-dark);
    animation: pulse-critical 1.5s infinite ease-in-out;
}
@keyframes pulse-warning { /* Pulsing animation for high threat */
    0%, 100% { transform: scale(1); box-shadow: 0 0 5px var(--accent-color-critical); }
    50% { transform: scale(1.05); box-shadow: 0 0 15px var(--accent-color-critical); }
}
@keyframes pulse-critical { /* More intense pulsing for extreme threat */
    0%, 100% { transform: scale(1); box-shadow: 0 0 8px var(--accent-color-hot); }
    50% { transform: scale(1.08); box-shadow: 0 0 20px var(--accent-color-hot); }
}

/* Bounty Status Banner (Top Bar Style) */
.bounty-status-banner-top-bar {
    width: 100%; /* Full width of the bounty card */
    padding: 6px 10px;
    font-family: var(--font-display);
    font-size: 0.9rem;
    text-align: center;
    text-transform: uppercase;
    z-index: 2; /* Above image if there was overlap, now part of flow */
    border-bottom: 1px solid rgba(0,0,0,0.3); /* Separator */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* Subtle depth */
    font-weight: 700;
}
/* Status-specific banner styles */
.bounty-status-banner-top-bar.status-dead-or-dismembered {
    background-color: var(--accent-color-warning);
    color: var(--text-color-dark);
    border-bottom-color: var(--accent-color-warning); /* Match background for solid look */
}
.bounty-status-banner-top-bar.status-only-body-needed {
    background-color: var(--accent-color-critical);
    color: var(--text-color);
    border-bottom-color: var(--accent-color-critical);
}
.bounty-status-banner-top-bar.status-wanted-prefer-alive {
    background-color: var(--accent-color-critical); /* Could also be warning */
    color: var(--text-color);
    border-bottom-color: var(--accent-color-critical);
}
.bounty-status-banner-top-bar.status-alive-bonus-intact {
    background-color: var(--accent-color-neon);
    color: var(--text-color-dark);
    border-bottom-color: var(--accent-color-neon);
}

/* Bounty Card Actions (Buttons) */
.bounty-actions {
    margin-top: 20px;
    border-top: 1px dashed var(--border-color);
    padding-top: 20px;
    text-align: right; /* Align buttons to the right */
}
.bounty-actions .btn {
    border: 2px solid; /* Border color set by specific button type */
    padding: 12px 25px;
    font-family: var(--font-display);
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-left: 10px; /* Space between buttons if multiple */
    margin-bottom: 15px; /* Space below buttons */
}
.bounty-actions .btn-accept-contract {
    background-color: var(--accent-color-neon);
    color: var(--text-color-dark);
    border-color: var(--accent-color-neon);
}
.bounty-actions .btn-accept-contract:hover:not(:disabled) {
    background-color: transparent;
    color: var(--accent-color-neon);
    box-shadow: 0 0 15px var(--accent-color-neon);
}
.bounty-actions .btn.btn-accept-contract.processing {
    background-color: var(--accent-color-warning);
    color: var(--text-color-dark);
    border-color: var(--accent-color-warning);
    cursor: not-allowed;
}
.bounty-actions .btn.btn-accept-contract.processing::after { /* Ellipsis for processing state */
    content: " ...";
    animation: ellipsis 1.5s infinite;
}
.bounty-actions .btn.btn-accept-contract.contract-active {
    background-color: var(--accent-color-critical);
    color: var(--text-color);
    border-color: var(--accent-color-critical);
    cursor: default; /* Non-interactive when active */
}
.bounty-actions .btn.btn-accept-contract.contract-active:hover {
    box-shadow: 0 0 10px var(--accent-color-critical); /* Subtle glow on hover */
}
@keyframes ellipsis { /* Animation for processing indicator */
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60%, 100% { content: "..."; }
}
.bounty-actions .btn-dossier {
    background-color: transparent;
    color: var(--accent-color-hot);
    border-color: var(--accent-color-hot);
}
.bounty-actions .btn-dossier:hover {
    background-color: var(--accent-color-hot);
    color: var(--primary-color); /* Invert colors on hover */
    box-shadow: 0 0 15px var(--accent-color-hot);
}

/* --- Modals (Dossier, ToS, Alias) --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(10, 10, 20, 0.92); /* Dark, semi-transparent background */
    backdrop-filter: blur(12px) brightness(0.5); /* Frosted glass effect */
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 10000; /* Above all other content */
    opacity: 0;
    transition: opacity 0.4s ease;
}
.modal-overlay.active {
    display: flex; /* Show when active */
    opacity: 1;
}
.modal-content {
    background-color: var(--secondary-color);
    padding: 0; /* Padding handled by inner sections */
    border-radius: 10px;
    border: 2px solid var(--accent-color-neon);
    box-shadow: 0 0 40px var(--accent-color-neon), 0 0 60px var(--accent-color-hot); /* Neon glow */
    max-height: 90vh; /* Prevent modal from being too tall */
    position: relative;
    transform: scale(0.9); /* Initial state for entry animation */
    transition: transform 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28); /* Springy entry animation */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Clip content like rounded corners */
}
.modal-overlay.active .modal-content {
    transform: scale(1); /* Final state for entry animation */
    height: 95vh;
}
.modal-content h2 { /* Modal Title */
    font-family: var(--font-display);
    color: var(--accent-color-neon);
    font-size: 2.2rem;
    margin: 0;
    border-bottom: 1px solid var(--border-color);
    padding: 20px 30px;
    background-color: rgba(0,0,0,0.2); /* Slightly darker header background */
    flex-shrink: 0; /* Prevent header from shrinking */
}
.modal-content h3 { /* Subheadings within modal */
    font-family: var(--font-display);
    color: var(--accent-color-warning);
    font-size: 1.3rem;
    margin-top: 20px;
    margin-bottom: 10px;
}
.modal-content p, .modal-content ul {
    font-family: var(--font-tech);
    margin-bottom: 10px;
    line-height: 1.8; /* More spacious line height for readability */
}
.modal-content ul { list-style: none; padding-left: 0; }
.modal-content ul li {
    padding-left: 20px;
    position: relative;
    margin-bottom: 5px;
}
.modal-content ul li::before { /* Custom bullet point */
    content: '»';
    position: absolute;
    left: 0;
    color: var(--accent-color-neon);
}
.modal-close-btn {
    position: absolute;
    top: 15px; right: 20px;
    background: transparent;
    border: none;
    color: var(--accent-color-hot);
    font-size: 2.5rem;
    font-family: var(--font-tech); /* Consistent tech font */
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
    z-index: 10; /* Above modal content */
    line-height: 1; /* Ensure 'X' is centered if it's tall */
}
.modal-close-btn:hover {
    color: #ff33ff; /* Brighter magenta on hover */
    transform: rotate(90deg) scale(1.1);
}

/* Dossier Modal Specifics */
.dossier-modal-content { width: 90%; max-width: 1200px; }
#modalDossierContent { /* Container for dynamic dossier content, including tabs and panels */
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden; /* Important for layout */
}

/* Mobile Tab Menu for Dossier */
.dossier-modal-tabs-mobile {
    display: none; /* Hidden by default, shown on mobile via @media query */
    padding: 10px 15px 5px 15px; /* Reduced bottom padding */
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    gap: 10px; /* Space between tab buttons */
}
.dossier-tab-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 10px;
    font-family: var(--font-tech);
    font-size: 0.9rem;
    cursor: pointer;
    flex-grow: 1; /* Make buttons share space equally */
    text-align: center;
    border-radius: 4px;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
.dossier-tab-btn.active-tab {
    background-color: var(--accent-color-neon);
    color: var(--text-color-dark);
    border-color: var(--accent-color-neon);
    font-weight: bold;
}
.dossier-tab-btn:hover:not(.active-tab) {
    border-color: var(--accent-color-hot);
    color: var(--accent-color-hot);
}

/* Wrapper for dossier content (info and gallery panels) */
.dossier-modal-content-wrapper {
    display: flex; /* Side-by-side on desktop (info | gallery) */
    flex-grow: 1;
    overflow: hidden; /* Crucial for children's scrolling and layout */
    position: relative; /* Context for potential absolute positioning if needed */
}

/* Tab Panels (Info Column and Gallery Wrapper become tab panels) */
.dossier-tab-panel {
    /* On desktop, both are "visible" due to flex layout of parent.
       On mobile, one will be hidden based on active tab. */
}

/* .dossier-modal-layout is effectively replaced by .dossier-modal-content-wrapper */
/*
.dossier-modal-layout { /* Main layout for info and image columns * /
    display: flex;
    flex-grow: 1;
    padding: 0; /* No padding here, handled by columns * /
    overflow: hidden; /* Prevent internal scrollbars from affecting layout * /
}
*/

.dossier-modal-info-column { /* Textual information - now also a tab panel */
    flex: 3; /* Takes more space on desktop */
    padding: 20px 30px;
    overflow-y: auto; /* Scrollable if content exceeds height */
    scrollbar-width: thin; /* Firefox scrollbar styling */
    scrollbar-color: var(--accent-color-neon) var(--secondary-color);
}
/* Webkit scrollbar styling for info column */
.dossier-modal-info-column::-webkit-scrollbar { width: 8px; }
.dossier-modal-info-column::-webkit-scrollbar-track { background: var(--secondary-color); }
.dossier-modal-info-column::-webkit-scrollbar-thumb {
    background-color: var(--accent-color-neon);
    border-radius: 4px;
    border: 2px solid var(--secondary-color); /* Creates a "channel" effect */
}

/* Gallery Wrapper - acts as a tab panel and flex container for image/thumbnails */
.dossier-modal-gallery-wrapper {
    flex: 2; /* Takes up remaining space on desktop */
    display: flex;
    flex-direction: column; /* Stacks main image and thumbnails vertically */
    border-left: 1px solid var(--border-color); /* Desktop separator */
    background-color: rgba(0,0,0,0.1); /* Desktop background for gallery area */
    overflow: hidden; /* To contain its children properly */
}

.dossier-modal-image-column { /* Image display area - child of gallery-wrapper */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    flex-grow: 1; /* Allow main image area to take available vertical space in gallery wrapper */
    min-height: 0; /* Fix for flex item overflow if image is too tall, ensures it shrinks */
}
.dossier-main-image-display {
    width: 100%;
    /* max-height: 500px; /* Removed, let flexbox and parent constraints handle it */
    display: flex;
    align-items: center;
    justify-content: center;
}
#dossierMainImage {
    max-width: 100%;
    max-height: 63vh; /* Ensure entire image is visible within its container */
    object-fit: scale-down; 
    display: block;
    border: 2px solid var(--accent-color-neon);
    box-shadow: 0 0 15px var(--accent-color-neon);
    filter: grayscale(0.2) contrast(1.15) brightness(0.95); /* Subtle image enhancement */
}
.dossier-gallery-bottom { /* Thumbnail gallery - child of gallery-wrapper */
    display: flex;
    gap: 10px;
    flex-wrap: nowrap; /* Prevent wrapping, enable horizontal scroll */
    overflow-x: auto; /* Horizontal scroll for thumbnails */
    padding: 15px 30px;
    border-top: 1px solid var(--border-color);
    background-color: rgba(0,0,0,0.2);
    flex-shrink: 0; /* Prevent gallery from shrinking */
    scrollbar-width: thin; /* Firefox scrollbar */
    scrollbar-color: var(--accent-color-hot) var(--secondary-color);
}
/* Webkit scrollbar for thumbnail gallery */
.dossier-gallery-bottom::-webkit-scrollbar { height: 8px; }
.dossier-gallery-bottom::-webkit-scrollbar-track { background: var(--secondary-color); }
.dossier-gallery-bottom::-webkit-scrollbar-thumb { background-color: var(--accent-color-hot); border-radius: 4px; }

.dossier-gallery-bottom img { /* Individual thumbnails */
    width: 100px;
    height: 75px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    transition: border-color 0.3s ease, transform 0.3s ease, filter 0.3s ease;
    filter: grayscale(0.6) brightness(0.8); /* Desaturated by default */
    flex-shrink: 0; /* Prevent thumbnails from shrinking */
}
.dossier-gallery-bottom img:hover,
.dossier-gallery-bottom img.active-thumb { /* Hover and active states */
    border-color: var(--accent-color-hot);
    transform: scale(1.05);
    filter: grayscale(0) brightness(1); /* Full color and brightness */
}
/* Loading spinner for dossier modal */
.modal-loading { text-align: center; padding: 50px; }
.modal-loading h2 { font-size: 1.5rem; margin-bottom: 20px; }
.spinner {
    width: 50px; height: 50px;
    margin: 0 auto;
    border: 5px solid var(--border-color);
    border-top-color: var(--accent-color-neon); /* Animated part of spinner */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* Terms of Service Modal Specifics */
#tosModalContentWrapper { width: 90%; max-width: 800px; }
.tos-body-content { /* Main scrollable area for ToS */
    padding: 20px 30px;
    overflow-y: auto;
    flex-grow: 1;
}
.tos-text { /* Scrollable text container */
    max-height: 55vh; /* Limit height to encourage scrolling */
    overflow-y: auto;
    border: 1px solid var(--border-color);
    /* MODIFIED PADDING HERE */
    padding: 10px 25px; /* Was: padding: 15px; (Increased left/right padding) */
    margin-bottom: 20px;
    font-size: 0.9rem;
    background-color: rgba(0,0,0,0.2);
    scrollbar-width: thin; /* Firefox scrollbar */
    scrollbar-color: var(--accent-color-neon) var(--secondary-color);
}
/* Webkit scrollbar for ToS text */
.tos-text::-webkit-scrollbar { width: 8px; }
.tos-text::-webkit-scrollbar-track { background: var(--secondary-color); }
.tos-text::-webkit-scrollbar-thumb {
    background-color: var(--accent-color-neon);
    border-radius: 4px;
    border: 2px solid var(--secondary-color);
}
.tos-checkbox-container {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}
#tosAgreeCheckbox {
    margin-right: 12px;
    width: 22px; height: 22px; /* Larger checkbox */
    accent-color: var(--accent-color-neon); /* Custom color for checkbox */
    cursor: pointer;
    vertical-align: middle; /* Align with label text */
}
#tosModalContentWrapper label { /* Label for checkbox */
    font-family: var(--font-tech);
    cursor: pointer;
    vertical-align: middle;
}
.tos-actions { /* Container for agree button */
    padding: 10px 30px 20px 30px;
    border-top: 1px solid var(--border-color);
    background-color: rgba(0,0,0,0.2);
    flex-shrink: 0;
    text-align: center; /* Center the button */
}
.btn-agree { /* General agree button style (used in ToS and Alias modals) */
    background-color: var(--accent-color-warning);
    color: var(--text-color-dark);
    border: 2px solid var(--accent-color-warning);
    padding: 12px 25px;
    font-family: var(--font-display);
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 1rem;
    display: block; /* Make it a block to use margin:auto */
    width: fit-content; /* Size to content */
    margin: 0 auto; /* Center the button */
}
.btn-agree:disabled {
    background-color: var(--text-muted);
    border-color: var(--text-muted);
    cursor: not-allowed;
    color: var(--secondary-color);
}
.btn-agree:not(:disabled):hover {
    background-color: transparent;
    color: var(--accent-color-warning);
    box-shadow: 0 0 10px var(--accent-color-warning);
}

/* Alias Modal Specifics */
.alias-modal-content { width: 90%; max-width: 500px; text-align: center; }
.alias-modal-content h2 { font-size: 1.8rem; }
.alias-form { padding: 20px 30px; }
.alias-form label {
    display: block;
    font-family: var(--font-tech);
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: var(--accent-color-neon);
}
.alias-form input[type="text"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    background-color: var(--primary-color); /* Match body background */
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-family: var(--font-tech);
    font-size: 1rem;
    border-radius: 4px;
}
.alias-form input[type="text"]:focus {
    border-color: var(--accent-color-neon);
    box-shadow: 0 0 8px var(--accent-color-neon);
    outline: none;
}
.alias-form .btn-agree { margin-top: 10px; } /* Specific margin for alias form button */
.alias-note { /* Note below alias form */
    font-family: var(--font-tech);
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0 30px 20px 30px;
}


/* Contract Sequence Message Area (below bounty card actions) */
.contract-sequence-message {
    font-family: var(--font-tech);
    color: var(--accent-color-warning); /* Default color for sequence messages */
    margin-top: 10px;
    text-align: right;
    height: 20px; /* Reserve space to prevent layout shifts */
    font-size: 0.9em;
    transition: color 0.3s ease;
}
.contract-sequence-message.success {
    color: var(--accent-color-success); /* Green for success messages */
    font-weight: bold;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 50px;
    font-family: var(--font-tech);
    color: var(--text-muted);
    border-top: 2px solid var(--border-color);
    background: rgba(10,10,20,0.5); /* Semi-transparent background */
    font-size: 0.9rem;
}
footer p { margin-bottom: 5px; }
footer a { color: var(--accent-color-neon); text-decoration: none; }
footer a:hover { text-decoration: underline; text-shadow: 0 0 5px var(--accent-color-neon); }
.system-status {
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--accent-color-warning); /* Default for status line */
    letter-spacing: 1px;
}
.system-status .status-ok { color: var(--accent-color-success); }
.system-status .status-warn { color: var(--accent-color-warning); } /* Defined for potential use */
.system-status .status-error { color: var(--accent-color-critical); } /* Defined for potential use */

/* Sound Toggle Button */
.btn-sound-toggle {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    padding: 3px 8px;
    font-family: var(--font-tech);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 3px;
    margin-left: 10px;
    vertical-align: middle; /* Align with text if inline */
}
.btn-sound-toggle.sound-on {
    border-color: var(--accent-color-success);
    color: var(--accent-color-success);
}
.btn-sound-toggle.sound-off {
    border-color: var(--accent-color-critical);
    color: var(--accent-color-critical);
}
.btn-sound-toggle:hover { opacity: 0.8; }

/* --- Animations & Effects --- */
/* Class for final title text appearance (used by JS) */
.final-text-simple {
    /* No specific styles needed here if it's just for JS targeting,
       or if default title styles are sufficient. */
}
/* Staggered load-in animation for bounty cards */
@keyframes card-load-in {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Footer link effects (triggered by JS) */
/* Strong glitch effect for "Report Anomaly" */
body.glitch-effect-active::before { /* Uses body's ::before pseudo-element */
    content: "";
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 10001; /* Above scanlines, below modals if any are open */
    pointer-events: none;
    animation: strong-glitch 0.5s steps(3, end) forwards;
    background: repeating-linear-gradient(0deg, var(--glitch-color1) 0px, var(--glitch-color1) 5px, transparent 5px, transparent 10px),
                repeating-linear-gradient(90deg, var(--glitch-color2) 0px, var(--glitch-color2) 3px, transparent 3px, transparent 8px);
}
@keyframes strong-glitch {
    0% { opacity: 0.8; transform: translate(5px, -5px); }
    25% { opacity: 0.5; transform: translate(-5px, 5px); }
    50% { opacity: 0.9; transform: translate(3px, 3px); }
    75% { opacity: 0.4; transform: translate(-3px, -3px); }
    100% { opacity: 0; transform: translate(0,0); } /* End transparent and still */
}
/* Fade effect for "Purge Cache" */
body.fade-effect-active .main-container,
body.fade-effect-active header {
    animation: content-fade 0.7s ease-in-out forwards;
}
@keyframes content-fade {
    0% { opacity: 1; }
    50% { opacity: 0.3; filter: blur(2px); } /* Fade out and blur */
    100% { opacity: 1; filter: blur(0); } /* Fade back in and unblur */
}


/* --- Responsive Adjustments --- */
@media (max-width: 992px) { /* Tablet and smaller */
    .bounty-board { grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); }
    .dossier-modal-content { max-width: 95%; }
    /* .dossier-modal-layout { flex-direction: column; } /* REMOVED - Handled by new tab structure */

.dossier-modal-tabs-mobile {
    display: flex; /* Show tabs on mobile */
    flex-shrink: 0; /* Prevent tabs from shrinking if content is large */
}
.dossier-modal-content-wrapper {
    display: flex; /* Use flex for mobile to manage panel height */
    flex-direction: column; /* Stack panels (though only one is visible) */
    flex-grow: 1; /* Allow wrapper to take available vertical space */
    min-height: 0; /* Allow wrapper to shrink, crucial for child scrolling */
    overflow: hidden; /* Clip if necessary, though panels should handle scroll */
}
#dossierMainImage {
  max-height: 54vh;
}
.dossier-tab-panel {
    display: none; /* Hide all panels by default on mobile */
    flex-grow: 1; /* Allow the active panel to take all space in the wrapper */
    min-height: 0; /* Allow panel to shrink and enable internal scrolling */
    /* The panel itself will manage its overflow, e.g., .dossier-modal-info-column has overflow-y: auto */
}
.dossier-tab-panel.active-panel {
    display: flex; /* Make the active panel a flex container */
    flex-direction: column; /* Its children will stack (e.g. gallery items) or content will flow */
}

/* .dossier-modal-info-column.active-panel will inherit display:flex, flex-direction:column.
   Its own overflow-y:auto will then work within the constrained height. */

.dossier-modal-gallery-wrapper { /* This is also a .dossier-tab-panel */
    border-left: none;
    padding: 0;
    background-color: transparent;
    /* It already has display:flex, flex-direction:column from its base style,
       and will get flex-grow:1, min-height:0 from .dossier-tab-panel when active. */
}
     .dossier-gallery-bottom {
        padding: 10px 15px; /* Adjust padding for mobile thumbnails */
    }

    .dossier-main-image-display { max-height: 350px; } /* Keep this constraint for mobile */
    #tosModalContentWrapper { max-width: 95%; }
}

@media (max-width: 768px) { /* Mobile landscape and smaller */
    #site-title-container { font-size: 2.5rem; }
    .header-subtitle { font-size: 0.9rem; }
    .bounty-card { margin-bottom: 30px; } /* Ensure spacing if they stack */
    .bounty-image-container { height: 200px; }
    .bounty-card-header h2 { font-size: 1.8rem; }
    .bounty-amount { font-size: 2rem; }
    .modal-content h2 { font-size: 1.8rem; padding: 15px 20px; }
    .modal-close-btn { font-size: 2rem; top: 10px; right: 15px; }
    
    .dossier-modal-info-column { padding: 15px 20px; }
    /* .dossier-modal-image-column { padding: 15px; } /* Handled by 992px rule */
    .dossier-gallery-bottom { padding: 10px 15px; } /* Ensure consistency */
    .dossier-tab-btn { font-size: 0.85rem; padding: 6px 8px;}

    .tos-body-content { padding: 15px 20px; }
    .alias-modal-content { max-width: 90%; }
    .alias-modal-content h2 { font-size: 1.5rem; }
    .bounty-status-banner-top-bar { font-size: 0.8rem; padding: 5px 8px; }
}
@media (max-width: 480px) {
    #site-title-container { font-size: 2rem; } .bounty-board { grid-template-columns: 1fr; }
    .bounty-image-container { height: 180px; } .bounty-card-header h2 { font-size: 1.6rem; }
    .bounty-amount { font-size: 1.8rem; }
    .bounty-actions .btn { padding: 10px 15px; font-size: 0.9rem; display: block; margin: 10px 0 0 0; }
    .threat-level { font-size: 0.8rem; }

    .dossier-main-image-display { max-height: 250px; }
    .dossier-gallery-bottom img { width: 80px; height: 60px; }
    .dossier-tab-btn { font-size: 0.8rem; padding: 5px;}
    .dossier-modal-tabs-mobile { gap: 5px; padding: 8px 10px 5px 10px;}

    .modal-content h2 { font-size: 1.6rem; }
    .tos-text { font-size: 0.85rem; }
    .btn-agree { padding: 10px 20px; font-size: 0.9rem; }
    .user-status { font-size: 0.8rem; flex-direction: column; align-items: center; }
    .user-status > * { display: block; margin-bottom: 3px; }
    #changeAliasLink { margin-left: 0; }
    .bounty-status-banner-top-bar { font-size: 0.75rem; padding: 4px 6px; }
}