/* ViewLox Stylesheet - White Theme with Black Headers */

:root {
    --primary-color: #000000;
    --primary-dark: #1a1a1a;
    --primary-light: #333333;
    --accent-color: #007bff;
    --accent-dark: #0056b3;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --background: #f9f9f9;
    --surface: #f8f9fa;
    --text-primary: #000000;
    --text-secondary: #666666;
}

/* Global white theme */
body {
    background-color: var(--background) !important;
    color: var(--text-primary) !important;
}

/* Override Bootstrap primary */
.bg-primary {
    background-color: var(--primary-color) !important;
}

.btn-primary {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #ffffff;
    font-weight: 600;
}

.btn-primary:hover {
    background-color: var(--accent-dark);
    border-color: var(--accent-dark);
    color: #ffffff;
}

.btn-outline-primary {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.btn-outline-primary:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #ffffff;
}

.text-primary {
    color: var(--accent-color) !important;
}

/* Navbar */
.navbar {
    background-color: var(--primary-color) !important;
    border-bottom: 1px solid #c7ced6;
}

.navbar-brand {
    font-size: 1.5rem;
    color: #ffffff !important;
}

.nav-link {
    color: rgba(255,255,255,0.7) !important;
}

.nav-link:hover {
    color: #ffffff !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: var(--text-primary);
    padding-top: 80px;
    min-height: 100vh;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: none;
}

.hero-image {
    max-width: 500px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* Feature Icons */
.feature-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Step Numbers */
.step-number {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: bold;
}

/* Cards */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    color: var(--text-primary) !important;
}

.card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
    border-color: var(--accent-color) !important;
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background-color: #f8f9fa;
}

.auth-card {
    max-width: 450px;
    width: 100%;
    background-color: #ffffff !important;
    border: 1px solid #dee2e6 !important;
}

/* Dashboard Sidebar - See dark-theme.css for styling */

/* Modern Stat Cards */
.stat-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    position: relative;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
}

.stat-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.stat-card .card-body {
    padding: 1.5rem;
}

.stat-card h4 {
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card.success::before {
    background: var(--success-color);
}

.stat-card.warning::before {
    background: var(--warning-color);
}

.stat-card.info::before {
    background: var(--accent-color);
}

/* Modern Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
    border-radius: 12px 12px 0 0 !important;
    padding: 1rem 1.25rem;
}

/* Modern Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-dark) 100%);
    border: none;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-dark) 0%, #004494 100%);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
    transform: translateY(-1px);
}

/* Modern Inputs */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 0.625rem 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

/* Modern Modal */
.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid #eee;
    padding: 1.25rem 1.5rem;
}

.modal-footer {
    border-top: 1px solid #eee;
    padding: 1rem 1.5rem;
}

/* Modern Badges */
.badge {
    border-radius: 6px;
    font-weight: 500;
    padding: 0.4em 0.8em;
}

/* Unlock Page */
.unlock-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
}

.unlock-card {
    max-width: 400px;
    width: 100%;
    background-color: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.code-display {
    font-family: 'Courier New', monospace;
    font-size: 3rem;
    font-weight: bold;
    letter-spacing: 0.5rem;
    color: var(--accent-color);
}

/* Code Box */
.code-box {
    background-color: #1e1e1e;
    border-radius: 0.5rem;
    overflow: hidden;
}

.code-box pre {
    margin: 0;
    padding: 1rem;
    color: #d4d4d4;
    font-size: 0.875rem;
    overflow-x: auto;
}

.code-header {
    background-color: #2d2d2d;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-header .btn {
    font-size: 0.75rem;
}

/* Form Styles */
.form-control,
.form-select {
    background-color: #ffffff;
    border-color: #dee2e6;
    color: var(--text-primary);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25);
    background-color: #ffffff;
    color: var(--text-primary);
}

.form-label {
    color: var(--text-primary);
}

