:root {
    --primary: #338699;
    --primary-dark: #2a6e7d;
    --secondary: #6BBCCF;
    --bg-light: #f8f9fa;
    --font-display: 'Outfit', sans-serif;
    --font-main: 'Inter', sans-serif;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-light);
}

h1, h2, h3, h4, .font-display {
    font-family: var(--font-display);
}

.sidebar {
    transition: all 0.3s;
    z-index: 1000;
    box-shadow: 0 0 15px rgba(0,0,0,0.05);
}

@media (min-width: 768px) {
    .sidebar {
        height: 100vh;
        position: fixed;
        top: 0;
        left: 0;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }
}

.nav-link {
    transition: all 0.2s;
    font-weight: 500;
}

.card {
    transition: transform 0.2s;
}

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

.initial-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 5px solid var(--bg-light);
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.bg-slide {
    transition: opacity 1s ease-in-out !important;
}

.bg-slide.active {
    opacity: 1 !important;
}

.landing-wrapper {
    background: #000;
}

.overlay {
    background: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.5) 100%);
}

/* Landing & Login Specific Branding (Teal) */
.landing-wrapper .btn-primary, 
.landing-wrapper .bg-primary,
.landing-wrapper .btn-outline-light:hover,
#login-form .btn-primary {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
}

.landing-wrapper .text-primary,
#login-form .text-primary {
    color: var(--primary) !important;
}

/* Modal Branding */
#contactModal .modal-header,
#contactModal .btn-primary {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
}

.navbar-brand img {
    height: 48px;
    object-fit: contain;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(51, 134, 153, 0.15);
}

/* Sidebar Active State Fix (using brand color) */
.sidebar .nav-link.active {
    background-color: var(--primary) !important;
    color: white !important;
    box-shadow: 0 4px 6px rgba(51, 134, 153, 0.2);
}


/* Dark Mode Overrides for Hardcoded Theme Classes */
[data-bs-theme="dark"] .bg-white {
    background-color: #212529 !important;
}

[data-bs-theme="dark"] .text-dark {
    color: #f8f9fa !important;
}

[data-bs-theme="dark"] .bg-light {
    background-color: #2b3035 !important;
}

[data-bs-theme="dark"] .card {
    --bs-card-bg: #212529;
    --bs-card-color: #f8f9fa;
    border-color: #495057 !important;
}

[data-bs-theme="dark"] .table {
    --bs-table-bg: #212529;
    --bs-table-color: #f8f9fa;
    border-color: #495057 !important;
}

[data-bs-theme="dark"] .table-light {
    --bs-table-bg: #2b3035 !important;
    --bs-table-color: #f8f9fa !important;
}

[data-bs-theme="dark"] .border {
    border-color: #495057 !important;
}

[data-bs-theme="dark"] .modal-content {
    background-color: #212529 !important;
    color: #f8f9fa !important;
    border: 1px solid #495057;
}

/* Floating Utilities Button */
.floating-utils-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(51, 134, 153, 0.4);
    z-index: 2000;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255,255,255,0.2);
    cursor: pointer;
}

.floating-utils-btn:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 15px 35px rgba(51, 134, 153, 0.5);
    background: var(--primary-dark);
}

.floating-utils-btn i {
    width: 28px;
    height: 28px;
}

/* Pulse animation for active chronos */
@keyframes pulse-utils {
    0% { box-shadow: 0 0 0 0 rgba(51, 134, 153, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(51, 134, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(51, 134, 153, 0); }
}

.floating-utils-btn.active-chrono {
    animation: pulse-utils 2s infinite;
}

/* Ensure Utilities Modal is always on top of other modals */
#utilitiesModal {
    z-index: 3000 !important;
}

/* Adjust backdrop for nested utilities modal */
.modal-backdrop.utilities-backdrop {
    z-index: 2999 !important;
}

/* App-level Modals (Alert, Confirm, Prompt) must be on very top */
#appAlertModal, #appConfirmModal, #appPromptModal {
    z-index: 4010 !important;
}
