/* Admin Dashboard CSS - Hubstaff Inspired Color Scheme */

/* Color Palette Variables */
:root {
  --primary-color: #294DFF;
  --secondary-color: #C900E9;
  --dark-navy: #12192F;
  --text-dark: #253053;
  --text-light: #636B83;
  --light-blue: #F2F8FF;
  --success-color: #1CC88A;
  --warning-color: #F6C23E;
  --info-color: #36B9CC;
  --danger-color: #E74A3B;
  --light-gray: #F8F9FA;
  --white: #FFFFFF;
}

/* Global Body Styles */
body {
  background-color: var(--light-gray);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-dark);
}

/* Main Content Area */
main {
  background-color: var(--light-gray);
  min-height: calc(100vh - 72px);
  transition: margin-left 0.3s ease, opacity 0.2s ease;
  margin-left: 60px;
  flex: 1 !important;
  max-width: none !important;
  width: auto !important;
}

main.sidebar-expanded {
  margin-left: 250px;
}

/* Disable transitions during page load to prevent visual "reopening" */
main.no-transition {
  transition: none !important;
}

/* Login Page Styles */
.login-container {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
}

.login-card .card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.login-icon {
  font-size: 3rem;
  color: var(--primary-color);
}

.btn-login {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  border: none;
  padding: 12px 20px;
  font-weight: 600;
  transition: all 0.3s ease;
  border-radius: 8px;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(41, 77, 255, 0.4);
}

.btn-login:disabled {
  transform: none;
  box-shadow: none;
  opacity: 0.7;
}

.login-spinner {
  width: 1rem !important;
  height: 1rem !important;
}

/* Sidebar Styles */
.sidebar {
  position: fixed;
  top: 72px;
  bottom: 0;
  left: 0;
  z-index: 100;
  padding: 0;
  background-color: var(--white);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.08);
  border-right: 1px solid #E3E6F0;
  transition: width 0.3s ease;
  overflow-x: hidden;
  width: 60px;
}

/* Disable transitions during page load to prevent visual "reopening" */
.sidebar.no-transition {
  transition: none !important;
}

.sidebar.no-transition * {
  transition: none !important;
}

.sidebar.expanded {
  width: 250px;
}

.sidebar-toggle-wrapper {
  display: flex;
  justify-content: flex-end;
  padding: 0.5rem 1rem;
  border-top: 1px solid #E3E6F0;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--white);
}

