/* =========================================================
 * style.css
 * Modern University Management System - Blue / Sky / Teal Gradient
 * Mobile-First Responsive Design
 * ========================================================= */

:root {
  --wu-primary: #0d6efd;
  --wu-primary-dark: #0a58ca;
  --wu-teal: #0d9488;
  --wu-sky: #0284c7;
  --wu-gradient: linear-gradient(135deg, #0b5ed7 0%, #0284c7 52%, #0d9488 100%);
  --wu-sidebar-bg: linear-gradient(180deg, #0f294a 0%, #0b3b68 55%, #0a5468 100%);
  --wu-bg: #f1f5f9;
  --wu-text: #1e293b;
  --sidebar-width: 265px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--wu-bg);
  color: var(--wu-text);
  margin: 0;
  padding-bottom: 76px; /* เผื่อพื้นที่ Bottom Nav บนมือถือ */
}

@media (min-width: 992px) {
  body {
    padding-bottom: 0;
  }
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-box {
  background: #ffffff;
  padding: 28px 36px;
  border-radius: 18px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.25);
  min-width: 220px;
}

/* Mobile Header */
.mobile-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--wu-gradient);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 16px rgba(13, 110, 253, 0.18);
}

.brand-badge-sm {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

/* Layout Wrapper */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Desktop Sidebar */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--wu-sidebar-bg);
  padding: 24px 16px;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1020;
  overflow-y: auto;
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.12);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 16px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #38bdf8, #14b8a6);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 0.96rem;
  font-weight: 500;
  text-align: left;
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-item-btn i {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
}

.nav-item-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.nav-item-btn.active {
  background: linear-gradient(135deg, #0ea5e9 0%, #0d9488 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.3);
}

.sidebar-footer {
  padding: 14px 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  margin-top: 16px;
}

/* Main Content Area */
.app-main {
  flex: 1;
  width: 100%;
  padding: 16px;
}

@media (min-width: 992px) {
  .app-main {
    margin-left: var(--sidebar-width);
    padding: 28px 32px;
  }
}

/* Hero Banner */
.page-hero {
  background: var(--wu-gradient);
  border-radius: 20px;
  padding: 22px 26px;
  box-shadow: 0 10px 28px rgba(2, 132, 199, 0.2);
}

/* Mobile Bottom Nav */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: 1030;
  box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.08);
}

.bottom-nav-btn {
  border: 0;
  background: transparent;
  color: #64748b;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  gap: 2px;
  padding: 6px 2px;
}

.bottom-nav-btn i {
  font-size: 1.2rem;
}

.bottom-nav-btn.active {
  color: var(--wu-primary);
  font-weight: 700;
}

/* Buttons & Badges */
.btn-gradient-primary {
  background: var(--wu-gradient);
  border: none;
  color: #ffffff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-gradient-primary:hover {
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(13, 110, 253, 0.3);
}

.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--wu-gradient);
  color: #ffffff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.form-section-title {
  font-weight: 700;
  font-size: 0.96rem;
  color: #0f172a;
  padding-bottom: 8px;
  border-bottom: 2px solid #e2e8f0;
}

.terms-box {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
}

/* Room Availability Cards */
.availability-card {
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  height: 100%;
}

.availability-card:hover {
  border-color: #7dd3fc;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.1);
}

.availability-card.selected {
  border-color: var(--wu-primary);
  background: #f0f9ff;
  box-shadow: 0 8px 24px rgba(13, 110, 253, 0.16);
}

.availability-card.disabled-card {
  opacity: 0.72;
  background: #f8fafc;
  cursor: not-allowed;
}

.room-color-bar {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* Hourly Slot Timeline */
.slot-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
}

.hourly-slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 8px;
}

.slot-chip {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 8px 6px;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  background: #ffffff;
  transition: all 0.15s ease;
}

.slot-chip.available {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
  cursor: pointer;
}

.slot-chip.available:hover {
  background: #dcfce7;
  border-color: #22c55e;
}

.slot-chip.available.selected-range {
  background: var(--wu-primary);
  border-color: var(--wu-primary);
  color: #ffffff;
}

.slot-chip.booked {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
  cursor: not-allowed;
}

.slot-chip.past {
  border-color: #e2e8f0;
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

/* Room Catalog Cards */
.room-catalog-card {
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.room-catalog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1) !important;
}

.room-cover-wrapper {
  height: 190px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0ea5e9 0%, #0d9488 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.room-cover-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.room-cover-placeholder {
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
}

.room-cover-placeholder i {
  font-size: 3rem;
}

.equipment-pill {
  display: inline-block;
  background: #f1f5f9;
  color: #334155;
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
  margin: 0 5px 6px 0;
}

/* User Guide Cards */
.guide-card {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
}

.guide-illustration {
  height: 120px;
  background: linear-gradient(135deg, #0d6efd 0%, #38bdf8 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 2.8rem;
}

.guide-bg-teal {
  background: linear-gradient(135deg, #0d9488 0%, #2dd4bf 100%);
}

.guide-bg-indigo {
  background: linear-gradient(135deg, #4f46e5 0%, #60a5fa 100%);
}

.guide-bg-sky {
  background: linear-gradient(135deg, #0284c7 0%, #14b8a6 100%);
}

.guide-step-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
}

/* Event Detail Modal List */
.event-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.94rem;
}

.detail-label {
  color: #64748b;
  flex-shrink: 0;
}

.detail-value {
  text-align: right;
  color: #0f172a;
}

/* FullCalendar Theme Adjustments */
.fc {
  font-family: 'Sarabun', sans-serif !important;
}

.fc .fc-toolbar {
  flex-wrap: wrap;
  gap: 8px;
}

.fc .fc-toolbar-title {
  font-size: 1.15rem !important;
  font-weight: 700;
  color: #0f172a;
}

.fc .fc-button-primary {
  background-color: #0d6efd !important;
  border-color: #0d6efd !important;
  border-radius: 8px !important;
  font-size: 0.85rem !important;
}

.fc .fc-button-primary:not(:disabled).fc-button-active {
  background-color: #0d9488 !important;
  border-color: #0d9488 !important;
}

.fc-event {
  cursor: pointer;
  border-radius: 6px !important;
  padding: 2px 4px !important;
  font-size: 0.8rem !important;
}
