/**
 * /characterforge/css/global.css
 * Master CSS stylesheet for The Character Forge.
 * Contains global variables, resets, core typography, layout panels,
 * buttons, modals, scrollbars, and shared styles across the entire application.
 */

/* Import Fantasy Display Font */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&display=swap');

/* ==========================================================================
   THE FORGE: MASTER VARIABLES
   Change a color here, and the entire application updates instantly.
   ========================================================================== */
:root {
    /* Color Palette */
    --forge-bg: #121212;
    --forge-panel-bg: #1a1a1a;
    --forge-panel-border: #444444;
    --forge-text: #e0d8c0;
    --forge-muted: #888888;
    
    /* Accents */
    --forge-red: #8b0000;
    --forge-red-hover: #aa0000;
    --forge-gold: #ffaa00;
    --forge-gold-dim: #cc8800;
    
    /* Typography */
    --font-body: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-heading: 'Cinzel', serif;

    /* TTRPG / Character Forge Standard Variables */
    --parchment: #f4e7d3;
    --gold: #b8860b;
    --gold-bright: #ffd700;
    --panel-bg: #1a1a1a;
    --card-bg: #252525;
    --danger: #ff4444;
}

/* ==========================================================================
   BASE RESET & TYPOGRAPHY
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    background-color: var(--forge-bg);
    color: var(--forge-text);
    font-family: var(--font-body);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--forge-gold);
    margin-top: 0;
    font-weight: 700;
}

a {
    color: var(--forge-gold);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--forge-gold-dim);
    text-decoration: underline;
}

/* ==========================================================================
   GLOBAL LAYOUT & CONTAINERS
   ========================================================================== */
.forge-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Centers content vertically and horizontally - Great for Modals/Errors */
.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh; 
}

/* Standardized UI Panel (Used for stats, forms, and tools) */
.forge-panel {
    background: var(--forge-panel-bg);
    border: 1px solid var(--forge-panel-border);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: inset 0 0 20px #000;
}

/* ==========================================================================
   UI COMPONENTS (Buttons, Inputs, Badges)
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    font-family: var(--font-heading);
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background: var(--forge-red);
    color: #ffffff;
    border: 1px solid var(--forge-gold);
}

.btn-primary:hover {
    background: var(--forge-red-hover);
    box-shadow: 0 0 10px var(--forge-gold);
    color: #ffffff;
    text-decoration: none;
}

.btn:disabled, .btn-primary:disabled {
    background: #333;
    border-color: #555;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
}

/* High-Density TTRPG Form Inputs */
.forge-input {
    background: #0a0a0a;
    border: 1px solid var(--forge-panel-border);
    color: var(--forge-text);
    padding: 0.5rem;
    border-radius: 4px;
    font-family: var(--font-body);
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.forge-input:focus {
    outline: none;
    border-color: var(--forge-gold);
    box-shadow: 0 0 5px rgba(255, 170, 0, 0.5);
}

/* ==========================================================================
   SCROLLBARS (For high-density tables and lists)
   ========================================================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #111;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

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

/* ==========================================================================
   CONSOLIDATED CHARACTER FORGE SHARED STYLES
   ========================================================================== */

/* Denied Access Screen */
.denied-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60vh;
    text-align: center;
    padding: 20px;
}
.denied-wrapper h1 {
    font-family: 'Cinzel', serif;
    color: #ff4444;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.denied-wrapper p {
    font-size: 1.2rem;
    color: #ccc;
    margin-bottom: 30px;
}
.btn-action {
    background: linear-gradient(180deg, #b8860b 0%, #8b6508 100%);
    color: black;
    border: 1px solid #ffd700;
    padding: 12px 25px;
    font-family: 'Cinzel', serif;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1rem;
    transition: 0.2s;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}
.btn-action:hover {
    filter: brightness(1.2);
    transform: translateY(-2px);
}

/* Scenic & Navigation Buttons */
.btn-scenic, .btn-skip {
    font-family: 'Cinzel', serif;
    font-weight: bold;
    text-transform: uppercase;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
    letter-spacing: 1px;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}
.btn-scenic {
    background: linear-gradient(180deg, #b8860b 0%, #8b6508 100%);
    color: black;
    border: 1px solid #ffd700;
}
.btn-scenic:hover:not(:disabled) {
    box-shadow: 0 0 15px rgba(184, 134, 11, 0.4);
    filter: brightness(1.2);
    transform: translateY(-2px);
}
.btn-scenic:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}
.btn-skip {
    background: #111;
    color: #b8860b;
    border: 1px solid #b8860b;
}
.btn-skip:hover {
    background: #1a1a1a;
    color: #ffd700;
    border-color: #ffd700;
    transform: translateY(-2px);
}

/* Forge Custom Modals Overlay & Layouts */
.forge-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}
.forge-modal {
    background: #1a1a1a;
    border: 2px solid var(--gold);
    border-radius: 8px;
    width: 90%;
    max-width: 450px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    text-align: center;
}
.forge-modal h3 {
    color: var(--gold-bright);
    margin-top: 0;
    font-family: 'Cinzel', serif;
}
.forge-modal p {
    color: var(--parchment);
    margin: 20px 0;
    line-height: 1.5;
}
.modal-btn-group {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.btn-modal-confirm {
    background: var(--gold);
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    min-width: 100px;
}
.btn-modal-cancel {
    background: #333;
    color: #fff;
    border: 1px solid #555;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    min-width: 100px;
}

/* Standard Modals & Box Layouts */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.modal-overlay.active {
    display: flex;
    opacity: 1;
}
.modal-box {
    background: #0a0a0a;
    border: 2px solid #b8860b;
    border-radius: 8px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8), inset 0 0 15px rgba(184, 134, 11, 0.2);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}
