/* School Media & Video Editing Team Appointment Booking System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --primary-color: #1e40af;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --secondary-color: #0f172a;
  --accent-color: #0284c7;
  --accent-hover: #0369a1;
  --accent-light: #f0f9ff;
  --success-color: #059669;
  --warning-color: #d97706;
  --danger-color: #dc2626;
  --info-color: #0891b2;
  --sidebar-width: 260px;
  --sidebar-bg: #0f172a;
  --sidebar-color: #94a3b8;
  --sidebar-active-bg: #1e293b;
  --sidebar-active-color: #ffffff;
  --card-bg: #ffffff;
  --card-shadow: 0 4px 14px 0 rgba(15, 23, 42, 0.06);
  --card-hover-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.1);
  --border-color: #e2e8f0;
  --bg-main: #f8fafc;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: #1e293b;
  overflow-x: hidden;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6, .brand-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* App Shell Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  color: var(--sidebar-color);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 1040;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.sidebar-brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.4rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.sidebar-brand-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.sidebar-brand-subtitle {
  font-size: 0.72rem;
  color: #94a3b8;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sidebar-menu {
  list-style: none;
  padding: 1rem 0.75rem;
  margin: 0;
  flex-grow: 1;
  overflow-y: auto;
}

.menu-category {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 0.85rem 0.75rem 0.35rem;
  font-weight: 700;
}

.menu-item {
  margin-bottom: 0.25rem;
}

.menu-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  color: var(--sidebar-color);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.18s ease;
}

.menu-link i {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
  transition: transform 0.2s;
}

.menu-link:hover {
  background-color: var(--sidebar-active-bg);
  color: #ffffff;
}

.menu-link:hover i {
  transform: translateX(2px);
}

.menu-link.active {
  background: linear-gradient(90deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.menu-link .badge {
  margin-left: auto;
}

/* User Card in Sidebar */
.sidebar-user-card {
  padding: 1rem;
  margin: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.user-avatar-initials {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Main Content Wrapper */
.app-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--bg-main);
  padding-bottom: 70px; /* Room for mobile nav */
}

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

/* Top Navbar */
.app-navbar {
  height: 68px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.navbar-action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}

.navbar-action-btn:hover {
  background: #f1f5f9;
  color: var(--primary-color);
}

.notification-count-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.25em 0.45em;
  border-radius: 50%;
  background-color: var(--danger-color);
  color: #fff;
  box-shadow: 0 0 0 2px #fff;
}

/* Page Content Body */
.app-content {
  padding: 1.75rem;
  flex-grow: 1;
}

/* Cards & Stats */
.stat-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
  height: 100%;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-hover-shadow);
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-val {
  font-size: 1.75rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: #0f172a;
  line-height: 1.1;
  margin-top: 0.4rem;
}

.stat-label {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Custom Table Card & Table Column Protections */
.table-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.table-card-header {
  padding: 1.15rem 1.5rem;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.table thead th {
  background-color: #f8fafc;
  color: #475569;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.15rem;
  white-space: nowrap;
}

.table tbody td {
  padding: 0.9rem 1.15rem;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.88rem;
}

.table tbody tr:hover {
  background-color: #f8fafc;
}

/* Prevent awkward multi-line wrapping */
.cell-title {
  min-width: 200px;
}

.cell-schedule {
  white-space: nowrap !important;
  min-width: 165px;
}

.cell-venue {
  min-width: 140px;
  max-width: 220px;
}

.cell-priority, .cell-status {
  white-space: nowrap !important;
}

.cell-actions {
  width: 60px;
  text-align: right;
  white-space: nowrap;
}

/* Priority & Status Badges */
.priority-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.badge-priority-low {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.badge-priority-normal {
  background-color: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.badge-priority-high {
  background-color: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-priority-urgent {
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* Service Pill Checks in Form */
.service-check-card {
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  background: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.service-check-card:hover {
  border-color: #93c5fd;
  background-color: #f8fafc;
}

.service-check-card.selected {
  border-color: #2563eb;
  background-color: #eff6ff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.service-check-card .form-check-input {
  cursor: pointer;
  width: 1.25rem;
  height: 1.25rem;
}

/* Double booking banner */
.conflict-alert {
  border-left: 4px solid #ef4444;
  background-color: #fef2f2;
  border-radius: 8px;
  padding: 1rem 1.25rem;
}

/* FullCalendar styling tweaks */
.fc {
  font-family: inherit;
}

.fc .fc-toolbar-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
}

.fc-theme-standard td, .fc-theme-standard th {
  border-color: var(--border-color);
}

.fc-event {
  border-radius: 6px;
  padding: 2px 6px;
  cursor: pointer;
  font-size: 0.82rem;
  border: none;
  font-weight: 500;
}

/* Mobile App Bottom Navigation Bar (Web APK Experience) */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1030;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #64748b;
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 4px;
  transition: all 0.15s ease;
}

.mobile-nav-item i {
  font-size: 1.25rem;
  margin-bottom: 2px;
}

.mobile-nav-item.active {
  color: var(--primary-color);
}

.mobile-nav-item.active i {
  transform: translateY(-2px);
}

.mobile-nav-item.action-pill {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  margin-top: -18px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.mobile-nav-item.action-pill i {
  font-size: 1.4rem;
  margin-bottom: 0;
}

@media (min-width: 992px) {
  .mobile-bottom-nav {
    display: none !important;
  }
}

/* Mobile Responsive Layout Improvements */
@media (max-width: 991.98px) {
  .app-navbar {
    padding: 0 1rem;
    height: 60px;
  }
  .app-content {
    padding: 1rem 0.75rem 5.5rem 0.75rem;
  }
  .app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: calc(-1 * var(--sidebar-width));
  }
  .app-sidebar.show {
    left: 0;
  }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
  }
  .sidebar-backdrop.show {
    display: block;
  }
}

/* FullCalendar Mobile Optimization - Eliminates Header Overlap */
@media (max-width: 767.98px) {
  .fc .fc-header-toolbar.fc-toolbar {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.65rem !important;
    margin-bottom: 1rem !important;
  }
  .fc .fc-toolbar-chunk {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    flex-wrap: wrap !important;
    gap: 0.25rem !important;
  }
  .fc .fc-toolbar-title {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    text-align: center !important;
  }
  .fc .fc-button {
    padding: 0.3rem 0.6rem !important;
    font-size: 0.78rem !important;
    border-radius: 6px !important;
  }
  .fc .fc-button-group {
    display: inline-flex !important;
  }
  .fc-view-harness {
    min-height: 440px !important;
  }

  /* Table Card Mobile Touch Scrolling */
  .table-card {
    border-radius: 12px;
  }
  .table-responsive {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
  }
  .table-responsive::-webkit-scrollbar {
    height: 5px;
  }
  .table-responsive::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
  }
  .table thead th {
    padding: 0.65rem 0.85rem;
    font-size: 0.72rem;
  }
  .table tbody td {
    padding: 0.75rem 0.85rem;
    font-size: 0.82rem;
  }
}

/* Custom Print styling */
@media print {
  .app-sidebar, .app-navbar, .mobile-bottom-nav, .no-print, .btn, .pagination, .navbar-action-btn {
    display: none !important;
  }
  .app-main {
    margin: 0 !important;
    padding: 0 !important;
  }
  .app-content {
    padding: 0 !important;
  }
  .table-card {
    box-shadow: none !important;
    border: none !important;
  }
}
