/* ==========================================================================
   INDUSTRIAL DESIGN SYSTEM & VARIABLE THEMES
   ========================================================================== */
:root {
    --bg-dark: #0f0f0f;
    --panel-bg: #1a1a1a;
    --accent-orange: #f39c12; /* High-vis safety orange */
    --accent-blue: #5dade2;   /* Blueprint ink */
    --border-color: #2c2c2c;
    --text-main: #e0e0e0;
    --text-muted: #777777;
    
    /* Customization Shadows & Glows */
    --panel-glow: 0 0 15px rgba(243, 156, 18, 0.05);
    --panel-glow-active: 0 0 25px rgba(243, 156, 18, 0.25);
    
    /* Default Grid Canvas Settings */
    --grid-size: 20px;
}

/* Optional Class Theme Overrides for Designing Your Own Space */
.theme-blueprint {
    --bg-dark: #0a192f;
    --panel-bg: #0f2647;
    --accent-orange: #00f0ff; /* Electric blueprint cyan */
    --border-color: #1b3d6c;
}

.theme-graphite {
    --bg-dark: #1e1e1e;
    --panel-bg: #2d2d2d;
    --accent-orange: #e74c3c; /* Fire engine red */
    --border-color: #3f3f3f;
}

/* ==========================================================================
   CORE RESET & CUSTOM SCROLLBARS
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Courier New', Courier, monospace; /* Blueprint typewriter font */
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    transition: background-color 0.3s ease;
}

/* Custom Rugged Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #111111;
    border-left: 1px solid var(--border-color);
}
::-webkit-scrollbar-thumb {
    background: #333333;
    border: 2px solid #111111;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-orange);
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   🚧 CREW GATE (login.html Overlay)
   ========================================================================== */
.portal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(10, 10, 10, 0.95);
    background-image: 
        radial-gradient(circle, #222 1px, transparent 1px),
        repeating-linear-gradient(45deg, #151515, #151515 10px, #101010 10px, #101010 20px); 
    background-size: var(--grid-size) var(--grid-size), 40px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.portal-card {
    background: var(--panel-bg);
    border: 2px solid var(--accent-orange);
    border-radius: 4px;
    width: 100%;
    max-width: 400px;
    padding: 35px 30px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8), var(--panel-glow);
    position: relative;
    overflow: hidden;
}

/* Corner Bracket Accents for a drafting board aesthetic */
.portal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 15px;
    height: 15px;
    border-top: 3px solid var(--accent-orange);
    border-left: 3px solid var(--accent-orange);
}

.portal-logo {
    display: block;
    max-width: 150px;
    height: auto;
    margin: 0 auto 20px auto;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6));
}

.portal-header {
    text-align: center;
    margin-bottom: 25px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 20px;
}

.portal-header h2 {
    color: var(--accent-orange);
    font-size: 1.4rem;
    margin-bottom: 5px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.portal-header p {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 2px;
}

.portal-body form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: bold;
    letter-spacing: 1px;
}

.input-group input {
    background: #121212;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 14px;
    font-family: inherit;
    font-size: 0.95rem;
    border-radius: 3px;
    transition: all 0.2s ease-in-out;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-orange);
    background: #161616;
    box-shadow: 0 0 10px rgba(243, 156, 18, 0.15);
}

.portal-btn {
    background: var(--accent-orange);
    color: #000;
    border: none;
    padding: 15px;
    font-weight: bold;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.portal-btn:hover {
    background: #e08e0b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.portal-footer {
    margin-top: 25px;
    text-align: center;
    font-size: 0.8rem;
}

.portal-footer a {
    color: var(--accent-orange);
    text-decoration: none;
    font-weight: bold;
}

.portal-footer a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   🛠️ MAIN APPLICATION CANVAS LAYOUT (index.html)
   ========================================================================== */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr; /* Slightly wider sidebar for modular dashboard tools */
    grid-template-rows: 1fr 55px;
    height: 100vh;
    width: 100vw;
}

/* Toolbox Sidebar */
.toolbox {
    background-color: var(--panel-bg);
    border-right: 2px solid var(--border-color);
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    box-shadow: 5px 0 15px rgba(0,0,0,0.3);
    z-index: 10;
}