.modal-overlay.active .modal-box {
    transform: scale(1);
}
.modal-title {
    font-family: 'Cinzel', serif;
    color: #b8860b;
    margin-top: 0;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}
.modal-text {
    font-family: 'Crimson Pro', serif;
    color: #f4e7d3;
    font-size: 1.2rem;
    line-height: 1.5;
    margin-bottom: 25px;
}
.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}
.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #b8860b;
    font-size: 1.5rem;
    cursor: pointer;
    transition: 0.2s;
}
.close-modal:hover {
    color: #ffd700;
    transform: scale(1.1);
}

/* Modal Content and Structure Defaults (Armory & Blacksmith) */
.modal-content {
    background: var(--panel-bg);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 25px;
    width: 90%;
    max-width: 600px;
    box-sizing: border-box;
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.2);
    position: relative;
}
.modal-body {
    margin: 20px 0;
    line-height: 1.5;
    max-height: 60vh;
    overflow-y: auto;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--forge-panel-border, #333);
    padding-top: 15px;
}

/* ==========================================================================
   ARMORY & EQUIPMENT SEARCH ITEM ROW
   Consistent layout for browsing items across Sheets, Forge, VTT, and DM tools
   ========================================================================== */
.armory-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-bottom: 1px solid #222;
    cursor: pointer;
    background: transparent;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    color: #fff;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
    border-radius: 4px;
}
.armory-search-item:hover {
    background: rgba(184, 134, 11, 0.12);
    border-bottom-color: rgba(184, 134, 11, 0.35);
}
.armory-search-thumb {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    max-width: 24px;
    max-height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--gold, #b8860b);
    background: #000;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.armory-search-item:hover .armory-search-thumb {
    transform: scale(1.15);
}
.armory-search-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.armory-search-name {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
    flex: 1;
    min-width: 0;
}
.armory-search-category {
    font-family: 'Crimson Pro', serif;
    font-size: 0.8rem;
    color: #a89b83;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    margin-left: auto;
    flex-shrink: 0;
    padding-left: 6px;
}
.armory-search-meta {
    font-size: 0.75rem;
    color: #888;
    margin-left: 8px;
    flex-shrink: 0;
    text-align: right;
    font-family: 'Crimson Pro', serif;
}

/* UI controls are not document links. Preserve article and journal anchor styling. */
button,button:hover,button:focus,[role=button],[role=button]:hover,
nav a,nav a:hover,.breadcrumbs a,.forge-footer a,
a.btn,a.button,a.action-link {text-decoration:none!important}
button.cf-vtt-reference,button.cf-value-button,[role=button][data-compendium] {border-bottom:0!important;text-decoration:none!important}
