/* ============================================
   Nonstop Log - Main Stylesheet
   ============================================ */

/* CSS Variables for Theme Support */
:root {
    --body-bg: #f5f5f5;
    --container-bg: #fff;
    --card-shadow: rgba(0, 0, 0, 0.05);
    --border-color: #dee2e6;
    --text-muted: #6c757d;
    --calendar-day-hover: #e9ecef;
    --calendar-day-other: #adb5bd;
    --calendar-indicator: #0d6efd;
}

[data-bs-theme="dark"] {
    --body-bg: #121212;
    --container-bg: #1e1e1e;
    --card-shadow: rgba(0, 0, 0, 0.2);
    --border-color: #2d2d2d;
    --text-muted: #adb5bd;
    --calendar-day-hover: #2d2d2d;
    --calendar-day-other: #666666;
    --calendar-indicator: #0d6efd;
}

/* ============================================
   Global Styles
   ============================================ */

* {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

body {
    background-color: var(--body-bg);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px 0;
    transition: background-color 0.3s ease;
}

/* ============================================
   Main Container
   ============================================ */

.main-container {
    max-width: 1200px;
    width: 100%;
    background-color: var(--container-bg);
    border-radius: 8px;
    box-shadow: 0 0 15px var(--card-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 40px);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.content-wrapper {
    flex: 1;
    padding: 20px;
}

/* ============================================
   Navbar
   ============================================ */

.navbar {
    box-shadow: 0 2px 4px var(--card-shadow);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* ============================================
   Cards
   ============================================ */

.card {
    margin-bottom: 20px;
    box-shadow: 0 0.125rem 0.25rem var(--card-shadow);
    border: none;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.card-header {
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

[data-bs-theme="dark"] .card-header {
    background-color: rgba(255, 255, 255, 0.05);
}

.stat-card {
    text-align: center;
    padding: 1.5rem;
    transition: transform 0.2s;
}

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

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #0d6efd;
}

.stat-label {
    font-size: 0.875rem;
    color: #6c757d;
    text-transform: uppercase;
    margin-top: 0.5rem;
}

/* ============================================
   Footer
   ============================================ */

.footer {
    background-color: rgba(0, 0, 0, 0.03);
    border-top: 1px solid var(--border-color);
    padding: 15px 0;
    text-align: center;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    transition: background-color 0.3s ease;
}

[data-bs-theme="dark"] .footer {
    background-color: rgba(255, 255, 255, 0.05);
}

/* ============================================
   Theme Toggle Button
   ============================================ */

.theme-toggle {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    border: none;
    background: none;
}

.theme-toggle:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.theme-toggle i {
    font-size: 1.2rem;
}

[data-bs-theme="light"] .theme-toggle .bi-sun {
    display: none;
}

[data-bs-theme="dark"] .theme-toggle .bi-moon {
    display: none;
}

/* ============================================
   Calendar Styles
   ============================================ */

.calendar-table {
    table-layout: fixed;
    font-size: 0.8rem;
}

.calendar-table th, 
.calendar-table td {
    text-align: center;
    vertical-align: middle;
    padding: 0.2rem;
}

.calendar-table th {
    font-weight: normal;
    font-size: 0.75rem;
}

.calendar-day {
    cursor: pointer;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    line-height: 24px;
    display: inline-block;
    transition: all 0.2s;
    font-size: 0.75rem;
}

.calendar-day:hover {
    background-color: var(--calendar-day-hover);
}

.calendar-day.current-day {
    background-color: var(--calendar-indicator);
    color: white;
}

.calendar-day.has-customers {
    position: relative;
}

.calendar-day.has-customers::after {
    content: '';
    position: absolute;
    bottom: 1px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background-color: var(--calendar-indicator);
}

.calendar-day.current-day.has-customers::after {
    background-color: white;
}

.calendar-day.selected {
    background-color: #6c757d;
    color: white;
}

.calendar-day.other-month {
    color: var(--calendar-day-other);
}

/* ============================================
   Customer List Items
   ============================================ */

.customer-list-item {
    border-left: 3px solid var(--calendar-indicator);
    margin-bottom: 8px;
    transition: all 0.2s;
}

.customer-list-item:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

[data-bs-theme="dark"] .customer-list-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* ============================================
   Tables
   ============================================ */

.table-responsive {
    overflow-x: auto;
}

.report-table th {
    background-color: var(--bs-primary);
    color: white;
}

/* ============================================
   Password Strength Indicator
   ============================================ */

.password-strength {
    margin-top: 0.5rem;
}

.password-strength-bar {
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-fill {
    height: 100%;
    transition: width 0.3s, background-color 0.3s;
    width: 0%;
}

.password-strength-fill.weak {
    width: 33%;
    background-color: #dc3545;
}

.password-strength-fill.medium {
    width: 66%;
    background-color: #ffc107;
}

.password-strength-fill.strong {
    width: 100%;
    background-color: #198754;
}

/* ============================================
   Login/Register Pages
   ============================================ */

.login-container,
.register-container {
    max-width: 450px;
    width: 100%;
    padding: 20px;
}

.register-container {
    max-width: 600px;
}

.logo-container {
    text-align: center;
    margin-bottom: 1rem;
}

.logo-icon {
    font-size: 3rem;
    color: #0d6efd;
}

.card-footer {
    background-color: rgba(0, 0, 0, 0.03);
    border-top: 1px solid var(--border-color);
    padding: 1rem;
}

[data-bs-theme="dark"] .card-footer {
    background-color: rgba(255, 255, 255, 0.05);
}

/* ============================================
   Security Tips
   ============================================ */

.security-tips {
    background-color: rgba(13, 110, 253, 0.1);
    border-left: 4px solid #0d6efd;
    padding: 1rem;
    margin-top: 1.5rem;
}

[data-bs-theme="dark"] .security-tips {
    background-color: rgba(13, 110, 253, 0.2);
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        padding: 0;
    }
    
    .main-container {
        box-shadow: none;
        border-radius: 0;
    }
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 768px) {
    .main-container {
        border-radius: 0;
        min-height: 100vh;
    }
    
    body {
        padding: 0;
    }
    
    .content-wrapper {
        padding: 15px;
    }
}

/* ============================================
   Dashboard Statistics
   ============================================ */

.stats-mini {
    font-size: 0.75rem;
}

.stats-mini .fw-bold {
    font-size: 1.1rem;
    line-height: 1.2;
}

.stats-mini small {
    font-size: 0.7rem;
    display: block;
    margin-top: 0.1rem;
}

/* Responsive adjustments for stats */
@media (max-width: 768px) {
    .card-header .row.g-2 {
        font-size: 0.85rem;
    }
    
    .card-header .fw-bold {
        font-size: 1rem !important;
    }
}
/* ============================================
   Day Statistics Display
   ============================================ */

#dayStats {
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
}

#dayStats .text-center {
    padding: 0.25rem;
}

#dayStats .fw-bold {
    font-size: 1.25rem;
    line-height: 1.2;
}

#dayStats small {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    #dayStats .fw-bold {
        font-size: 1rem;
    }
    
    #dayStats small {
        font-size: 0.65rem;
    }
}
/* ============================================
   Compact Customer List Items
   ============================================ */

