/* Hotel Dashboard Design System - Professional Blue Theme */

:root {
  /* Core Brand Colors */
  --background: hsl(220, 13%, 97%);
  --foreground: hsl(215, 25%, 27%);
  
  /* Brand Primary - Professional Blue */
  --primary: hsl(217, 91%, 60%);
  --primary-light: hsl(217, 91%, 70%);
  --primary-dark: hsl(217, 91%, 45%);
  --primary-glow: hsl(217, 91%, 85%);
  --primary-foreground: hsl(0, 0%, 98%);
  
  /* Success/Warning/Error States */
  --success: hsl(142, 76%, 36%);
  --success-light: hsl(142, 76%, 91%);
  --warning: hsl(43, 96%, 56%);
  --warning-light: hsl(43, 96%, 93%);
  --error: hsl(0, 84%, 60%);
  --error-light: hsl(0, 84%, 95%);
  
  /* Neutral Grays */
  --surface: hsl(0, 0%, 100%);
  --surface-hover: hsl(220, 13%, 95%);
  --border-light: hsl(220, 13%, 91%);
  --text-muted: hsl(215, 16%, 47%);
  
  /* Dashboard Specific */
  --sidebar-bg: hsl(217, 33%, 17%);
  --sidebar-hover: hsl(217, 33%, 22%);
  --sidebar-active: hsl(217, 91%, 60%);
  --metric-card: hsl(0, 0%, 100%);
  
  /* Shadows */
  --shadow-card: 0 4px 6px -1px hsl(220, 13%, 69%, 0.1), 0 2px 4px -1px hsl(220, 13%, 69%, 0.06);
  --shadow-hover: 0 10px 15px -3px hsl(220, 13%, 69%, 0.1), 0 4px 6px -2px hsl(220, 13%, 69%, 0.05);
  
  /* Transitions */
  --transition-smooth: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
}

/* Layout */
.dashboard-layout {
  min-height: 100vh;
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background-color: var(--sidebar-bg);
  color: white;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  height: 100vh;
  flex-shrink: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  transition: var(--transition-smooth);
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--sidebar-hover);
}

.sidebar-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: white;
}

.sidebar-nav {
  padding: 1rem 0;
  flex: 1;
}

.nav-list {
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: var(--transition-smooth);
}

.nav-link:hover {
  background-color: var(--sidebar-hover);
  color: white;
}

.nav-link.active {
  background-color: var(--sidebar-active);
  color: white;
}

.nav-link svg {
  width: 20px;
  height: 20px;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.header {
  background-color: var(--surface);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-actions .btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 6px;
  transition: var(--transition-smooth);
}

.header-actions .btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.header-actions .btn-outline-secondary {
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  background: transparent;
}

.header-actions .btn-outline-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border);
}

.header-actions .btn-outline-primary {
  color: var(--primary);
  border: 1px solid var(--primary);
  background: transparent;
}

.header-actions .btn-outline-primary:hover {
  background: var(--primary);
  color: white;
}

#app-version {
  font-weight: 500;
  opacity: 0.8;
}

#page-title {
  font-size: 1.875rem;
  font-weight: 600;
  color: var(--foreground);
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  margin-left: auto;
}

/* Content Area */
.content-wrapper {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  position: relative;
  background-color: var(--background);
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
}

/* Custom scrollbar for webkit browsers */
.content-wrapper::-webkit-scrollbar {
  width: 8px;
}

.content-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.content-wrapper::-webkit-scrollbar-thumb {
  background-color: var(--border-light);
  border-radius: 4px;
  transition: var(--transition-smooth);
}

.content-wrapper::-webkit-scrollbar-thumb:hover {
  background-color: var(--text-muted);
}

/* Views */
.view {
  display: none;
  width: 100%;
  min-height: calc(100vh - 200px);
  animation: fadeIn 0.3s ease-in-out;
}

.view.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.page-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--foreground);
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.metric-card {
  background-color: var(--surface);
  border-radius: 1rem;
  border: 1px solid var(--border-light);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.metric-card-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--primary-foreground);
  border: none;
}

.metric-card-success {
  background: linear-gradient(135deg, var(--success), hsl(142, 76%, 30%));
  color: white;
  border: none;
}

.metric-card-info {
  background: linear-gradient(135deg, hsl(217, 91%, 60%), hsl(217, 91%, 45%));
  color: white;
  border: none;
}

.metric-card-secondary {
  background: linear-gradient(135deg, hsl(215, 16%, 47%), hsl(215, 16%, 37%));
  color: white;
  border: none;
}

.metric-card-warning {
  background: linear-gradient(135deg, var(--warning), hsl(43, 96%, 46%));
  color: white;
  border: none;
}

.metric-card-purple {
  background: linear-gradient(135deg, hsl(262, 83%, 58%), hsl(262, 83%, 48%));
  color: white;
  border: none;
}

.metric-content {
  flex: 1;
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.metric-label {
  font-size: 0.875rem;
  opacity: 0.8;
}

.metric-icon {
  opacity: 0.8;
}

.metric-icon svg {
  width: 32px;
  height: 32px;
}

/* Charts */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.chart-card {
  background-color: var(--surface);
  border-radius: 0.5rem;
  border: 1px solid var(--border-light);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

.chart-card h3 {
  margin-bottom: 1rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--foreground);
}

/* Fix chart canvas sizing to prevent overflow and giant heights */
.chart-card {
  position: relative;
}

.chart-card canvas {
  display: block;
  width: 100% !important;
  height: 320px !important;
}

/* Tables */
.table-container {
  background-color: var(--surface);
  border-radius: 1rem;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background-color: var(--surface-hover);
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--foreground);
  border-bottom: 1px solid var(--border-light);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--foreground);
}

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

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Filters Section */
.filters-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 300px;
}

.search-box input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
  background-color: var(--surface);
  color: var(--foreground);
  font-size: 0.875rem;
}

.search-box span {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.results-info {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.pagination button {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-light);
  background-color: var(--surface);
  color: var(--foreground);
  border-radius: 0.375rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.pagination button:hover {
  background-color: var(--surface-hover);
}

.pagination button.active {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Loading Spinner */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .dashboard-layout {
    height: 100vh;
    overflow: hidden;
  }
  
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s ease;
  }
  
  .sidebar.open {
    left: 0;
  }
  
  .main-content {
    width: 100%;
    height: 100vh;
    overflow: hidden;
  }
  
  .header-content {
    padding: 1rem;
  }
  
  .content-wrapper {
    padding: 1rem;
    height: calc(100vh - 80px); /* Adjust based on header height */
  }
  
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  
  .charts-grid {
    grid-template-columns: 1fr;
  }
  
  .filters-section {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-box {
    min-width: auto;
  }
  
  .table-container {
    overflow-x: auto;
  }
}