/* ===== VroomDocs Bootstrap 5 Custom Styles ===== */
/* Version: 1.0.0 - Bootstrap 5 Upgrade */

/* ===== 1. CSS Variables & Color Palette ===== */
:root {
  --vroom-primary: #3b82f6;
  --vroom-secondary: #6c757d;
  --vroom-success: #10b981;
  --vroom-info: #0dcaf0;
  --vroom-warning: #f59e0b;
  --vroom-danger: #dc3545;
  --vroom-light: #f8f9fa;
  --vroom-dark: #212529;
  --vroom-sidebar-width: 250px;
  --vroom-topbar-height: 60px;
}

/* ===== 2. Sidebar Styles ===== */
.vroom-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--vroom-sidebar-width);
  height: 100vh;
  background-color: #f8f9fa;
  border-right: 1px solid #dee2e6;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1040;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

/* Portal Header - Top of Sidebar */
.vroom-sidebar .sidebar-portal-header {
  padding: 1.25rem;
  background: linear-gradient(135deg, var(--vroom-primary) 0%, #2563eb 100%);
  color: #fff;
  text-align: center;
}

.vroom-sidebar .sidebar-portal-header .sidebar-logo {
  max-height: 50px;
  max-width: 100%;
  object-fit: contain;
}

.vroom-sidebar .sidebar-portal-header .portal-type {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.9;
}

/* User Info Section */
.vroom-sidebar .sidebar-user-info {
  padding: 1rem;
  border-bottom: 1px solid #dee2e6;
  background-color: #fff;
}

/* Sidebar Navigation */
.vroom-sidebar .sidebar-nav {
  flex: 1;
  padding: 0.5rem 0;
  overflow-y: auto;
}

.vroom-sidebar .sidebar-nav .nav {
  padding: 0;
}

.vroom-sidebar .nav-item {
  margin: 0;
}

/* Regular Nav Links */
.vroom-sidebar .nav-link {
  color: #495057;
  padding: 0.75rem 1rem;
  margin: 0.125rem 0.75rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}

.vroom-sidebar .nav-link:hover {
  background-color: #e9ecef;
  color: #212529;
}

/* Active State - Primary Blue */
.vroom-sidebar .nav-link.active {
  background-color: var(--vroom-primary);
  color: #fff;
}

.vroom-sidebar .nav-link.active:hover {
  background-color: #2563eb;
  color: #fff;
}

/* Parent Active State (when submenu child is active) */
.vroom-sidebar .nav-link.parent-active {
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--vroom-primary);
  font-weight: 600;
}

/* Icon Styles */
.vroom-sidebar .nav-link i:not(.chevron-icon) {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

/* Chevron Icon for Expandable Menus */
.vroom-sidebar .nav-link .chevron-icon {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
  margin-left: auto;
}

.vroom-sidebar .nav-link[aria-expanded="true"] .chevron-icon {
  transform: rotate(180deg);
}

/* Submenu Items Container */
.vroom-sidebar .submenu-items {
  padding: 0.25rem 0;
  margin-left: 0.75rem;
  border-left: 2px solid #e9ecef;
}

/* Submenu Items */
.vroom-sidebar .nav-link.sub-item {
  padding: 0.5rem 1rem 0.5rem 1.5rem;
  margin: 0.125rem 0.5rem 0.125rem 0;
  font-size: 0.85rem;
  font-weight: 400;
  color: #6c757d;
}

.vroom-sidebar .nav-link.sub-item:hover {
  background-color: #f1f3f4;
  color: #495057;
}

/* Active Sub-item - Lighter shade */
.vroom-sidebar .nav-link.sub-item.active {
  background-color: rgba(59, 130, 246, 0.15);
  color: var(--vroom-primary);
  font-weight: 500;
  border-left: 2px solid var(--vroom-primary);
  margin-left: -2px;
}

/* Logout Link */
.vroom-sidebar .nav-link.logout-link {
  color: var(--vroom-danger);
  border-top: 1px solid #dee2e6;
  margin-top: 0.5rem;
  padding-top: 1rem;
}

.vroom-sidebar .nav-link.logout-link:hover {
  background-color: rgba(220, 53, 69, 0.1);
  color: #bb2d3b;
}

/* Sidebar Footer */
.vroom-sidebar .sidebar-footer {
  padding: 1rem;
  border-top: 1px solid #dee2e6;
  background-color: #fff;
  font-size: 0.75rem;
  color: #6c757d;
  text-align: center;
  margin-top: auto;
}

/* Legacy sidebar-brand support */
.vroom-sidebar .sidebar-brand {
  padding: 1rem;
  border-bottom: 1px solid #dee2e6;
  background-color: #fff;
}

.vroom-sidebar .sidebar-brand img {
  max-height: 40px;
}

/* ===== 3. Main Content Area ===== */
.vroom-main {
  margin-left: var(--vroom-sidebar-width);
  min-height: 100vh;
  background-color: #f5f7fa;
}

.vroom-content {
  padding: 1.5rem;
}

/* ===== 4. Top Navigation Bar ===== */
.vroom-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  padding: 0.75rem 1.5rem;
}

