:root {
    --primary-color: #1e3a8a;
    --secondary-color: #f59e0b;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --accent-color: #3b82f6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --sidebar-width: 260px;
}

/* Global Styles */
body {
    padding-top: 60px; /* Account for fixed navbar */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f3f4f6;
    color: var(--dark-color);
    overflow-x: hidden;
}

.bg-primary { background-color: var(--primary-color) !important; }
.btn-primary { 
    background-color: var(--primary-color); 
    border-color: var(--primary-color);
}
.btn-primary:hover {
    background-color: #162d6d;
    border-color: #162d6d;
}

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

.bg-primary-subtle {
    background-color: #e0e7ff !important;
}

.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important; }
.shadow { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important; }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important; }

/* Dark Mode Styles */
body.dark-mode {
    background-color: #111827;
    color: #f3f4f6;
}

body.dark-mode .sidebar, 
body.dark-mode .card, 
body.dark-mode .modal-content,
body.dark-mode .bg-white,
body.dark-mode .navbar-collapse {
    background-color: #1f2937 !important;
    color: #f3f4f6;
    border-color: #374151 !important;
}

body.dark-mode .table {
    color: #f3f4f6;
    border-color: #374151;
}

body.dark-mode .table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .bg-light,
body.dark-mode .list-group-item,
body.dark-mode .card-header {
    background-color: #374151 !important;
    color: #f3f4f6;
    border-color: #4b5563;
}

body.dark-mode .text-muted {
    color: #9ca3af !important;
}

body.dark-mode .form-control,
body.dark-mode .form-select,
body.dark-mode .input-group-text {
    background-color: #374151;
    border-color: #4b5563;
    color: #fff;
}

body.dark-mode .btn-outline-secondary,
body.dark-mode .btn-white {
    color: #f3f4f6;
    border-color: #4b5563;
}

/* Authentication Styles */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--dark-color) 100%);
    margin-top: -60px; /* Compensate for body padding */
    padding: 2rem;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

.auth-container .card {
    border: none;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    max-width: 450px;
    width: 100%;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.auth-container .card-body {
    border-radius: 15px;
}

.auth-container .nav-tabs {
    border-bottom: 2px solid #e9ecef;
}

.auth-container .nav-tabs .nav-link {
    border: none;
    color: #6c757d;
    font-weight: 500;
    padding: 1rem 1.5rem;
    border-radius: 0;
}

.auth-container .nav-tabs .nav-link.active {
    color: #0d6efd;
    border-bottom: 3px solid #0d6efd;
    background: none;
}

.auth-container .form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.auth-container .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.auth-container .input-group-text {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-right: none;
    color: #6c757d;
}

.auth-container .btn-lg {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.main-layout {
    height: calc(100vh - 60px);
}

/* Override main layout when auth screen is shown */
body.auth-mode {
    padding-top: 0 !important;
}

body.auth-mode .main-layout {
    height: 100vh;
    padding: 0;
    margin: 0;
}

body.auth-mode .main-content {
    padding: 0;
    height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    background-color: white !important;
    border-right: 1px solid #e5e7eb;
    height: 100%;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.sidebar-content {
    padding: 1.5rem;
}

.sidebar h6 {
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: #9ca3af;
    margin-top: 1.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #4b5563;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0.25rem;
    transition: all 0.2s;
    font-weight: 500;
}

.sidebar-link:hover {
    background-color: #f3f4f6;
    color: var(--primary-color);
}

.sidebar-link.active {
    background-color: #e0e7ff;
    color: var(--primary-color);
}

.sidebar-link i {
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.main-content {
    padding: 1.5rem;
    height: 100%;
    overflow-y: auto;
    background-color: #f3f4f6;
}

/* Navigation Styles */
.nav-btn {
    margin-right: 0.5rem !important;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.nav-btn.active {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--dark-color) !important;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
    background-color: white;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: var(--primary-color);
        padding: 1rem;
        border-radius: 0 0 15px 15px;
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
    }
    
    .nav-btn {
        text-align: left;
        padding: 10px 15px !important;
        width: 100%;
        margin-right: 0 !important;
        margin-bottom: 5px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .sidebar {
        z-index: 1050;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }

    .main-content {
        padding: 1rem;
    }
    
    .welcome-hero {
        padding: 1.5rem;
    }
    
    .display-4 {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .timer-circle {
        width: 150px !important;
        height: 150px !important;
    }
    .clock-display {
        font-size: 1.8rem !important;
    }
}

/* Table Responsiveness */
.table-responsive {
    border-radius: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Chat bubble styling */
#chatMessages {
    scrollbar-width: thin;
    max-height: 350px;
}

/* Enterprise UI Components */
.card-stats {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
}

.finance-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

/* Time Clock Styles */
.timer-circle {
    width: 200px;
    height: 200px;
    border: 8px solid #e9ecef;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    position: relative;
}

.timer-circle.active::after {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 8px solid transparent;
    border-top-color: var(--success-color);
    border-radius: 50%;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.clock-display {
    font-family: 'Courier New', Courier, monospace;
    font-size: 2.2rem;
    font-weight: 700;
}

/* Team Tab Modern UI (ClickUp/Monday Style) */
.hover-shadow {
    transition: all 0.25s ease-in-out;
}

.hover-shadow:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.08) !important;
    transform: translateY(-2px);
}

.transition {
    transition: all 0.2s ease;
}

.bg-primary-subtle { background-color: rgba(13, 110, 253, 0.1) !important; }
.bg-success-subtle { background-color: rgba(25, 135, 84, 0.1) !important; }
.bg-danger-subtle { background-color: rgba(220, 53, 69, 0.1) !important; }
.bg-warning-subtle { background-color: rgba(255, 193, 7, 0.1) !important; }

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Stack.com Style Takeoff Interface */
.stack-header {
    height: 70px;
    z-index: 1020;
}

.stack-header .nav-link {
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 1.5rem 0;
    transition: all 0.2s ease;
}

.stack-nav .nav-link {
    font-size: 0.9rem;
    padding: 0.75rem 1.5rem;
}

.stack-nav .nav-link.active {
    color: #1e3a8a !important;
    border-top: 3px solid #1e3a8a !important;
}

/* Print Styles */
@media print {
    .sidebar, .navbar, .btn, .modal-footer {
        display: none !important;
    }
    
    .main-content {
        width: 100% !important;
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
}
