/* =========================================================
   assets/css/style.css
   Meeting Room Booking System — Core Stylesheet
   Layout: Sidebar + Navbar + Content (Modern Admin Dashboard)
   ========================================================= */

:root {
  --primary: #0d6efd;
  --primary-dark: #0b5ed7;
  --sidebar-width: 260px;
  --navbar-height: 64px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --transition-fast: 0.2s ease;
  --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);

  --bg-body: #f4f6fb;
  --bg-surface: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.65);
  --border-color: #e7ebf3;
  --text-main: #1f2937;
  --text-muted: #6b7280;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Noto Sans Thai", "Segoe UI", sans-serif;
  background: var(--bg-body);
  color: var(--text-main);
  margin: 0;
  transition:
    background var(--transition-smooth),
    color var(--transition-smooth);
}

a {
  text-decoration: none;
}

/* ===== App Layout ===== */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left var(--transition-smooth);
}

.app-content {
  flex: 1;
  padding-top: 1rem;
}

/* ===== Sidebar ===== */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition:
    transform var(--transition-smooth),
    background var(--transition-smooth);
}

.sidebar-brand {
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 1.2rem;
  font-weight: 700;
  font-size: 1.05rem;
  border-bottom: 1px solid var(--border-color);
}
.brand-icon {
  color: var(--primary);
  font-size: 1.3rem;
}
.btn-sidebar-toggle {
  border: none;
  background: transparent;
  font-size: 1.1rem;
  margin-left: auto;
  cursor: pointer;
  color: var(--text-main);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.6rem;
}
.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.2rem;
  font-weight: 500;
  font-size: 0.92rem;
  transition: all var(--transition-fast);
}
.sidebar-nav .nav-link i {
  width: 18px;
  text-align: center;
}
.sidebar-nav .nav-link:hover {
  background: rgba(13, 110, 253, 0.08);
  color: var(--primary);
  transform: translateX(2px);
}
.sidebar-nav .nav-link.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.35);
}

.sidebar-footer {
  padding: 0.9rem;
  border-top: 1px solid var(--border-color);
}
.sidebar-footer .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-md);
}
.sidebar-footer .nav-link:hover {
  background: rgba(220, 53, 69, 0.08);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1035;
}

/* ===== Navbar ===== */
.app-navbar {
  height: var(--navbar-height);
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 1020;
}
#sidebarOpenBtn {
  display: none;
}
.navbar-breadcrumb .breadcrumb {
  font-size: 0.85rem;
}
.navbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.btn-icon {
  border: none;
  background: var(--bg-surface);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}
.btn-icon:hover {
  background: var(--primary);
  color: #fff;
  transform: rotate(15deg);
}

.btn-profile {
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
.avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}
.avatar-letter {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}
.profile-name {
  font-weight: 600;
  font-size: 0.9rem;
}

/* ===== Footer ===== */
.app-footer {
  padding: 1rem;
}

/* ===== Glassmorphism Cards ===== */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(31, 41, 55, 0.08);
}

.stat-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 1.25rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(31, 41, 55, 0.1);
}
.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #fff;
}
.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
}
.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.card-app {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: box-shadow var(--transition-fast);
}
.card-app:hover {
  box-shadow: 0 10px 24px rgba(31, 41, 55, 0.06);
}

/* ===== Badge / Status Pills ===== */
.badge-status {
  font-weight: 500;
  padding: 0.4em 0.8em;
  border-radius: 50px;
  font-size: 0.78rem;
}
.badge-pending {
  background: #fff3cd;
  color: #997404;
}
.badge-approved {
  background: #d1f2dd;
  color: #157347;
}
.badge-rejected {
  background: #fde2e1;
  color: #b02a37;
}
.badge-cancelled {
  background: #e7ebf3;
  color: #6b7280;
}
.badge-available {
  background: #d1f2dd;
  color: #157347;
}
.badge-maintenance {
  background: #fff3cd;
  color: #997404;
}
.badge-disabled {
  background: #e7ebf3;
  color: #6b7280;
}

/* ===== Skeleton Loading ===== */
.skeleton {
  background: linear-gradient(90deg, #e7ebf3 25%, #f3f5f9 37%, #e7ebf3 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: 8px;
}
@keyframes skeleton-loading {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

/* ===== Room Card ===== */
.room-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
}
.room-card .room-color-bar {
  height: 6px;
  width: 100%;
}
.room-card .room-image {
  height: 160px;
  object-fit: cover;
  width: 100%;
  background: #eee;
}

/* ===== Login Page ===== */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%);
  padding: 1rem;
}
.login-wrapper {
  width: 100%;
  max-width: 420px;
}
.login-card {
  padding: 2.2rem;
}
.login-logo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto;
}
.divider-text {
  text-align: center;
  margin: 1.2rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  position: relative;
}
.divider-text span {
  background: var(--bg-surface);
  padding: 0 0.6rem;
  position: relative;
  z-index: 1;
}
.divider-text::before {
  content: "";
  display: block;
  border-top: 1px solid var(--border-color);
  position: relative;
  top: 10px;
}
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

/* ===== Animations ===== */
.fade-in {
  animation: fadeIn var(--transition-smooth);
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Responsive ===== */
@media (max-width: 991.98px) {
  .app-sidebar {
    transform: translateX(-100%);
  }
  .app-sidebar.show {
    transform: translateX(0);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.25);
  }
  .app-main {
    margin-left: 0;
  }
  #sidebarOpenBtn {
    display: flex;
    border: none;
    background: transparent;
    font-size: 1.2rem;
  }
  .sidebar-overlay.show {
    display: block;
  }
}

@media (max-width: 575.98px) {
  .app-navbar {
    padding: 0 0.85rem;
  }
  .profile-name {
    display: none;
  }
  .login-card {
    padding: 1.5rem;
  }
}

/* Large screens: widen content gracefully */
@media (min-width: 1600px) {
  .app-content .container-fluid {
    max-width: 1500px;
    margin: 0 auto;
  }
}

/* ===== FullCalendar: วันหยุด + เสาร์-อาทิตย์ ===== */
:root {
  --fc-holiday-color: #dc3545;
  --fc-saturday-color: #0d6efd;
  --fc-weekend-bg: rgba(13, 110, 253, 0.03);
  --fc-holiday-bg: rgba(220, 53, 69, 0.04);
}

/* พื้นหลังอ่อนๆ วันเสาร์ */
.fc-day-saturday {
  background-color: var(--fc-weekend-bg) !important;
}

/* พื้นหลังอ่อนๆ วันอาทิตย์ + วันหยุดราชการ */
.fc-day-holiday {
  background-color: var(--fc-holiday-bg) !important;
}

/* ป้ายชื่อวันหยุดใต้เลขวัน */
.fc-holiday-label {
  font-size: 0.6rem;
  color: var(--fc-holiday-color);
  line-height: 1.2;
  padding: 0 4px 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Week/Day view — ป้ายชื่อวันหยุดใน column header */
.fc-col-header-cell.fc-day-sat .fc-col-header-cell-cushion {
  color: var(--fc-saturday-color);
}
.fc-col-header-cell.fc-day-sun .fc-col-header-cell-cushion {
  color: var(--fc-holiday-color);
}