.vroom-topbar .navbar-brand {
  font-weight: 600;
  color: var(--vroom-primary);
}

.vroom-topbar .navbar-brand i {
  margin-right: 0.5rem;
}

/* ===== 5. Dashboard Stat Cards ===== */
.stat-card {
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.1);
}

.stat-card .card-body {
  padding: 1.25rem;
}

.stat-card .stat-icon {
  font-size: 2.5rem;
  opacity: 0.5;
}

.stat-card .stat-number {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6c757d;
}

/* Card border accents */
.border-left-primary { border-left: 4px solid var(--vroom-primary) !important; }
.border-left-secondary { border-left: 4px solid var(--vroom-secondary) !important; }
.border-left-success { border-left: 4px solid var(--vroom-success) !important; }
.border-left-info { border-left: 4px solid var(--vroom-info) !important; }
.border-left-warning { border-left: 4px solid var(--vroom-warning) !important; }
.border-left-danger { border-left: 4px solid var(--vroom-danger) !important; }

/* ===== 6. Quick Action Buttons ===== */
.quick-actions .btn {
  padding: 0.75rem 1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* ===== 7. Data Tables ===== */
.table-vroom {
  font-size: 0.875rem;
}

.table-vroom thead th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  color: #6c757d;
  border-bottom: 2px solid #dee2e6;
  background-color: #f8f9fa;
}

.table-vroom tbody tr:hover {
  background-color: #f8f9fa;
}

/* ===== 8. Form Styles ===== */
.form-control:focus,
.form-select:focus {
  border-color: var(--vroom-primary);
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

.form-label {
  font-weight: 500;
  font-size: 0.875rem;
  color: #495057;
}

/* ===== 9. Modal Styles ===== */
.modal-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
}

.modal-footer {
  background-color: #f8f9fa;
  border-top: 1px solid #dee2e6;
}

/* ===== 10. Badge & Status Styles ===== */
.badge-status {
  padding: 0.35em 0.65em;
  font-weight: 500;
  font-size: 0.75rem;
}

/* ===== 11. Tab Navigation (Pill Style) ===== */
.nav-tabs-vroom {
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-tabs-vroom .nav-link {
  border-radius: 50rem;
  padding: 0.5rem 1rem;
  font-weight: 500;
  color: #495057;
  background-color: #e9ecef;
  border: none;
  transition: all 0.2s ease;
}

.nav-tabs-vroom .nav-link:hover {
  background-color: #dee2e6;
  color: #212529;
}

.nav-tabs-vroom .nav-link.active {
  background-color: var(--vroom-primary);
  color: #fff;
}

.nav-tabs-vroom .nav-link.logout-link {
  background-color: var(--vroom-danger);
  color: #fff;
}

.nav-tabs-vroom .nav-link.logout-link:hover {
  background-color: #bb2d3b;
}

/* ===== 12. Utility Classes ===== */
.text-vroom-primary { color: var(--vroom-primary) !important; }
.text-vroom-success { color: var(--vroom-success) !important; }
.text-vroom-warning { color: var(--vroom-warning) !important; }
.text-vroom-danger { color: var(--vroom-danger) !important; }

.bg-vroom-primary { background-color: var(--vroom-primary) !important; }
.bg-vroom-success { background-color: var(--vroom-success) !important; }
.bg-vroom-warning { background-color: var(--vroom-warning) !important; }
.bg-vroom-danger { background-color: var(--vroom-danger) !important; }

/* Legacy .hidden support */
.hidden { display: none !important; }

/* ===== 13. Responsive Styles ===== */

/* Sidebar Backdrop (Mobile Overlay) */
.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.5);
  z-index: 1039;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-backdrop.show {
  opacity: 1;
  visibility: visible;
}

