/* ============================================
   Espace Colibri — Dark Cowork Theme
   ============================================ */

/* --- Reset & Variables --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --bg-card-hover: #273548;
  --bg-input: #0f172a;
  --border: #334155;
  --border-light: #475569;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --accent-light: rgba(245, 158, 11, 0.15);
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.15);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.15);
  --warning-bg: rgba(245, 158, 11, 0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
  --transition: 0.2s ease;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --container: 1200px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; }

/* --- Container --- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; width: 100%; }

/* --- Navbar --- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0;
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.navbar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.navbar-brand:hover { color: var(--accent); }
.navbar-logo { height: 56px; width: auto; }
.navbar-links { display: flex; align-items: center; gap: 1.5rem; list-style: none; }
.navbar-links a { color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; }
.navbar-links a:hover { color: var(--text-primary); }
.navbar-links a.btn-primary { color: #0f172a; }
.navbar-links a.btn-primary:hover { color: #0f172a; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: #0f172a;
}
.btn-primary:hover { background: var(--accent-hover); color: #0f172a; }
.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-card-hover); border-color: var(--border-light); color: var(--text-primary); }
.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-outline:hover { background: var(--accent-light); color: var(--accent); }
.btn-sm { padding: 0.35rem 0.9rem; font-size: 0.8rem; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }

button[type="submit"] {
  background: var(--accent);
  color: #0f172a;
  padding: 0.65rem 1.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}
button[type="submit"]:hover { background: var(--accent-hover); }

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
}
.card:hover { border-color: var(--border-light); box-shadow: var(--shadow-sm); }
.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}
.card-body { padding: 1.25rem; }
.card-body h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.4rem; }
.card-body h3 a { color: var(--text-primary); }
.card-body h3 a:hover { color: var(--accent); }
.card-body p { color: var(--text-secondary); font-size: 0.9rem; }
.card-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

/* --- Reserve sticky bar --- */
.reserve-sticky-bar {
  position: sticky;
  bottom: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 1rem 0;
  margin: 0 -1.5rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  z-index: 10;
}
.reserve-sticky-bar button {
  width: 100%;
}

/* --- Inactive room --- */
.card-inactive { opacity: 0.45; filter: grayscale(0.8); pointer-events: none; }
.card-inactive .card-footer { pointer-events: auto; }
.room-inactive-banner {
  background: var(--danger-bg);
  color: var(--danger);
  text-align: center;
  padding: 0.6rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
}

/* --- Slider --- */
.slider {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 200px;
}
.slider-track {
  display: flex;
  height: 100%;
  transition: transform 0.35s ease;
}
.slider-track img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  flex: 0 0 100%;
}
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  line-height: 1;
}
.slider-btn:hover { background: rgba(15, 23, 42, 0.9); }
.slider-prev { left: 8px; }
.slider-next { right: 8px; }
.slider-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 3;
}
.slider-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background var(--transition);
}
.slider-dot.active { background: #fff; }
/* Slider link wrapper */
.slider-link { display: block; color: inherit; }
.slider-link:hover { color: inherit; }
.slider-wrapper { position: relative; overflow: hidden; }
.slider-wrapper .slider-btn,
.slider-wrapper .slider-dots { z-index: 5; }

/* Single image: hide controls */
.slider[data-count="1"] .slider-btn,
.slider[data-count="1"] .slider-dots { display: none; }

/* Room hero slider (taller) */
.room-hero .slider { height: 100%; }

/* --- Admin image gallery --- */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.image-gallery-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 4/3;
}
.image-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-gallery-delete {
  position: absolute;
  top: 4px;
  right: 4px;
}
.image-gallery-delete .btn {
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  border-radius: 50%;
}

/* File input styling */
input[type="file"] {
  width: 100%;
  padding: 0.5rem;
  background: var(--bg-input);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
}

/* --- Hero --- */
.hero {
  position: relative;
  height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  margin-bottom: 3rem;
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(15,23,42,0.6), rgba(15,23,42,0.9));
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  padding: 0 1.5rem;
}
.hero-content h1 {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
}
.hero-content p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
}
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* --- Section headings --- */
.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.section-subtitle {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* --- Grid --- */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.grid-cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* --- Forms --- */
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.9rem;
  transition: border-color var(--transition);
  margin-bottom: 1rem;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
textarea { min-height: 100px; resize: vertical; }

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* --- Tables --- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}
th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.table-sticky-header th {
  position: sticky;
  top: 64px; /* navbar height */
  background: var(--bg-card);
  z-index: 10;
}
tr:hover { background: rgba(255,255,255,0.02); }
tr.row-past { opacity: 0.35; }
tr.row-past input[type="checkbox"] { cursor: not-allowed; }
tr.row-highlight { animation: rowPulse 2s ease; }
@keyframes rowPulse {
  0%, 40% { background: var(--accent-light); }
  100% { background: transparent; }
}

