/* assets/css/global.css */

:root {
    --maroon-primary: #800000;
    --maroon-dark: #4d0000;
    --maroon-light: #b30000;
    --text-main: #333333;
    --text-muted: #666666;
    --bg-light: #f4f6f8;
    --white: #ffffff;
    --danger: #dc3545;
    --success: #28a745;
    --warning: #ffc107;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Global Buttons */
.btn {
    background-color: var(--maroon-primary);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s ease, transform 0.1s;
}

.btn:hover {
    background-color: var(--maroon-light);
}

.btn:active {
    transform: scale(0.98);
}

/* System Notifications (Popups) */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--white);
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    border-left: 5px solid var(--maroon-primary);
    z-index: 10000;
    transform: translateX(120%);
    transition: transform 0.3s ease-out;
}

.notification.show {
    transform: translateX(0);
}

.notification.success { border-left-color: var(--success); }
.notification.error { border-left-color: var(--danger); }
.notification.warning { border-left-color: var(--warning); } 

.table-state {
    align-items: center;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
    justify-content: center;
    min-height: 64px;
    text-align: center;
    width: 100%;
}

.table-state.loading {
    color: #6b7280;
    font-weight: 600;
}

.table-state.empty {
    color: #8a8f98;
}

.table-state.loading-more {
    color: #7b808a;
    font-size: 0.9rem;
    min-height: 48px;
}

/* ==========================================
   Seamless SPA Curtain Overlay
   ========================================== */
#spa-curtain {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: var(--bg-light); /* Matches your app background */
    z-index: 999999;
    pointer-events: none;
    opacity: 1; /* Starts solid */
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* When the new page is ready, we make the curtain transparent */
#spa-curtain.open {
    opacity: 0;
}

/* Enable cross-document View Transitions for modern Chromium browsers */
@view-transition {
    navigation: auto;
}

/* ==========================================
   PWA Connection Status Badge
   ========================================== */
.status-badge {
    margin-top: auto;
    margin-bottom: 20px;
    margin-left: 20px;
    margin-right: 20px;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.status-badge.online {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.status-badge.offline {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

.status-badge.syncing {
    background-color: rgba(255, 193, 7, 0.15);
    color: #d39e00;
}

@media (max-width: 768px) {
    .status-badge {
        /* Changed from display: none to a floating pill */
        position: fixed;
        bottom: 80px; /* Floats perfectly above the 65px bottom nav bar */
        left: 50%;
        transform: translateX(-50%);
        z-index: 1002;
        margin: 0;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        background-color: var(--white);
        border: 1px solid rgba(0,0,0,0.05);
        border-radius: 20px; /* More pill-like on mobile */
        padding: 8px 16px;
    }
}