/* Large screens - sidebar always visible */
@media (min-width: 992px) {
  .sidebar-backdrop {
    display: none !important;
  }
  
  .vroom-sidebar {
    transform: translateX(0);
  }
}

/* Tablets and below */
@media (max-width: 991.98px) {
  .vroom-sidebar {
    transform: translateX(-100%);
    box-shadow: 0 0 20px rgba(0,0,0,0.15);
  }
  
  .vroom-sidebar.show {
    transform: translateX(0);
  }
  
  .vroom-main {
    margin-left: 0;
  }
  
  /* Improve touch targets on mobile */
  .vroom-sidebar .nav-link {
    padding: 0.875rem 1rem;
  }
  
  .vroom-sidebar .nav-link.sub-item {
    padding: 0.75rem 1rem 0.75rem 2rem;
  }
}

/* Small screens */
@media (max-width: 575.98px) {
  .vroom-topbar {
    padding: 0.5rem 1rem;
  }
  
  .vroom-content {
    padding: 1rem;
  }
  
  /* Full width sidebar on very small screens */
  .vroom-sidebar {
    width: 100%;
    max-width: 300px;
  }
}

/* ===== 14. Print Styles ===== */
@media print {
  .vroom-sidebar,
  .vroom-topbar,
  .no-print {
    display: none !important;
  }
  
  .vroom-main {
    margin-left: 0 !important;
  }
}

/* ===== 15. Animation Helpers ===== */
.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== 16. Empty State ===== */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #6c757d;
}

.empty-state i {
  font-size: 4rem;
  opacity: 0.5;
  margin-bottom: 1rem;
}

.empty-state h5 {
  color: #495057;
  margin-bottom: 0.5rem;
}

/* ===== 17. Card Section Headers ===== */
.section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #dee2e6;
}

.section-header i {
  color: var(--vroom-primary);
}

/* ===== 18. Login Page Styles ===== */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.login-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 1rem;
  box-shadow: 0 1rem 3rem rgba(0,0,0,0.175);
  max-width: 400px;
  width: 100%;
  padding: 2rem;
}

.login-logo {
  max-height: 120px;
  object-fit: contain;
}

/* ===== 19. Action Buttons (Edit, Delete, View) ===== */
.btn-action {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1.5;
}

.btn-group-action {
  gap: 0.25rem;
}

/* ===== 20. Version Footer ===== */
.version-footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.75rem;
  color: #6c757d;
  background-color: #f8f9fa;
  border-top: 1px solid #dee2e6;
}

/* ===== 21. Customer Dashboard (Tab-based Layout) ===== */
.dashboard-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.dashboard-card {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 0.75rem;
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.1);
  padding: 1.5rem;
}

.dashboard-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.dashboard-logo {
  max-height: 60px;
  object-fit: contain;
  margin-bottom: 1rem;
}

/* ===== 22. Plate Preview Styles ===== */
.plate-preview {
  border: 3px solid #212529;
  border-radius: 0.375rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #ffc107 0%, #ffca2c 100%);
  font-family: 'Arial Black', sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 2px;
  text-align: center;
  display: inline-block;
}

/* ===== 23. File Upload Styles ===== */
.file-upload-area {
  border: 2px dashed #dee2e6;
  border-radius: 0.5rem;
  padding: 2rem;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.file-upload-area:hover {
  border-color: var(--vroom-primary);
  background-color: rgba(59, 130, 246, 0.05);
}

.file-upload-area.dragover {
  border-color: var(--vroom-success);
  background-color: rgba(16, 185, 129, 0.05);
}

/* ===== 24. Toast Notifications ===== */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1100;
}

/* ===== 25. Alpine.js Integration Styles ===== */
[x-cloak] { display: none !important; }
