@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@300;400;500;700&display=swap');

:root {
    /* De-saturated Discord Palette — matched to Updates */
    --bg-dark: #1d1e21;
    --panel-dark: #2b2d31;
    --panel-light: #313338;
    --text-main: #ced4d9;
    --text-muted: #949ba4;
    --gold: #a68a56;
    --oxblood: #ab4747;

    --global-font: 'Ubuntu', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --acad-font: 'Baskerville', 'Baskerville Old Face', 'Hoefler Text', 'Garamond', 'Georgia', serif;

    /* Sidebar width */
    --sidebar-width: 220px;

    /* Dynamic values set by JS */
    --status-bar-height: 105px;
}

/* --- 1. Base Setup --- */
* {
    box-sizing: border-box;
}

body {
    background-color: #1d1e21;
    font-family: var(--global-font);
    font-weight: 300;
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

textarea,
input,
select,
button {
    font-family: inherit;
}

#notes-text,
#bio-text,
.locked {
    font-family: 'Ubuntu', sans-serif !important;
    font-weight: 300 !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
}

body.fixed-screen {
    overflow: hidden;
    height: 100vh;
}

.container {
    background-color: var(--bg-dark);
    color: var(--text-main);
    width: calc(100% - var(--sidebar-width));
    max-width: none;
    margin: 0;
    margin-left: var(--sidebar-width);
    height: 100vh;
    padding: 20px 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border-radius: 0;
    display: flex;
    flex-direction: column;
}

.container-wide {
    /* Same as container, just a semantic class for admin views */
    width: calc(100% - var(--sidebar-width));
    /* Explicitly set width to avoid empty rule */
}

/* --- 2. Navigation & Headers --- */
/* Old top nav is replaced by sidebar.php — hide header/nav */
header {
    display: none !important;
}

header h1 {
    display: none !important;
}

nav:not(.sidebar-links) {
    display: none !important;
}

.nav-btn {
    text-decoration: none;
    color: var(--text-muted);
    text-transform: uppercase;
    font-family: var(--acad-font);
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 2px;
    padding: 10px 5px;
    transition: color 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Responsive nav font sizing for mobile */
@media screen and (max-width: 768px) {
    nav {
        gap: 12px;
    }

    .nav-btn {
        font-size: 10px;
        letter-spacing: 1px;
        padding: 8px 3px;
    }
}

@media screen and (max-width: 480px) {
    nav {
        gap: 6px;
    }

    .nav-btn {
        font-size: 9px;
        letter-spacing: 0.5px;
        padding: 8px 2px;
    }
}

@media screen and (max-width: 400px) {
    nav {
        gap: 4px;
    }

    .nav-btn {
        font-size: 8px;
        letter-spacing: 0px;
        padding: 8px 1px;
    }
}

.nav-btn:hover {
    color: var(--text-main);
}

.nav-btn.active {
    color: var(--gold);
    border-bottom: 2px solid var(--gold);
    margin-bottom: -1px;
}

/* --- 3. Labels & Form Inputs --- */
label,
.name-header {
    font-family: var(--acad-font) !important;
    font-size: 13px !important;
    color: var(--gold) !important;
    text-transform: uppercase !important;
    letter-spacing: 2px;
    font-weight: bold;
    display: block;
}

.name-header {
    font-size: 15px !important;
    margin: 0;
    text-transform: none !important;
    /* Allow mixed case for Greek accents */
}

textarea,
input[type="text"],
input[type="password"],
input[type="number"] {
    font-size: 14px;
    color: var(--text-main);
    background: var(--bg-dark) !important;
    border: 1px solid var(--panel-light);
    padding: 12px;
    border-radius: 4px;
    font-family: var(--global-font);
    width: 100%;
    resize: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold);
    outline: none;
}

.input-group {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.input-group textarea {
    flex: 1;
    min-height: 0;
}

textarea {
    flex: 1;
    min-height: 200px;
}

/* --- 4. Desktop Grid Layout --- */
.profile-box {
    background: var(--panel-dark);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #55575e;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.mid-grid-row {
    display: grid;
    grid-template-columns: 280px 1fr 1fr;
    gap: 20px;
    width: 100%;
    height: 100%;
}

.admin-pc-layout {
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 30px !important;
    /* Increased spacing between panels */
}

.admin-investigator-layout {
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 20px;
}

/* --- 5. Status Bar --- */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--panel-dark);
    padding: 16px 24px;
    border-radius: 12px;
    border: 1px solid #3f4147;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
}