/* Tables */
.table {
    color: var(--text-primary);
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--text-primary);
}

.table tbody tr {
    background-color: #ffffff;
    border-color: #dee2e6;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        text-align: center;
        padding-top: 60px;
        min-height: auto;
    }
    
    .hero-image {
        max-width: 300px;
        margin-top: 2rem;
    }
    
    .sidebar {
        min-height: auto;
    }

    /* Dashboard header: stack title & filter vertically */
    .d-flex.justify-content-between.align-items-center {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem;
    }

    /* Date filter form: wrap on mobile */
    #dateFilterForm,
    form.d-flex.gap-2 {
        flex-wrap: wrap !important;
        width: 100%;
    }

    #dateFilterForm select,
    #dateFilterForm input[type="date"] {
        width: 100% !important;
        min-width: 0 !important;
    }

    /* Stat/metric cards: 2 per row on mobile */
    .row.g-3 > .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .metric-card .card-body h3,
    .stat-card h4 {
        font-size: 1.1rem;
    }

    .metric-card .card-body .small,
    .metric-card .card-body small {
        font-size: 0.7rem;
    }

    /* Main content padding */
    main.col-md-9,
    main.col-lg-10 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    /* Cards spacing */
    .card {
        margin-bottom: 0.75rem;
    }

    /* Tables: smaller text on mobile */
    .table {
        font-size: 0.8rem;
    }

    .table thead th {
        font-size: 0.75rem;
        padding: 0.5rem 0.4rem !important;
        white-space: nowrap;
    }

    .table tbody td {
        padding: 0.5rem 0.4rem !important;
    }

    /* Buttons: smaller on mobile */
    .btn {
        font-size: 0.85rem;
        padding: 0.4rem 0.75rem;
    }

    .btn-sm {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    /* Button groups: wrap */
    .btn-group,
    .d-flex.gap-2 {
        flex-wrap: wrap;
    }

    /* Modal: full width on mobile */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    /* Form inputs: smaller on mobile */
    .form-control,
    .form-select {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }

    /* Code display responsive */
    .code-display {
        font-size: 2rem;
        letter-spacing: 0.25rem;
    }

    .code-input {
        width: 45px;
        height: 55px;
        font-size: 1.5rem;
    }

    /* Card header text */
    .card-header h5,
    .card-header .h5 {
        font-size: 1rem;
    }

    /* Action button columns in tables */
    .table td:last-child {
        white-space: nowrap;
    }

    /* Badge sizing */
    .badge {
        font-size: 0.7rem;
    }

    /* Headings smaller on mobile */
    h1, .h1 { font-size: 1.5rem; }
    h2, .h2 { font-size: 1.25rem; }
    h3, .h3 { font-size: 1.1rem; }

    /* Toast positioning */
    .toast-container {
        right: 10px;
        left: 10px;
    }

    /* Navbar nav mobile menu padding */
    .navbar-nav .nav-link {
        padding: 0.5rem 1rem;
    }
}

/* Extra small devices (phones < 576px) */
@media (max-width: 575.98px) {
    /* Stat cards: still 2 per row but tighter */
    .row.g-3 > .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }

    .metric-card .card-body {
        padding: 0.75rem !important;
    }

    .metric-card .card-body h3 {
        font-size: 0.95rem;
    }

    /* Hide stat icon on very small screens */
    .stat-icon {
        display: none !important;
    }

    /* Smaller padding */
    .py-4 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    .mb-4 {
        margin-bottom: 1rem !important;
    }

    /* Chart containers */
    canvas {
        max-height: 250px;
    }

    /* Long text truncation */
    .text-truncate-mobile {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
}

/* Code Input */
.code-input {
    width: 60px;
    height: 70px;
    font-size: 2rem;
    text-align: center;
    border: 2px solid #dee2e6;
    border-radius: 0.5rem;
    background-color: #ffffff;
    color: var(--text-primary);
}

.code-input:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25);
}
