/* =====================================================
   WorkHub
   File: /assets/css/styles.css
   Version: WH-1.0.0
   Description: Global application styling
===================================================== */

html,
body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    background-color: #f4f6f9;
    font-family: Arial, sans-serif;
}

/* =====================================================
   Application Shell Layout
   - Creates app-style structure
   - Header stays top
   - Footer stays bottom
   - Main content scrolls
===================================================== */
.app-shell {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Sticky top app header */
.app-header,
.navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Main app workspace */
.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 1rem;
}

/* =====================================================
   Footer / Status Bar
   - App-style bottom status bar
   - Used for version, status, user, broadcast, debug
===================================================== */
.app-footer {
    position: sticky;
    bottom: 0;
    z-index: 1020;
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
    font-size: 0.85rem;
}

/* =====================================================
   General UI Polish
===================================================== */
.card {
    border-radius: 12px;
}

.navbar-brand {
    font-weight: bold;
    letter-spacing: 1px;
}

#module-content {
    min-height: 250px;
}

/* =====================================================
   Set Access UI
===================================================== */
.clearance-card {
    border-radius: 14px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.clearance-card:hover {
    transform: translateY(-2px);
}

.clearance-toggle {
    transform: scale(1.2);
}

/* =====================================================
   Inline Fade Message
   - Used for "Access updated"
===================================================== */
.access-fade {
    opacity: 1;
    animation: accessFadeOut 2s ease forwards;
    display: inline-block;
}

@keyframes accessFadeOut {
    0% { opacity: 0; transform: translateY(3px); }
    20% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* =====================================================
   System Status Colors
===================================================== */
.status-online {
    color: #4ade80;
    font-weight: 600;
}

.status-offline {
    color: #f87171;
    font-weight: 600;
}

.status-warning {
    color: #facc15;
    font-weight: 600;
}

/* =====================================================
   Broadcast Status Styles
===================================================== */
.status-live {
    color: #38bdf8;
    font-weight: 600;
}

.status-standby {
    color: #c084fc;
    font-weight: 600;
}

.status-broadcast-offline {
    color: #94a3b8;
    font-weight: 600;
}

/* =====================================================
   Debug Icon Button
   - Admin-only footer control
   - Green glow when enabled
===================================================== */
.debug-icon-btn {
    border: none;
    background: transparent;
    color: #cbd5e1;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    transition: all 0.15s ease;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.debug-icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.debug-icon-btn.debug-on {
    color: #4ade80;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.35);
}

.debug-icon-btn.debug-off {
    color: #94a3b8;
}

.admin-users-table td,
.admin-users-table th {
    vertical-align: middle;
}

.admin-users-table td {
    white-space: nowrap;
}

/* =====================================================
   WorkHub Broadcast System
===================================================== */

.dashboard-message-card {
    border-radius: 14px;
    transition: all 0.2s ease;
}

.dashboard-message-card.border-danger {
    background: rgba(220, 53, 69, 0.05);
}

.dashboard-message-card .text-danger {
    font-weight: 600;
}

.broadcast-card {
    transition: all 0.2s ease;
}

.broadcast-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.2);
}

.app-launcher-custom-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    color: #38bdf8;
    display: inline-block;
    margin-bottom: 0.35rem;
    opacity: 0.85;
}

/* =====================================================
   CBT CARD STYLING
===================================================== */

.cbt-card {
    border-radius: 14px;
    transition: all 0.2s ease;
}

.cbt-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

/* IMAGE WRAP (KEY FIX) */
.cbt-image-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px;
}

/* IMAGE (NOT FULL WIDTH) */
.cbt-image {
    width: 100%;
    max-width: 95%;

    object-fit: contain; /* <-- THIS IS THE MAGIC */
    border-radius: 10px;
    background: #f8f9fa;
    padding: 6px;
}

/* Safety Dashboard */
.safety-card {
    transition: 0.2s ease-in-out;
}

.safety-card:hover {
    transform: translateY(-2px);
}

.safety-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #f1f3f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}