.char-stats-row {
    display: flex;
    gap: 40px;
    align-items: center;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Editable stat inputs (admin only) */
.stat-input-unified:not([readonly]) {
    border-color: var(--gold);
    cursor: text;
    background: rgba(166, 138, 86, 0.05) !important;
}

.stat-input-unified:not([readonly]):hover {
    border-color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold);
}

/* --- 6. Skills Display --- */
.skills-container {
    border: 1px solid var(--panel-light);
    padding: 10px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.skill-row {
    padding: 10px 15px;
    background: #35373c;
    border-left: 4px solid var(--gold);
    border-radius: 6px;
    font-family: 'Ubuntu', sans-serif;
    font-weight: 400;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    cursor: grab;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.skill-row:active {
    cursor: grabbing;
}

.skill-row:hover {
    transform: translateX(2px);
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.3);
}

.skill-name {
    flex: 1;
}

/* Skill Move Button (Mobile Only) */
.skill-move-btn {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 6px 8px;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-left: 10px;
    min-width: 32px;
    min-height: 32px;
}

.skill-move-btn:hover,
.skill-move-btn:active {
    background: rgba(166, 138, 86, 0.15);
    transform: translateX(2px);
}

.skill-move-btn svg {
    width: 12px;
    height: 12px;
}

.skill-move-btn[disabled],
.skill-move-btn.pinned-btn {
    cursor: default !important;
    opacity: 1;
}

.skill-move-btn[disabled]:hover,
.skill-move-btn.pinned-btn:hover {
    background: transparent;
    transform: none;
    box-shadow: none;
    cursor: default;
}

.sortable-ghost {
    opacity: 0.4;
}

/* --- 7. Mobile Tabs --- */
.mobile-tabs {
    display: none;
}

/* Player Move Button - visible on both mobile and desktop */
.player-move-btn {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 6px 8px;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    min-width: 32px;
    min-height: 32px;
    flex-shrink: 0;
    margin-right: 10px;
}

.player-move-btn:hover,
.player-move-btn:active {
    background: rgba(166, 138, 86, 0.15);
    transform: translateY(-2px);
}

.player-move-btn svg {
    width: 12px;
    height: 12px;
}

/* --- 8. Utilities --- */
.hide-on-desktop {
    display: none !important;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-thumb {
    background: var(--panel-light);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

/* --- 9. Admin Messages --- */
.admin-message {
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-family: var(--global-font);
    font-size: 13px;
    text-align: center;
}

.admin-message.success {
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid rgba(76, 175, 80, 0.4);
    color: #81c784;
}

.admin-message.error {
    background: rgba(171, 71, 71, 0.15);
    border: 1px solid var(--oxblood);
    color: var(--oxblood);
}

/* --- 10. Buttons --- */
button {
    font-family: var(--acad-font);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 12px;
    font-weight: bold;
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--gold);
    padding: 10px 18px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

button:hover {
    background: rgba(166, 138, 86, 0.15);
    color: #fff;
}

.discreet-save-btn {
    display: inline-block;
    font-family: var(--acad-font);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 11px;
    font-weight: bold;
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--gold);
    padding: 6px 14px;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.discreet-save-btn:hover {
    background: rgba(166, 138, 86, 0.15);
    color: #fff;
}

/* --- 10. Special Layouts --- */
.dossier-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.dossier-layout button {
    margin-top: auto;
}

/* Desktop Player Row Styling */
.player-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.player-info {
    flex: 1;
}

.player-name-line {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}

.player-character-name {
    font-size: 15px;
    font-family: 'Ubuntu', sans-serif;
    font-weight: bold;
    color: var(--text-main);
}

.player-username {
    font-size: 12px;
    color: var(--gold);
    opacity: 0.7;
    font-family: monospace;
}

.player-stats-line {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    color: var(--text-main);
    font-weight: normal;
}

.player-review-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Save Indicator */
.save-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 11px;
    font-family: var(--acad-font);
    text-transform: uppercase;
    letter-spacing: 1px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10000;
}

.save-indicator.saving {
    background: var(--panel-light);
    color: var(--text-main);
    opacity: 1;
}

.save-indicator.saved {
    background: rgba(166, 138, 86, 0.2);
    color: var(--gold);
    opacity: 1;
}

.save-indicator.error {
    background: rgba(171, 71, 71, 0.2);
    color: var(--oxblood);
    opacity: 1;
}

/* Mobile Footer */
.mobile-footer {
    display: none;
}

/* Hide on Mobile utility */
.hide-on-mobile {
    display: block;
}

/* ====================================================================
   RESPONSIVE DESIGN
   ==================================================================== */

/* --- TABLETS (Merged into Mobile View) --- */
/* 
@media screen and (min-width: 601px) and (max-width: 1024px) {
    .container {
        padding: 15px 20px;
    }

    .mid-grid-row {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .mid-grid-row>.input-group:first-child {
        grid-column: 1 / -1;
    }

    .admin-pc-layout {
        grid-template-columns: 1fr 1fr !important;
    }

    header h1 {
        font-size: 1.5em;
        letter-spacing: 4px;
    }
} 
*/

/* --- MOBILE & TABLET (up to 1366px) --- */
@media screen and (max-width: 1366px) {

    /* Sidebar is a drawer on mobile — reset container offset */
    .container,
    .container-wide {
        width: 100% !important;
        margin-left: 0 !important;
    }

    /* Hide labels on mobile since we have tabs */
    .hide-on-mobile {
        display: none !important;
    }

    /* Show mobile-only elements */
    .hide-on-desktop {
        display: flex !important;
    }

    /* FIXED screen on mobile - Use 100dvh to fix iOS scroll bounce */
    body.fixed-screen {
        overflow: hidden;
        height: 100dvh;
        position: fixed;
        width: 100%;
    }

    .container {
        width: 100%;
        margin: 0;
        border-radius: 0;
        padding: 10px;
        padding-top: 60px;
        /* Space for mobile header bar */
        height: 100dvh;
        /* Fill entire viewport */
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    /* --- HEADER & NAV (Fixed at top) --- */
    header {
        flex-shrink: 0;
    }

    header h1 {
        font-size: 1.3em;
        letter-spacing: 3px;
        margin: 5px 0;
    }

    nav {
        gap: 20px;
        flex-shrink: 0;
    }

    .news-action-btn,
    .icon-btn {
        font-size: 0.75em;
        padding: 4px;
        width: 28px;
        height: 28px;
    }

    .nav-btn {
        font-size: 11px;
        padding: 8px 3px;
    }

    /* Status Bar */
    .status-bar {
        flex-shrink: 0;
        z-index: 1000;
        background: var(--bg-dark);
        flex-direction: column;
        padding: 10px;
        gap: 10px;
        margin-bottom: 0;
        border-radius: 0;
    }

    .char-stats-row {
        justify-content: space-between;
        width: 100%;
        gap: 5px;
    }

    .news-post-actions {
        flex-direction: row;
        gap: 5px;
    }

    .stat-item {
        flex: 1;
        flex-direction: column;
        gap: 2px;
        text-align: center;
    }

    .stat-item label {
        font-size: 10px !important;
    }

    .name-display {
        width: 100%;
        text-align: center;
    }

    /* Mobile Tabs */
    .mobile-tabs {
        display: flex;
        justify-content: space-around;
        background: var(--bg-dark);
        border-bottom: 1px solid var(--panel-light);
        z-index: 999;
        padding: 10px 0;
        flex-shrink: 0;
    }

    .tab-link {
        color: var(--text-muted);
        font-size: 11px;
        text-decoration: none;
        font-family: var(--acad-font);
        text-transform: uppercase;
        letter-spacing: 1px;
        padding: 5px 10px;
        transition: color 0.2s ease;
    }

    .tab-link.active {
        color: var(--gold);
        border-bottom: 2px solid var(--gold);
    }

    /* --- CAROUSEL AREA (Fills Remaining Space) --- */
    /* This section grows to fill whatever space is left (flex: 1) */
    /* This fixes the "Grey Space" issue */
    .profile-box,
    .admin-forms-wrapper {
        flex: 1;
        /* Grow to fill space */
        min-height: 0;
        /* Crucial for scrolling children */
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding: 0;
        /* Remove padding here, handle in child */
        border-radius: 0;
    }

    /* Common Horizontal Carousel Logic */
    .mid-grid-row,
    .admin-pc-layout,
    .admin-investigator-layout {
        display: flex !important;
        flex-direction: row !important;
        /* Forces horizontal layout */
        flex: 1;
        height: 100%;
        /* Fill the profile-box */
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        gap: 0 !important;
        scrollbar-width: none;
    }

    /* Hide horizontal scrollbar */
    .mid-grid-row::-webkit-scrollbar,
    .admin-pc-layout::-webkit-scrollbar,
    .admin-investigator-layout::-webkit-scrollbar {
        display: none;
    }

    /* Individual Slides (Input Groups / Admin Panels) */
    .mid-grid-row>.input-group,
    .admin-pc-layout>.profile-box,
    .admin-investigator-layout>.input-group,
    .admin-form-panel {
        flex: 0 0 100% !important;
        /* Force full width */
        min-width: 100%;
        height: 100%;
        /* Fill the carousel height */
        scroll-snap-align: start;
        scroll-snap-stop: always;
        padding: 15px !important;
        box-sizing: border-box;
        overflow-y: auto !important;
        /* Vertical scrolling INSIDE the slide */
        display: flex;
        flex-direction: column;
    }

    /* --- CONTENT ELEMENTS --- */

    /* Inputs/Textareas fill their slide space */
    textarea,
    .skills-container {
        height: auto !important;
        flex: 1;
        /* Grow to fill the slide */
        min-height: 200px !important;
        /* Minimum comfortable size */
        margin-bottom: 10px;
    }

    /* Ensure scrolling works inside these elements */
    textarea,
    .skills-container {
        scrollbar-width: thin;
        scrollbar-color: var(--gold) var(--panel-dark);
    }

    input[type="text"],
    input[type="password"],
    input[type="number"] {
        font-size: 16px !important;
        /* Prevents iOS zoom */
        margin-bottom: 10px;
    }

    /* --- LEDGER FIXES (Long Names) --- */

    /* Admin Ledger Spacing */
    body:has(#investigator-list) .profile-box {
        padding-bottom: 0;
    }

    .player-row {
        padding: 12px 10px !important;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    /* Text Truncation Logic */
    .player-info {
        flex: 1;
        min-width: 0;
        /* Allows shrinking below content size */
        overflow: hidden;
    }

    .player-name-line {
        display: flex;
        align-items: baseline;
        gap: 6px;
        margin-bottom: 4px;
        flex-wrap: nowrap;
        /* Keep on one line */
    }

    .player-character-name {
        font-size: 13px;
        font-weight: bold;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        /* Adds '...' if too long */
        max-width: 100%;
    }

    .player-username {
        font-size: 10px;
        color: var(--gold);
        opacity: 0.7;
        flex-shrink: 0;
        /* Do not squash the username */
    }

    .player-stats-line {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Review Button & Move Button */
    .player-review-btn {
        font-size: 9px !important;
        padding: 6px 10px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .skill-move-btn,
    .player-move-btn {
        min-height: 40px;
        min-width: 40px;
        padding: 8px;
    }

    /* Buttons */
    button,
    .discreet-save-btn {
        min-height: 44px;
        /* iOS tap target */
        margin-bottom: 5px;
        /* Spacing in stacked forms */
    }

    /* Save indicator */
    .save-indicator {
        top: 10px;
        right: 10px;
        font-size: 10px;
    }

    .mobile-footer {
        display: block;
        height: 1px;
        background: transparent;
    }
}

/* --- EXTRA SMALL PHONES (up to 375px) --- */
@media screen and (max-width: 375px) {
    header h1 {
        font-size: 1.1em;
        letter-spacing: 2px;
    }

    .nav-btn {
        font-size: 10px;
        gap: 15px;
    }

    .tab-link {
        font-size: 10px;
        padding: 5px 8px;
    }
}

/* ====================================================================
   PRINT STYLES
   ==================================================================== */
@media print {
    body {
        background: white !important;
        color: black !important;
    }

    .container {
        box-shadow: none !important;
        border: none !important;
        max-width: 100% !important;
        padding: 0 !important;
    }

    .no-print,
    .mobile-tabs,
    nav,
    button,
    .skill-move-btn,
    .discreet-save-btn {
        display: none !important;
    }
}

/* ====================================================================
   FIX: MOBILE CAROUSEL SCROLLING
   ==================================================================== */
@media screen and (max-width: 600px) {

    /* 1. Force the container to be a horizontal filmstrip */
    .mid-grid-row {
        display: flex !important;
        flex-direction: row !important;
        /* Forces panels side-by-side */
        flex-wrap: nowrap !important;
        /* Prevents panels from dropping to next line */
        overflow-x: auto !important;
        /* Allows the horizontal "slide" */
        scroll-snap-type: x mandatory;
        /* Makes it snap into place like an app */
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        gap: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    /* 2. Force each panel to take up exactly 100% of the screen width */
    .mid-grid-row>.input-group,
    .mid-grid-row>.admin-form-panel {
        flex: 0 0 100% !important;
        /* Do not grow, do not shrink, stay 100% wide */
        width: 100% !important;
        scroll-snap-align: start;
        /* Critical for the snapping effect */
        padding: 20px !important;
        box-sizing: border-box;
        height: auto;
        overflow-y: auto;
        /* Allow the panel itself to scroll up/down if long */
    }

    /* 3. Hide the scrollbar for a cleaner look */
    .mid-grid-row::-webkit-scrollbar {
        display: none;
    }

    .mid-grid-row {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    /* 4. Ensure the tabs are visible and look like buttons */
    .mobile-tabs {
        display: flex !important;
        justify-content: space-around;
        background: var(--panel-dark);
        border-bottom: 1px solid var(--panel-light);
        padding: 10px 0;
    }

    .tab-link {
        color: var(--text-muted);
        text-decoration: none;
        font-size: 13px;
        text-transform: uppercase;
        font-weight: bold;
        padding: 5px 10px;
    }

    .tab-link.active {
        color: var(--gold);
        border-bottom: 2px solid var(--gold);
    }
}

/* Edit Mode Toggle Styles */

/* Discreet Edit Button */
.edit-wrapper {
    position: relative;
}

.edit-toggle-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: transparent;
    border: none;
    color: var(--gold);
    font-size: 14px;
    /* Tiny and discreet */
    cursor: pointer;
    z-index: 20;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.edit-toggle-btn:hover {
    opacity: 1;
}

/* Textarea state when locked */
textarea.locked {
    background: rgba(0, 0, 0, 0.05) !important;
    border-color: transparent !important;
    color: var(--text-muted);
    cursor: default;
}

textarea:not(.locked) {
    border-color: var(--gold) !important;
    background: var(--panel-light) !important;
}

/* Pinned Skill visual distinction (Optional, minimal) */
.skill-row.pinned-skill {
    /* Kept similar style as requested, maybe just non-draggable cursor override */
    cursor: default;
}

.skill-row.pinned-skill:active {
    cursor: default;
}

/* --- 11. News UI Improvements --- */

/* Announcement Row (Input + Add Button) */
.announcement-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    background: var(--panel-light);
    padding: 10px 15px;
    border-left: 4px solid var(--gold);
    border-radius: 4px;
}

/* Base Announcement Style */
.news-announcement-input {
    flex: 1;
    background: transparent;
    border: none;
    font-family: var(--global-font);
    font-size: 1.1em;
    color: var(--text-muted);
    font-style: italic;
    padding: 5px;
    outline: none;
}

.news-announcement-input:not(:read-only) {
    border-bottom: 1px solid var(--gold);
    background: rgba(0, 0, 0, 0.1);
}

/* Icon Buttons */
.icon-btn {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: var(--gold);
    color: var(--bg-dark);
}

.icon-btn.delete-btn {
    border-color: var(--oxblood);
    color: var(--oxblood);
}

.icon-btn.delete-btn:hover {
    background: var(--oxblood);
    color: #fff;
}

/* Add Article Button */
.add-article-btn {
    font-size: 1.5em;
    width: 40px;
    height: 40px;
}

/* Full Screen Overlay */
.news-overlay {
    display: none;
    position: fixed;
    top: 60px;
    /* Below Nav */
    left: 0;
    width: 100%;
    height: calc(100% - 60px);
    background: transparent;
    z-index: 2000;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20px;
}

.news-overlay.active {
    display: flex;
}

.news-overlay-content {
    background: var(--panel-dark);
    width: 90%;
    max-width: 800px;
    max-height: 90%;
    overflow-y: auto;
    border: 1px solid var(--gold);
    padding: 30px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.close-overlay-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 2em;
    cursor: pointer;
    line-height: 0.5;
    padding: 5px;
}

/* PDF Download Button */
/* (Old large button removed/replaced) */

.news-post-file {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--panel-light);
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 15px;
    gap: 15px;
}

/* News Post Image - Thumbnail Preview */
.news-post-image {
    margin-bottom: 15px;
    display: inline-block;
}

.news-post-image img {
    max-width: 150px;
    max-height: 150px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--panel-light);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.news-post-image img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Selected Files List (Create Form) */
.selected-files-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.selected-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(166, 138, 86, 0.15);
    border: 1px solid var(--gold);
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 0.85em;
    color: var(--gold);
}

.selected-file-item span {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selected-file-item button {
    background: transparent;
    border: none;
    color: var(--oxblood);
    font-size: 1.2em;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.selected-file-item button:hover {
    color: #ff4444;
}

.pdf-icon {
    color: var(--oxblood);
}

.pdf-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pdf-filename {
    font-family: var(--global-font);
    color: var(--gold);
    font-size: 0.95em;
    word-break: break-all;
}

.pdf-download-btn-small {
    display: inline-block;
    font-family: var(--acad-font);
    font-size: 0.8em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.pdf-download-btn-small:hover {
    color: var(--gold);
    text-decoration: underline;
}

/* News Header Layout */
.news-post-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.news-post-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.news-post-subtitle {
    margin: 0;
}

/* --- COLLAPSIBLE NEWS --- */
.news-post-header {
    cursor: pointer;
    transition: margin-bottom 0.3s ease;
}

.news-post-body {
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    opacity: 1;
    overflow: hidden;
}

.news-post.collapsed .news-post-body {
    display: none;
    opacity: 0;
}

.news-post.collapsed .news-post-header {
    border-bottom: none;
    margin-bottom: 0;
}

/* ====================================================================
   CAST PAGE MOBILE RESPONSIVE FIXES
   ==================================================================== */

/* Mobile actions container - hidden on desktop, shown on mobile when expanded */
.cast-mobile-actions {
    display: none;
}

@media screen and (max-width: 768px) {

    /* Hide upload buttons on mobile in the header */
    .cast-upload-btn {
        display: none !important;
    }

    /* Hide admin-specific mail button in header (admin will see mail in expanded area for all users) */
    .cast-admin-mail-btn {
        display: none !important;
    }

    /* Show mobile actions in expanded body */
    .cast-mobile-actions {
        display: flex;
        gap: 10px;
        padding: 15px;
        border-bottom: 1px solid #55575e;
        background: rgba(0, 0, 0, 0.15);
        flex-wrap: wrap;
        justify-content: center;
    }

    .cast-mobile-action-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        background: transparent;
        border: 1px solid var(--gold);
        color: var(--gold);
        padding: 12px;
        border-radius: 4px;
        cursor: pointer;
        transition: all 0.2s;
        text-decoration: none;
        width: 48px;
        height: 48px;
    }

    .cast-mobile-action-btn:hover,
    .cast-mobile-action-btn:active {
        background: rgba(166, 138, 86, 0.15);
        transform: scale(1.05);
    }

    .cast-mobile-action-btn svg {
        width: 20px;
        height: 20px;
    }

    /* Hide text labels on mobile buttons */
    .cast-mobile-action-btn span {
        display: none;
    }

    /* Ensure character name is visible on mobile by giving it more space */
    .cast-card-header {
        padding: 14px 12px;
    }

    .cast-info {
        flex: 1;
        min-width: 0;
        margin-right: 10px;
    }

    .cast-character-name {
        font-size: 14px;
    }

    .cast-first-skill {
        font-size: 11px;
    }
}