.toolbox-header h3 {
    color: var(--accent-orange);
    border-bottom: 2px solid var(--accent-orange);
    padding-bottom: 12px;
    font-size: 1.25rem;
    letter-spacing: 1px;
}

.toolbox-section h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tool-btn {
    display: block;
    width: 100%;
    background: #242424;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 12px 15px;
    margin-bottom: 10px;
    text-align: left;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.tool-btn:hover {
    background: var(--accent-orange);
    color: #000;
    font-weight: bold;
    transform: translateX(4px);
    box-shadow: -4px 0 0 #000;
}

/* Spatial Drafting Canvas */
.spatial-canvas {
    background: radial-gradient(circle, #2c2c2c 1px, transparent 1px);
    background-size: var(--grid-size) var(--grid-size);
    background-color: #111111;
    padding: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-auto-rows: minmax(180px, auto);
    gap: 25px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* Modular Adjustable Cards */
.canvas-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    
    /* Ready for customizable user resizing */
    resize: both; 
    overflow: auto;
}

/* Grab cursors to show they can design and re-order their layout */
.canvas-card:hover {
    border-color: var(--accent-orange);
    box-shadow: 0 12px 24px rgba(0,0,0,0.6), var(--panel-glow);
}

.card-header {
    background: #222222;
    padding: 10px 15px;
    font-size: 0.85rem;
    font-weight: bold;
    border-bottom: 1px solid var(--border-color);
    color: var(--accent-orange);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: grab; /* Grab cue for physical positioning layout */
}

.card-header:active {
    cursor: grabbing;
}

.card-body {
    padding: 20px;
    font-size: 0.9rem;
    line-height: 1.5;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-image: linear-gradient(rgba(255,255,255,0.01) 1px, transparent 1px); /* Notebook grid line accent */
    background-size: 100% 20px;
}

.photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border: 2px dashed #333333;
    border-radius: 4px;
    margin: 10px 0;
    flex-grow: 1;
    min-height: 110px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.photo-placeholder:hover {
    border-color: var(--accent-orange);
    background: rgba(243, 156, 18, 0.02);
    color: var(--text-main);
}

/* ==========================================================================
   ☕ THE BREAKROOM BANTER ZONE (Footer)
   ========================================================================== */
.breakroom {
    grid-column: span 2;
    background-color: #070707;
    border-top: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    font-size: 0.85rem;
    overflow: hidden;
    gap: 20px;
    z-index: 11;
}

.breakroom-label {
    color: var(--accent-orange);
    font-weight: bold;
    white-space: nowrap;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Pulse beacon indicator */
.breakroom-label::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--accent-orange);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-orange);
    animation: blink 2s infinite;
}

.breakroom-stream-container {
    flex-grow: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.breakroom-stream {
    display: flex;
    align-items: center;
    white-space: nowrap;
    gap: 12px;
}

/* Chat Input styling */
.breakroom-form {
    display: flex;
    gap: 10px;
    height: 35px;
    min-width: 320px;
}

#chatInput {
    background: #141414;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0 15px;
    font-family: inherit;
    font-size: 0.85rem;
    border-radius: 3px;
    flex-grow: 1;
    transition: all 0.2s ease;
}

#chatInput:focus {
    outline: none;
    border-color: var(--accent-orange);
    background: #181818;
}

.breakroom-form button {
    background: var(--accent-orange);
    color: #000;
    border: none;
    font-weight: bold;
    font-family: inherit;
    font-size: 0.8rem;
    padding: 0 20px;
    cursor: pointer;
    border-radius: 3px;
    letter-spacing: 1px;
    transition: all 0.2s ease;
}

.breakroom-form button:hover {
    background: #e08e0b;
    box-shadow: 0 0 10px rgba(243, 156, 18, 0.2);
}

.chat-tag {
    color: var(--accent-blue);
    font-weight: bold;
}

.divider {
    color: #444444;
    margin: 0 8px;
    font-weight: bold;
}

/* ==========================================================================
   SYSTEM ANIMATIONS
   ========================================================================== */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
