/* Import Google Fonts - Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Colors */
  --bg-primary: #f4f6f9;
  --bg-card: #ffffff;
  --text-main: #2c3e50;
  --text-muted: #7f8c8d;
  --border-color: #e2e8f0;
  
  /* Status Colors (KiotViet & Modern palettes) */
  --color-available: #10b981; /* Emerald Green */
  --color-available-bg: #ecfdf5;
  --color-occupied: #3b82f6; /* Modern Blue */
  --color-occupied-bg: #eff6ff;
  --color-booked: #f59e0b; /* Amber Orange */
  --color-booked-bg: #fffbeb;
  --color-dirty: #ef4444; /* Rose Red (using dirty/unclean) */
  --color-dirty-bg: #fff1f2;
  
  /* Brand colors */
  --primary: #4f46e5; /* Victoria Hostel Indigo */
  --primary-hover: #4338ca;
  --primary-light: #e0e7ff;
  
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #06b6d4;
  
  /* Layout specifications */
  --sidebar-width: 280px;
  --header-height: 70px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius: 12px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow: hidden;
}

/* App Container Layout */
.app-container {
  display: flex;
  width: 100%;
  height: 100vh;
}

/* Sidebar Styling */
.sidebar {
  width: var(--sidebar-width);
  background-color: #ffffff;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  z-index: 10;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-header img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.sidebar-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.sidebar-section {
  margin-bottom: 24px;
}

.sidebar-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 12px;
}

/* Search Box */
.search-box {
  position: relative;
  margin-bottom: 15px;
}

.search-box input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.875rem;
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Quick Filter Tags */
.filter-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  border: 1px solid transparent;
}

.filter-item:hover {
  background-color: var(--bg-primary);
}

.filter-item.active {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: rgba(0, 139, 68, 0.2);
}

.filter-count {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 10px;
  background-color: var(--border-color);
  color: var(--text-main);
  font-weight: 600;
}

.filter-item.active .filter-count {
  background-color: var(--primary);
  color: white;
}

/* Status Color Badges for Filter list */
.filter-item[data-status="all"]::before { content: '🏨'; margin-right: 8px; }
.filter-item[data-status="available"]::before { content: '🟢'; margin-right: 8px; }
.filter-item[data-status="occupied"]::before { content: '🔵'; margin-right: 8px; }
.filter-item[data-status="booked"]::before { content: '🟡'; margin-right: 8px; }
.filter-item[data-status="dirty"]::before { content: '🔴'; margin-right: 8px; }

/* Main Workspace */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Top Header Bar */
.top-header {
  height: var(--header-height);
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  flex-shrink: 0;
}

.header-title-section h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
}

.header-title-section p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Dashboard Summary Indicators on Top Header */
.status-indicators {
  display: flex;
  gap: 15px;
  margin-right: 20px;
}

.indicator-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
}

.indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.indicator-dot.available { background-color: var(--color-available); }
.indicator-dot.occupied { background-color: var(--color-occupied); }
.indicator-dot.booked { background-color: var(--color-booked); }
.indicator-dot.dirty { background-color: var(--color-dirty); }

/* Buttons */
.btn {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  outline: none;
}

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

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

.btn-secondary {
  background-color: white;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

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

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

.btn-danger:hover {
  background-color: #dc2626;
}

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

.btn-warning:hover {
  background-color: #d97706;
}

/* Floor Grid Section */
.grid-container {
  flex: 1;
  overflow-y: auto;
  padding: 30px;
}

.floor-section {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.floor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.floor-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.floor-stats {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

/* Room Card Design */
.room-card {
  border-radius: 10px;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  padding: 16px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  overflow: hidden;
}

.room-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
}

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

/* Room Card States Styling */
.room-card.available::after { background-color: var(--color-available); }
.room-card.available:hover { border-color: var(--color-available); }
.room-card.available { background-color: var(--color-available-bg); }

.room-card.occupied::after { background-color: var(--color-occupied); }
.room-card.occupied:hover { border-color: var(--color-occupied); }
.room-card.occupied { background-color: var(--color-occupied-bg); }

.room-card.booked::after { background-color: var(--color-booked); }
.room-card.booked:hover { border-color: var(--color-booked); }
.room-card.booked { background-color: var(--color-booked-bg); }

.room-card.dirty::after { background-color: var(--color-dirty); }
.room-card.dirty:hover { border-color: var(--color-dirty); }
.room-card.dirty { background-color: var(--color-dirty-bg); }

/* Room Info Elements */
.room-header-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.room-number {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
}

.room-status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
}

.room-card.available .room-status-badge {
  background-color: var(--color-available);
  color: white;
}
.room-card.occupied .room-status-badge {
  background-color: var(--color-occupied);
  color: white;
}
.room-card.booked .room-status-badge {
  background-color: var(--color-booked);
  color: white;
}
.room-card.dirty .room-status-badge {
  background-color: var(--color-dirty);
  color: white;
}

.room-body-info {
  margin: 12px 0;
  flex-grow: 1;
}

.guest-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stay-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.room-footer-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed rgba(0,0,0,0.06);
  padding-top: 8px;
  font-size: 0.8rem;
}

.bill-amount {
  font-weight: 700;
  color: #e11d48;
}

/* Modals Overlay and Box */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background-color: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-box {
  transform: scale(1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  transition: var(--transition);
}

.modal-close-btn:hover {
  color: var(--danger);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex-grow: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background-color: #f8fafc;
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}

/* Form Styles */
.form-group {
  margin-bottom: 16px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #475569;
}

input[type="text"],
input[type="number"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.875rem;
  outline: none;
  transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* Service Selection Styling inside Service Modal */
.service-list-container {
  max-height: 250px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 15px;
}

.service-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.service-item-row:last-child {
  border-bottom: none;
}

.service-info {
  display: flex;
  flex-direction: column;
}

.service-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e293b;
}

.service-price {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.service-quantity-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: #f1f5f9;
  border: 1px solid var(--border-color);
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

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

.qty-val {
  font-size: 0.875rem;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

/* Active Bill / Service Summary in checkout */
.checkout-summary {
  background-color: #f8fafc;
  border-radius: 8px;
  padding: 16px;
  border: 1px solid var(--border-color);
  margin-bottom: 15px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.875rem;
}

.summary-row:last-child {
  margin-bottom: 0;
  padding-top: 10px;
  border-top: 1px dashed var(--border-color);
  font-weight: 700;
  font-size: 1rem;
}

.summary-row.total-row {
  color: #e11d48;
}

.selected-services-badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.service-badge {
  background-color: var(--primary-light);
  color: var(--primary);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* History log styling */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  background-color: white;
  font-size: 0.8rem;
}

.history-card-header {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 6px;
  margin-bottom: 6px;
}

.history-card-footer {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #f1f5f9;
}

.history-price {
  font-weight: 700;
  color: var(--primary);
}

/* Custom Notification Toast */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #1e293b;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-success {
  border-left: 4px solid var(--color-available);
}

.toast-info {
  border-left: 4px solid var(--color-occupied);
}

/* Print Invoice Styles */
@media print {
  body * {
    visibility: hidden;
  }
  #print-area, #print-area * {
    visibility: visible;
  }
  #print-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background-color: white;
    color: black;
    padding: 20px;
  }
  .no-print {
    display: none !important;
  }
}

/* Printable Bill Container (hidden by default) */
#print-area {
  display: none;
}
