/* ระบบจองสถานที่ มหาวิทยาลัยราชภัฏเพชรบุรี (PBRU Venue Booking)
   Soft Pastel Responsive Theme for Desktop, Mobile & Tablet */

:root {
  --color-pastel-bg: #f8fafc;
  --color-pastel-card: #ffffff;
  --color-pastel-sky: #e0f2fe;
  --color-pastel-indigo: #e0e7ff;
  --color-pastel-mint: #d1fae5;
  --color-pastel-amber: #fef3c7;
  --color-pastel-rose: #ffe4e6;
  --color-pastel-purple: #f3e8ff;
  --color-pastel-border: #e2e8f0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background-color: #f8fafc;
  background-image: 
    radial-gradient(at 0% 0%, rgba(224, 242, 254, 0.45) 0px, transparent 45%),
    radial-gradient(at 100% 0%, rgba(238, 242, 255, 0.45) 0px, transparent 45%),
    radial-gradient(at 50% 100%, rgba(254, 243, 199, 0.25) 0px, transparent 45%);
  background-attachment: fixed;
}

/* Custom Soft Pastel Scrollbar for Desktop */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: #a5b4fc;
}

/* Active tab soft pastel pill */
.tab-btn.active {
  color: #4338ca !important;
  border-bottom-color: #818cf8 !important;
  background-color: rgba(238, 242, 255, 0.8) !important;
  border-radius: 0.75rem 0.75rem 0 0;
}

/* Hide scrollbar utility for mobile swiping */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Timeline specific positioning with soft pastel track */
.timeline-track {
  position: relative;
  background-color: #ffffff;
  background-image: repeating-linear-gradient(
    to right,
    transparent,
    transparent calc(10% - 1px),
    #f1f5f9 calc(10% - 1px),
    #f1f5f9 10%
  );
  border-radius: 0.85rem;
  border: 1px solid #e2e8f0;
  height: 72px;
  min-height: 72px;
}

.timeline-event-card {
  position: absolute;
  top: 7px;
  bottom: 7px;
  border-radius: 0.65rem;
  padding: 4px 8px;
  font-size: 0.75rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  border-left-width: 4px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, z-index 0.15s ease;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.timeline-event-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
  z-index: 20;
}

/* Pending booking timeline card appearance - soft pastel butterscotch */
.timeline-event-pending {
  border-left-color: #f59e0b !important;
  border: 1.5px dashed #fcd34d !important;
  border-left-width: 5px !important;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(254, 243, 199, 0.35),
    rgba(254, 243, 199, 0.35) 8px,
    rgba(254, 243, 199, 0.65) 8px,
    rgba(254, 243, 199, 0.65) 16px
  ) !important;
  color: #92400e !important;
}

/* Sticky Room Column on Horizontal Scroll for Mobile & Tablet */
.timeline-room-sticky {
  position: sticky;
  left: 0;
  background-color: #ffffff;
  z-index: 20;
  box-shadow: 3px 0 6px -2px rgba(0, 0, 0, 0.06);
}

.timeline-header-sticky {
  position: sticky;
  left: 0;
  background-color: #ffffff;
  z-index: 25;
}

/* Toast animations */
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast {
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Mobile & Touch Improvements */
@media (max-width: 640px) {
  /* Prevent iOS automatic input zoom by ensuring font-size >= 16px on inputs */
  input[type="text"],
  input[type="password"],
  input[type="tel"],
  input[type="number"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px !important;
  }
  
  /* Ensure comfortable touch tap targets */
  button, 
  .tab-btn, 
  .admin-subtab-btn {
    min-height: 42px;
  }
}

/* Windows High DPI / Tablet Landscape Optimization */
@media (min-width: 768px) and (max-width: 1024px) {
  .container, main {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Chart Canvas Responsive Containers */
.chart-card-container {
  position: relative;
  width: 100%;
  height: 280px;
}

@media (min-width: 640px) {
  .chart-card-container {
    height: 320px;
  }
}

/* Print Stylesheet for Monthly Statistics Report */
@media print {
  header, 
  footer, 
  nav,
  .tab-btn, 
  #filter-reports-toolbar, 
  #btn-header-qrcode, 
  #banner-qrcode-card,
  #btn-open-booking, 
  #btn-admin-header, 
  #toast-container,
  .no-print {
    display: none !important;
  }
  
  #tab-reports-content {
    display: block !important;
  }
  
  body {
    background: #ffffff !important;
    padding: 0 !important;
    color: #000000 !important;
  }

  main {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .shadow-sm, .shadow-md, .shadow-xs {
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
  }

  .print-page-break {
    page-break-before: always;
  }
}