/* --- Calendar grid --- */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin: 0.75rem 0;
}
.cal-header {
  text-align: center;
  font-weight: 600;
  font-size: 0.7rem;
  padding: 0.4rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cal-day {
  text-align: center;
  padding: 0.5rem 0.25rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: default;
  transition: transform var(--transition);
}
.cal-day:hover:not(.cal-empty) { transform: scale(1.1); }
.cal-day-link { text-decoration: none; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cal-day-link:hover { outline: 2px solid var(--accent); outline-offset: -2px; color: inherit; }
.cal-empty { background: transparent; }

/* Slot colors */
.slot-available { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.slot-full { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.cal-past { background: transparent; color: var(--text-muted); opacity: 0.35; cursor: default; }
.slot-am-busy { background: linear-gradient(to right, rgba(239,68,68,0.2) 50%, rgba(34,197,94,0.2) 50%); color: var(--text-primary); }
.slot-pm-busy { background: linear-gradient(to right, rgba(34,197,94,0.2) 50%, rgba(239,68,68,0.2) 50%); color: var(--text-primary); }

/* --- Legend --- */
.legend {
  display: flex;
  gap: 1rem;
  margin: 1.25rem 0;
  font-size: 0.8rem;
  flex-wrap: wrap;
}
.legend span {
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-weight: 500;
}

/* --- Flash messages --- */
.flash-success { background: var(--success-bg); color: var(--success); border-left: 4px solid var(--success); padding: 0.85rem 1.25rem; margin-bottom: 1.25rem; border-radius: var(--radius-sm); }
.flash-error { background: var(--danger-bg); color: var(--danger); border-left: 4px solid var(--danger); padding: 0.85rem 1.25rem; margin-bottom: 1.25rem; border-radius: var(--radius-sm); }
.flash-info { background: var(--info-bg); color: var(--info); border-left: 4px solid var(--info); padding: 0.85rem 1.25rem; margin-bottom: 1.25rem; border-radius: var(--radius-sm); }

/* --- Badges --- */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-trusted { background: var(--success-bg); color: var(--success); }
.badge-pending { background: var(--warning-bg); color: var(--accent); }
.badge-admin { background: var(--info-bg); color: var(--info); }
.badge-rejected { background: var(--danger-bg); color: var(--danger); }
.badge-approved { background: var(--success-bg); color: var(--success); }
.badge-capacity { background: rgba(15, 23, 42, 0.75); color: #f1f5f9; backdrop-filter: blur(4px); border: 1px solid rgba(255,255,255,0.15); }

/* --- Admin actions --- */
.admin-actions { display: flex; gap: 0.5rem; align-items: center; }

/* --- Month navigation --- */
.month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.25rem;
  margin-bottom: 1.5rem;
}
.month-nav a { color: var(--text-secondary); font-weight: 500; font-size: 0.9rem; }
.month-nav a:hover { color: var(--text-primary); }
.month-nav strong { color: var(--text-primary); font-size: 1rem; }

/* --- Auth card --- */
.auth-wrapper {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow);
}
.auth-card h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}
.auth-card .auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* --- Room detail hero --- */
.room-hero {
  position: relative;
  height: 320px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
}
.room-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.room-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15,23,42,0.95) 0%, transparent 60%);
}
.room-hero-text {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 2;
}
.room-hero-text h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.3rem;
}
.room-hero-text p { color: var(--text-secondary); }

/* --- Article (calendar wrapper) --- */
.calendar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

/* --- Footer --- */
.site-footer {
  margin-top: auto;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* --- Mark (error) --- */
mark {
  background: var(--danger-bg);
  color: var(--danger);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

/* --- Misc --- */
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }

/* --- Room long description (rich text) --- */
.room-long-description {
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 0.95rem;
}
.room-long-description p { margin-bottom: 0.75rem; }
.room-long-description p:last-child { margin-bottom: 0; }
.room-long-description ul,
.room-long-description ol {
  margin: 0.5rem 0 0.75rem 1.5rem;
  color: var(--text-secondary);
}
.room-long-description li { margin-bottom: 0.3rem; }
.room-long-description strong { color: var(--text-primary); font-weight: 600; }
.room-long-description h3 {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
}
.room-long-description h3:first-child { margin-top: 0; }

/* --- User detail --- */
.user-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}
.user-detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.user-detail-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.user-detail-value {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .hero { height: 360px; }
  .hero-content h1 { font-size: 1.75rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-cols-2 { grid-template-columns: 1fr; }
  .navbar .container { padding: 0 1rem; }
  .navbar-links { gap: 0.75rem; }
  .navbar-links a { font-size: 0.8rem; }
  .auth-card { padding: 1.5rem; }
  .room-hero { height: 220px; }
}
