/* Carnaby Caravans Inspired Theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Theme Colors */
    --button-red: #AD2739;
    --grey: #E0E0E0;
    --grey-2: #CDCDCC;
    --dark-grey: #393838;
    --very-dark-grey: #2B2B2B;
    
    /* Color Palette - Inspired by Carnaby Caravans */
    --primary-color: #1a365d;
    --primary-dark: #0f2439;
    --primary-light: #2d4a6b;
    --secondary-color: #4a90e2;
    --accent-color: #e8f4f8;
    --background: #ffffff;
    --background-light: #f8f9fa;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-xxl: 3rem;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-base: 16px;
    --line-height-base: 1.6;
    
    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;
    --header-height: 64px;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition-base: all 0.3s ease;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

html {
    font-size: var(--font-size-base);
    position: relative;
    height: 100vh;
    overflow: hidden; /* Prevent html from scrolling */
    width: 100%;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--text-primary);
    background-color: var(--background-light);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transform: scale(0.75);
    transform-origin: top left;
    width: 133.333vw; /* Use viewport width instead of percentage */
    min-height: 133.333vh; /* Use min-height to allow content to grow */
    overflow-x: hidden;
    overflow-y: auto; /* Allow body to scroll if content exceeds viewport */
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-base);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

/* Buttons - Large and Clear */
.btn {
    font-family: var(--font-family);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    transition: var(--transition-base);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--button-red);
    color: white;
}

.btn-primary:hover {
    background-color: #8d1f2d;
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--text-secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--text-primary);
    color: white;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-danger {
    background-color: #AD2739;
    color: white;
}

.btn-danger:hover {
    background-color: #8d1f2d;
    color: white;
}

.btn-info {
    background-color: var(--info-color);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Cards */
.card {
    background: #E0E0E0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-lg);
    transition: var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background-color: #CDCDCC;
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: var(--spacing-lg);
    background-color: #E0E0E0;
}

.card-footer {
    background-color: #CDCDCC;
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-lg);
}

/* Forms */
.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    font-size: 0.95rem;
}

.form-control,
.form-select {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.75rem;
    font-size: 1rem;
    transition: var(--transition-base);
    font-family: var(--font-family);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(26, 54, 93, 0.15);
    outline: none;
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(26, 54, 93, 0.15);
}

/* Tables */
.table {
    background: var(--background);
    border-radius: 8px;
    overflow: hidden;
}

.table thead {
    background-color: var(--primary-color);
    color: white;
}

.table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    padding: 1rem;
    border: none;
}

.table tbody tr {
    transition: var(--transition-base);
}

.table tbody tr:hover {
    background-color: var(--accent-color);
}

.table tbody td {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    vertical-align: middle;
}

/* Badges */
.badge {
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.875rem;
}

/* Alerts */
.alert {
    border-radius: 6px;
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    border: none;
}

/* Navigation Tabs */
.nav-tabs {
    border-bottom: 2px solid var(--border-color);
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 1rem 1.5rem;
    transition: var(--transition-base);
}

.nav-tabs .nav-link:hover {
    border-bottom-color: var(--primary-light);
    color: var(--primary-color);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: transparent;
}

/* Utilities */
.text-muted {
    color: var(--text-secondary) !important;
}

.bg-light {
    background-color: var(--background-light) !important;
}

.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow-md {
    box-shadow: var(--shadow-md) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .btn {
        width: 100%;
        justify-content: center;
        margin-bottom: var(--spacing-sm);
    }
    
    .card-body {
        padding: var(--spacing-md);
    }
}

/* Focus styles for accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Compact Select Dropdowns - Don't take full width except on mobile */
.compact-select {
    width: 100%;
    max-width: 250px;
}

.compact-select-van {
    width: 100%;
    max-width: 200px;
}

/* On mobile, make them full width */
@media (max-width: 767.98px) {
    .compact-select,
    .compact-select-van {
        max-width: 100%;
    }
}

/* DataTables header border radius fix - keep top corners, remove bottom corners */
.dataTables_wrapper .dataTables_scrollHead thead th:first-child,
.dataTables_wrapper table thead th:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 0 !important;
}

.dataTables_wrapper .dataTables_scrollHead thead th:last-child,
.dataTables_wrapper table thead th:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 0 !important;
}

/* Also fix for regular tables with DataTables */
table.dataTable thead th:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 0 !important;
}

table.dataTable thead th:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 0 !important;
}

/* Print styles */
@media print {
    .sidebar,
    .header,
    .btn,
    .no-print {
        display: none !important;
    }
}

/* Modal fixes for mobile devices */
@media (max-width: 767.98px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-content {
        border-radius: 0.5rem;
    }
    
    .modal {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* Ensure modals are visible on all screen sizes */
.modal {
    z-index: 1055 !important;
}

.modal-backdrop {
    z-index: 1050 !important;
    width: 133.333vw !important; /* Compensate for 0.75 scale: 100vw / 0.75 = 133.333vw */
    height: 133.333vh !important; /* Compensate for 0.75 scale: 100vh / 0.75 = 133.333vh */
    left: 0 !important;
    top: 0 !important;
}