.sidebar-toggle-btn {
  background: none;
  border: none;
  color: var(--text-dark);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle-btn:hover {
  background-color: var(--light-blue);
  color: var(--primary-color);
}

.sidebar-toggle-btn i {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.sidebar:not(.expanded) .sidebar-toggle-btn i {
  transform: rotate(180deg);
}

.sidebar .nav-link {
  color: var(--text-dark);
  font-weight: 500;
  padding: 1rem 1.5rem;
  border-radius: 0;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.sidebar .nav-link:hover {
  background-color: var(--light-blue);
  color: var(--primary-color);
  border-left-color: var(--primary-color);
}

.sidebar .nav-link.active {
  background-color: var(--light-blue);
  color: var(--primary-color);
  border-left-color: var(--primary-color);
  font-weight: 600;
}

.sidebar .nav-link i {
  margin-right: 0.75rem;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar .nav-text {
  transition: opacity 0.3s ease;
}

.sidebar:not(.expanded) .nav-link {
  padding: 1rem 0.5rem;
  justify-content: center;
}

.sidebar:not(.expanded) .nav-link i {
  margin-right: 0;
  font-size: 1.2rem;
}

.sidebar:not(.expanded) .nav-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

/* Dashboard Cards */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  background-color: var(--white) !important;
  color: var(--text-dark) !important;
}

.card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.card-body {
  background-color: var(--white) !important;
  color: var(--text-dark) !important;
}

.card-footer {
  background-color: var(--light-gray) !important;
  color: var(--text-dark) !important;
  border-top: 1px solid #e3e6f0;
}

.card.border-left-primary {
  border-left: 4px solid var(--primary-color) !important;
}

.card.border-left-success {
  border-left: 4px solid var(--success-color) !important;
}

.card.border-left-info {
  border-left: 4px solid var(--info-color) !important;
}

.card.border-left-warning {
  border-left: 4px solid var(--warning-color) !important;
}

.text-xs {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-info { color: var(--info-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--danger-color) !important; }

.text-gray-300 {
  color: var(--text-light) !important;
}

.text-gray-800 {
  color: var(--text-dark) !important;
}

/* Table Styles */
.table-responsive {
  border-radius: 0.35rem;
  background-color: var(--white) !important;
}

.table {
  background-color: var(--white) !important;
  color: var(--text-dark) !important;
}

.table th {
  border-top: none;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  background-color: var(--light-gray) !important;
  color: var(--text-dark) !important;
  border-bottom: 2px solid #e3e6f0;
}

.table td {
  background-color: var(--white) !important;
  color: var(--text-dark) !important;
  border-bottom: 1px solid #e3e6f0;
  vertical-align: middle;
}

.table tbody tr:hover {
  background-color: var(--light-blue) !important;
}

/* Override Bootstrap table-dark with light theme */
.table-dark th,
.table-dark td {
  background-color: var(--light-gray) !important;
  color: var(--text-dark) !important;
  border-color: #e3e6f0 !important;
}

.avatar-sm {
  width: 40px;
  height: 40px;
  font-size: 1rem;
  font-weight: 600;
}

/* Pagination */
.pagination-sm .page-link {
  padding: 0.375rem 0.75rem;
}

.page-item.active .page-link {
  background-color: #007bff;
  border-color: #007bff;
}

/* Search Form */
.card-header {
  background-color: var(--light-gray) !important;
  font-weight: 600;
  color: var(--text-dark) !important;
  border-bottom: 1px solid #e3e6f0;
}

/* Button Styles */
.btn {
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  border: none;
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1e3dff 0%, #b800d1 100%);
}

.btn-outline-primary {
  color: var(--primary-color);
  border-color: var(--primary-color);
  background-color: transparent;
}

.btn-outline-primary:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

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

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

.btn-warning {
  background-color: var(--warning-color);
  border-color: var(--warning-color);
  color: var(--text-dark);
}

.btn-group-sm > .btn, .btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.875rem;
  border-radius: 6px;
}

/* Form Styles */
.form-control {
  border: 2px solid #E3E6F0;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(41, 77, 255, 0.15);
}

.form-label {
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.input-group-text {
  background-color: var(--light-blue);
  border: 2px solid #E3E6F0;
  color: var(--primary-color);
}

.form-select {
  border: 2px solid #E3E6F0;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
}

.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(41, 77, 255, 0.15);
}

/* Flash Messages */
.alert {
  border: none;
  border-radius: 10px;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.alert-success {
  background-color: rgba(28, 200, 138, 0.1);
  color: var(--success-color);
  border-left: 4px solid var(--success-color);
}

.alert-danger {
  background-color: rgba(231, 74, 59, 0.1);
  color: var(--danger-color);
  border-left: 4px solid var(--danger-color);
}

.alert-info {
  background-color: rgba(54, 185, 204, 0.1);
  color: var(--info-color);
  border-left: 4px solid var(--info-color);
}

.alert-warning {
  background-color: rgba(246, 194, 62, 0.1);
  color: var(--warning-color);
  border-left: 4px solid var(--warning-color);
}

.alert-dismissible .btn-close {
  padding: 0.75rem 1rem;
}

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

/* Responsive Design */

/* Smaller PC screens (tablets in landscape and small desktops) */
@media (max-width: 1200px) and (min-width: 769px) {
  /* Adjust sidebar width */
  .sidebar {
    width: 180px !important;
  }

  .col-md-3.col-lg-2 {
    flex: 0 0 180px !important;
    max-width: 180px !important;
  }

  .col-md-9.col-lg-10 {
    flex: 0 0 calc(100% - 180px) !important;
    max-width: calc(100% - 180px) !important;
  }

  /* Make sidebar links more compact */
  .sidebar .nav-link {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  .sidebar .nav-link i {
    margin-right: 0.5rem;
  }

  /* Adjust navbar */
  .navbar-brand {
    font-size: 1.1rem;
  }

  /* Make cards more compact */
  .card-body {
    padding: 1rem !important;
  }

  .card-header {
    padding: 0.75rem 1rem !important;
    font-size: 0.95rem;
  }

  /* Reduce padding in main content */
  main.px-md-4 {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }

  /* Make stat cards smaller */
  .h5 {
    font-size: 1.1rem !important;
  }

  .text-xs {
    font-size: 0.7rem;
  }

  /* Compact tables */
  .table {
    font-size: 0.85rem;
  }

  .table th,
  .table td {
    padding: 0.5rem !important;
  }

  /* Adjust button sizes */
  .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }

  /* Compact form elements */
  .form-control,
  .form-select {
    padding: 0.5rem 0.7rem;
    font-size: 0.875rem;
  }

  /* Smaller dashboard metric cards */
  .col-xl-3,
  .col-xl-4 {
    min-width: 250px;
  }

  /* Make progress bars in tables more compact */
  .progress {
    height: 18px !important;
  }

  /* Adjust modal sizes */
  .modal-dialog {
    max-width: 90%;
  }
}

/* Medium screens adjustment */
@media (max-width: 992px) and (min-width: 769px) {
  /* Stack cards on medium screens */
  .col-lg-6 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }

  /* Full width slot behavior section */
  .col-lg-12 {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  /* Adjust metric cards to 2 per row on medium screens */
  .col-xl-3,
  .col-xl-4 {
    flex: 0 0 50% !important;
    max-width: 50% !important;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: relative;
    top: 0;
    height: auto;
  }

  .sidebar,
  .sidebar.expanded {
    width: 100% !important;
  }

  .sidebar-toggle-wrapper {
    display: none;
  }

  main,
  main.sidebar-expanded {
    margin-left: 0 !important;
    max-width: 100% !important;
  }

  .login-card {
    margin: 10px;
  }

  .table-responsive {
    font-size: 0.875rem;
  }
}

/* Custom Utilities */
.font-weight-bold {
  font-weight: 700 !important;
}

.shadow {
  box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15) !important;
}

.shadow-sm {
  box-shadow: 0 0.125rem 0.25rem 0 rgba(58, 59, 69, 0.2) !important;
}

/* Navbar Styles */
.navbar {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #E3E6F0;
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--white);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.navbar-brand:hover {
  color: var(--primary-color);
}

.navbar-brand i {
  margin-right: 0.75rem;
  color: var(--primary-color);
  font-size: 1.3rem;
  flex-shrink: 0;
}

.navbar-nav .nav-link {
  color: var(--text-dark);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.navbar-nav .nav-link:hover {
  color: var(--primary-color);
  background-color: var(--light-blue);
}

.dropdown-menu {
  border: none;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  padding: 0.5rem 0;
}

.dropdown-item {
  padding: 0.75rem 1.5rem;
  color: var(--text-dark);
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background-color: var(--light-blue);
  color: var(--primary-color);
}

/* Modal Styles */
.modal-content {
  background-color: var(--white) !important;
  color: var(--text-dark) !important;
  border: none;
  border-radius: 12px;
}

.modal-header {
  background-color: var(--light-gray) !important;
  border-bottom: 1px solid #e3e6f0;
  color: var(--text-dark) !important;
}

.modal-body {
  background-color: var(--white) !important;
  color: var(--text-dark) !important;
}

.modal-footer {
  background-color: var(--white) !important;
  color: var(--text-dark) !important;
  border-top: 1px solid #e3e6f0;
}

.modal-title i {
  margin-right: 0.5rem;
  color: #007bff;
}

/* Badge Styles */
.badge {
  font-size: 0.75em;
  font-weight: 600;
}

.verification-badge {
  font-size: 0.7rem;
  padding: 0.35rem 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.verification-badge i {
  font-size: 0.75rem;
}

/* Verification Icon Styles */
.verification-icon {
  font-size: 1.25rem;
  cursor: help;
}

.verification-icon.verified {
  color: var(--success-color);
}

.verification-icon.not-verified {
  color: #6c757d;
  opacity: 0.5;
}

/* Visitor ID Cell - Adaptive for smaller screens */
.visitor-id-cell {
  display: inline-block;
  max-width: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: help;
}

/* Responsive truncation for smaller screens */
@media (max-width: 1400px) {
  .visitor-id-cell {
    max-width: 150px;
  }
}

@media (max-width: 1200px) {
  .visitor-id-cell {
    max-width: 120px;
  }
}

@media (max-width: 992px) {
  .visitor-id-cell {
    max-width: 100px;
  }
}

@media (max-width: 768px) {
  .visitor-id-cell {
    max-width: 80px;
  }
}

/* Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  animation: fadeIn 0.5s ease-out;
}

/* List Group Styles */
.list-group {
  background-color: var(--white) !important;
}

.list-group-item {
  background-color: var(--white) !important;
  color: var(--text-dark) !important;
  border: 1px solid #e3e6f0;
}

.list-group-item:hover {
  background-color: var(--light-blue) !important;
  color: var(--primary-color) !important;
}

/* Progress Bar Styles */
.progress {
  background-color: #e3e6f0 !important;
}

/* Badge overrides for better contrast */
.bg-light {
  background-color: var(--light-gray) !important;
  color: var(--text-dark) !important;
}

/* Ensure all text elements are visible */
.text-muted {
  color: var(--text-light) !important;
}

/* Override any Bootstrap dark mode preferences */
* {
  color-scheme: light !important;
}

/* Force light theme always - no dark mode support */
html, body {
  background-color: var(--light-gray) !important;
  color: var(--text-dark) !important;
}

/* Override any potential dark theme from Bootstrap or other sources */
@media (prefers-color-scheme: dark) {
  html, body {
    background-color: var(--light-gray) !important;
    color: var(--text-dark) !important;
  }
  
  .card, .card-body, .card-header, .card-footer {
    background-color: var(--white) !important;
    color: var(--text-dark) !important;
  }
  
  .table, .table th, .table td {
    background-color: var(--white) !important;
    color: var(--text-dark) !important;
  }
  
  .modal-content, .modal-body, .modal-header, .modal-footer {
    background-color: var(--white) !important;
    color: var(--text-dark) !important;
  }
}