.customer-list-item .badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
}

.customer-list-item .gap-1 {
    gap: 0.25rem !important;
}

.customer-list-item .flex-grow-1 {
    min-width: 0; /* Allow text truncation */
}

.customer-list-item strong {
    font-size: 0.95rem;
}

.customer-list-item .small {
    font-size: 0.8rem;
}
/* ============================================
   Sales Goals Styling
   ============================================ */

/* Goals Progress Bar Colors - Override Bootstrap defaults */
.progress-bar.bg-danger {
    background-color: #dc3545 !important; /* Red: < 50% */
}

.progress-bar.bg-warning {
    background-color: #ffc107 !important; /* Yellow: 50-74% */
    color: #000 !important; /* Dark text on yellow */
}

.progress-bar.bg-info {
    background-color: #0dcaf0 !important; /* Blue: 75-99% */
    color: #000 !important; /* Dark text on light blue */
}

.progress-bar.bg-success {
    background-color: #198754 !important; /* Green: >= 100% */
}

/* Badge colors to match */
.badge.bg-danger {
    background-color: #dc3545 !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.badge.bg-info {
    background-color: #0dcaf0 !important;
    color: #000 !important;
}

.badge.bg-success {
    background-color: #198754 !important;
}

/* Progress bar container */
.progress {
    background-color: #e9ecef;
    border-radius: 0.375rem;
}

/* Smooth transitions */
.progress-bar {
    transition: width 0.6s ease, background-color 0.3s ease;
}
/* Custom DataTables styling */
.dataTables_wrapper .dt-buttons {
    margin-bottom: 1rem;
}

.dataTables_wrapper .dt-buttons .btn {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

#customersTable_filter input {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
}

#customersTable_length select {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
}

/* Make badges in table more compact */
#customersTable .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Compact table cells */
#customersTable td {
    vertical-align: middle;
    font-size: 0.9rem;
}

/* Dark mode support */
[data-bs-theme="dark"] #customersTable_filter input,
[data-bs-theme="dark"] #customersTable_length select {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    border-color: var(--bs-border-color);
}
