/* Wassamar Hotel - Custom Styles */

:root {
  --primary: #0f172a;
  --primary-foreground: #ffffff;
  --background: #ffffff;
  --foreground: #0f172a;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --border: #e2e8f0;
  --radius: 0.5rem;
  --success: #22c55e;
  --warning: #eab308;
  --danger: #ef4444;
  --info: #3b82f6;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--background);
  color: var(--foreground);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { text-decoration: none; color: inherit; }

/* Navigation */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.nav-brand svg { color: var(--primary); }

.nav-links {
  display: none;
  align-items: center;
  gap: 0.25rem;
}

.nav-links a {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: all 0.15s;
}

.nav-links a:hover { background: #f1f5f9; color: var(--foreground); }
.nav-links a.active { background: rgba(15,23,42,0.1); color: var(--primary); }

.nav-auth { display: none; align-items: center; gap: 0.75rem; }

.role-badge {
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-weight: 500;
}

.role-badge.guest { background: #dbeafe; color: #1e40af; }
.role-badge.receptionist { background: #f3e8ff; color: #7e22ce; }
.role-badge.manager { background: #fef3c7; color: #92400e; }
.role-badge.admin { background: #fee2e2; color: #991b1b; }
.role-badge.housekeeping { background: #dcfce7; color: #15803d; }
.role-badge.maintenance { background: #ffedd5; color: #9a3412; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}

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

.btn-outline { background: transparent; border-color: var(--border); color: var(--foreground); }
.btn-outline:hover { background: var(--muted); }

.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }

.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }

.btn-ghost { background: transparent; border: none; color: var(--muted-foreground); }
.btn-ghost:hover { background: var(--muted); color: var(--foreground); }

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

/* Cards */
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header { padding: 1.25rem 1.25rem 0; }
.card-title { font-size: 1.125rem; font-weight: 600; }
.card-content { padding: 1.25rem; }
.card-footer { padding: 0 1.25rem 1.25rem; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.375rem; }
.form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  transition: border-color 0.15s;
}
.form-input:focus { outline: none; border-color: var(--primary); }
.form-input::placeholder { color: var(--muted-foreground); }

select.form-input { cursor: pointer; background: white; }

textarea.form-input { min-height: 5rem; resize: vertical; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid transparent;
}

/* Status badges */
.badge-pending { background: #fef9c3; color: #854d0e; border-color: #fde047; }
.badge-confirmed { background: #dcfce7; color: #166534; border-color: #86efac; }
.badge-checked_in { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.badge-checked_out { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.badge-cancelled { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.badge-open { background: #fef9c3; color: #854d0e; }
.badge-in_progress { background: #dbeafe; color: #1e40af; }
.badge-completed { background: #dcfce7; color: #166534; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.875rem; }
.table th { font-weight: 500; color: var(--muted-foreground); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.025em; }
.table tbody tr:hover { background: var(--muted); }

/* Tabs */
.tabs-list { display: inline-flex; background: var(--muted); border-radius: var(--radius); padding: 0.25rem; gap: 0.25rem; }
.tab-btn { padding: 0.5rem 1rem; border-radius: calc(var(--radius) - 0.125rem); font-size: 0.875rem; font-weight: 500; cursor: pointer; border: none; background: transparent; color: var(--muted-foreground); transition: all 0.15s; }
.tab-btn:hover { color: var(--foreground); }
.tab-btn.active { background: white; color: var(--foreground); box-shadow: 0 1px 2px rgba(0,0,0,0.05); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Mobile Menu */
.mobile-menu-btn { display: block; padding: 0.5rem; background: none; border: none; cursor: pointer; }
.mobile-menu { display: none; border-top: 1px solid var(--border); padding: 0.75rem; }
.mobile-menu.open { display: block; }
.mobile-menu a { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; border-radius: var(--radius); font-size: 0.875rem; color: var(--muted-foreground); }
.mobile-menu a:hover, .mobile-menu a.active { background: rgba(15,23,42,0.1); color: var(--primary); }

/* Chatbot */
.chatbot-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}
.chatbot-fab:hover { transform: scale(1.05); }

.chatbot-window {
  position: fixed;
  bottom: 6rem;
  right: 1.5rem;
  z-index: 100;
  width: 380px;
  max-width: calc(100vw - 2rem);
  height: 520px;
  max-height: calc(100vh - 8rem);
  background: white;
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.chatbot-window.open { display: flex; }

.chatbot-header {
  flex-shrink: 0;
  background: linear-gradient(to right, var(--primary), rgba(15,23,42,0.8));
  color: white;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  min-height: 0;
}

.chatbot-input-area {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  padding: 0.75rem;
  background: white;
}

.chat-msg { display: flex; gap: 0.625rem; margin-bottom: 1rem; }
.chat-msg.user { flex-direction: row-reverse; }

.chat-avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.chat-msg.bot .chat-avatar { background: rgba(15,23,42,0.1); color: var(--primary); }
.chat-msg.user .chat-avatar { background: var(--muted); color: var(--muted-foreground); }

.chat-bubble {
  max-width: 80%;
  border-radius: 1rem;
  padding: 0.625rem 0.875rem;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.chat-msg.bot .chat-bubble { background: var(--muted); border-top-left-radius: 0.25rem; }
.chat-msg.user .chat-bubble { background: var(--primary); color: white; border-top-right-radius: 0.25rem; }

.chat-time { font-size: 0.625rem; margin-top: 0.25rem; }
.chat-msg.bot .chat-time { color: var(--muted-foreground); }
.chat-msg.user .chat-time { color: rgba(255,255,255,0.7); }

.chat-input-row { display: flex; gap: 0.5rem; }
.chat-input-row input { flex: 1; }

/* Toast */
.toast-container { position: fixed; top: 1rem; right: 1rem; z-index: 200; display: flex; flex-direction: column; gap: 0.5rem; }
.toast { padding: 0.75rem 1rem; border-radius: var(--radius); font-size: 0.875rem; animation: slideIn 0.3s ease; }
.toast-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.toast-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Loading */
.loading-spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Spinner overlay */
.spinner-overlay { display: flex; align-items: center; justify-content: center; padding: 3rem; }

/* Hero */
.hero { position: relative; background: linear-gradient(to bottom right, #0f172a, #1e293b, #0f172a); color: white; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0.2; }
.hero-content { position: relative; max-width: 48rem; margin: 0 auto; padding: 6rem 1rem; text-align: center; }

/* Footer */
.footer { background: var(--muted); border-top: 1px solid var(--border); margin-top: auto; }
.footer-grid { max-width: 80rem; margin: 0 auto; padding: 2rem 1rem; display: grid; grid-template-columns: 1fr; gap: 2rem; }
.footer-bottom { max-width: 80rem; margin: 0 auto; padding: 1rem 1rem; border-top: 1px solid var(--border); text-align: center; font-size: 0.875rem; color: var(--muted-foreground); }

/* Page container */
.page-container { max-width: 80rem; margin: 0 auto; padding: 2rem 1rem; }

/* Grid */
.grid-1 { display: grid; gap: 1.5rem; }
.grid-2 { display: grid; gap: 1.5rem; grid-template-columns: repeat(1, 1fr); }
.grid-3 { display: grid; gap: 1.5rem; grid-template-columns: repeat(1, 1fr); }
.grid-4 { display: grid; gap: 1rem; grid-template-columns: repeat(2, 1fr); }

/* KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-bottom: 2rem; }
.kpi-card .kpi-value { font-size: 1.5rem; font-weight: 700; }
.kpi-card .kpi-label { font-size: 0.8125rem; color: var(--muted-foreground); }

/* Responsive */
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 768px) {
  .nav-links { display: flex; }
  .nav-auth { display: flex; }
  .mobile-menu-btn { display: none; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 767px) {
  .chatbot-window { width: calc(100vw - 2rem); right: 1rem; }
  .chatbot-fab { bottom: 1rem; right: 1rem; }
}

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

/* Animations */
.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Link hover */
.link-hover { color: var(--muted-foreground); transition: color 0.15s; }
.link-hover:hover { color: var(--foreground); }

/* Section header */
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header h2 { font-size: 1.875rem; font-weight: 700; margin-bottom: 0.75rem; }
.section-header p { color: var(--muted-foreground); max-width: 36rem; margin: 0 auto; }

/* Auth pages */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(to bottom, var(--background), var(--muted)); padding: 1rem; }
.auth-box { width: 100%; max-width: 28rem; }
.auth-card { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }

/* Login quick buttons */
.quick-login-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }

/* Image aspect ratio */
.aspect-4-3 { aspect-ratio: 4/3; }
.aspect-16-9 { aspect-ratio: 16/9; }
.img-cover { width: 100%; height: 100%; object-fit: cover; }

/* Gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(1, 1fr); gap: 1rem; }
@media (min-width: 640px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }

.gallery-item { cursor: pointer; border-radius: var(--radius); overflow: hidden; transition: transform 0.2s; }
.gallery-item:hover { transform: scale(1.02); }

/* Lightbox */
.lightbox { display: none; position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,0.9); align-items: center; justify-content: center; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 90%; max-height: 80vh; object-fit: contain; }
.lightbox-close { position: absolute; top: 1rem; right: 1rem; color: white; background: none; border: none; font-size: 2rem; cursor: pointer; }

/* ============================================================
   Role-based Dashboard Layout (sidebar + main)
   ============================================================ */
.dash-layout { display: flex; width: 100%; min-height: 100vh; }

.dash-sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--primary);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.dash-sidebar-brand {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 1.15rem 1.25rem;
  font-weight: 700; font-size: 1.05rem; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.dash-sidebar-brand svg { color: #fff; }
.dash-user { padding: 1rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,0.08); }
.dash-user-name { color: #fff; font-weight: 600; font-size: 0.9rem; }
.dash-user-email { color: #94a3b8; font-size: 0.75rem; margin-top: 0.15rem; word-break: break-all; }
.dash-nav { flex: 1; overflow-y: auto; padding: 0.75rem; display: flex; flex-direction: column; gap: 0.125rem; }
.dash-nav-item {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius);
  color: #cbd5e1; font-size: 0.875rem; font-weight: 500;
  cursor: pointer; border: none; background: transparent;
  width: 100%; text-align: left; transition: all 0.15s;
}
.dash-nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.dash-nav-item.active { background: #fff; color: var(--primary); }
.dash-nav-item svg { flex-shrink: 0; }
.dash-sidebar-footer { padding: 0.75rem; border-top: 1px solid rgba(255,255,255,0.08); display: flex; flex-direction: column; gap: 0.125rem; }

.dash-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #f8fafc; }
.dash-topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,0.95); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.25rem; height: 4rem;
}
.dash-topbar-title { font-size: 1.1rem; font-weight: 700; }
.dash-content { padding: 1.5rem; flex: 1; }
.dash-section { display: none; }
.dash-section.active { display: block; animation: fadeIn 0.25s ease; }
.dash-section-head { margin-bottom: 1.25rem; }
.dash-section-head h2 { font-size: 1.4rem; font-weight: 700; }
.dash-section-head p { color: var(--muted-foreground); font-size: 0.9rem; margin-top: 0.15rem; }

.dash-sidebar-toggle { display: none; }
.dash-backdrop { display: none; }

/* Quick action tiles */
.qa-grid { display: grid; grid-template-columns: repeat(1, 1fr); gap: 1rem; }
.qa-tile {
  display: flex; flex-direction: column; gap: 0.6rem;
  padding: 1.25rem; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; text-align: left; transition: all 0.15s; width: 100%;
}
.qa-tile:hover { box-shadow: 0 6px 18px rgba(0,0,0,0.08); transform: translateY(-2px); }
.qa-tile .qa-icon {
  width: 2.5rem; height: 2.5rem; border-radius: 0.6rem;
  background: var(--muted); display: flex; align-items: center; justify-content: center; color: var(--primary);
}
.qa-tile .qa-title { font-weight: 600; font-size: 0.95rem; }
.qa-tile .qa-desc { font-size: 0.8rem; color: var(--muted-foreground); }

@media (min-width: 640px) { .qa-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .qa-grid { grid-template-columns: repeat(4, 1fr); } }

/* Mobile sidebar */
@media (max-width: 900px) {
  .dash-sidebar {
    position: fixed; left: 0; top: 0; z-index: 60;
    transform: translateX(-100%); transition: transform 0.2s;
    box-shadow: 0 0 40px rgba(0,0,0,0.25);
  }
  .dash-sidebar.open { transform: translateX(0); }
  .dash-sidebar-toggle { display: inline-flex; }
  .dash-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 55; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-foreground); }
