/* Base styles for Horizon CRM */
/* Horizon CRM Brand Colors & Overrides */
:root {
    --horizon-primary: #1e3a8a;
    --horizon-primary-dark: #0f172a;
    --primary-gradient: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
}

/* Override Bootstrap primary color with deep blue gradient */
.bg-primary {
    background: var(--primary-gradient) !important;
    color: #fff !important;
}

.btn-primary {
    background: var(--primary-gradient) !important;
    border: none !important;
    color: #fff !important;
}

.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%) !important;
    color: #fff !important;
}

.text-primary {
    color: var(--horizon-primary) !important;
}

/* Aggressive purple-to-blue override for legacy elements */
[style*="#667eea"], [style*="#764ba2"], [style*="667eea"], [style*="764ba2"] {
    background: var(--primary-gradient) !important;
    color: #fff !important;
}

/* Prevent white flash - body background must match Bootstrap's bg-light */
html, body {
    background-color: #f8f9fa !important;
    margin: 0;
    padding: 0;
}

/* Fix any layout issues */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Ensure proper spacing */
.container-fluid {
    padding: 0;
}

/* Basic button styling */
.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

/* Loading states */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Form controls */
.form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    border-color: #80bdff;
}

/* Navigation */
.navbar-brand {
    font-weight: 600;
}

/* Cards */
.card {
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.125);
}

/* Alerts */
.alert {
    border-radius: 6px;
}

/* Tables */
.table th {
    font-weight: 600;
    border-top: 0;
}

/* Sidebar Mobile Styles */
#sidebar {
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    z-index: 1050;
}

/* Mobile: Hide sidebar by default */
@media (max-width: 767px) {
    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
        opacity: 0;
        pointer-events: none;
    }
    
    #sidebar.active {
        transform: translateX(0);
        opacity: 1;
        pointer-events: all;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }
    
    /* Sidebar toggle button positioning */
    #sidebarToggle {
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 1051;
    }
}

/* Desktop: Always show sidebar */
@media (min-width: 768px) {
    #sidebar {
        position: relative;
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
}