/* Import Google Fonts for Thai and English text */
@import url('https://fonts.googleapis.com/css2?family=Mitr:wght@300;400;500;600&family=Sarabun:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap');

:root {
  /* Colors */
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  
  --bg-gradient: linear-gradient(135deg, #f5f8ff 0%, #fef1fc 50%, #f0f7ff 100%);
  
  --glass-bg: rgba(255, 255, 255, 0.45);
  --glass-bg-hover: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-border-focus: rgba(102, 126, 234, 0.5);
  
  --shadow-color: rgba(31, 38, 135, 0.05);
  --text-primary: #2d3748;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  
  /* Status Colors */
  --color-vacant: #10b981;       /* Green */
  --color-vacant-bg: rgba(16, 185, 129, 0.12);
  --color-vacant-border: rgba(16, 185, 129, 0.35);
  
  --color-booked: #ef4444;       /* Red */
  --color-booked-bg: rgba(239, 68, 68, 0.12);
  --color-booked-border: rgba(239, 68, 68, 0.35);
  
  --color-visited: #3b82f6;      /* Blue */
  --color-visited-bg: rgba(59, 130, 246, 0.12);
  --color-visited-border: rgba(59, 130, 246, 0.35);
  
  --color-closed: #cbd5e1;       /* Gray for closed/holidays */
  --color-closed-bg: rgba(148, 163, 184, 0.1);
  --color-closed-border: rgba(148, 163, 184, 0.2);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Sarabun', sans-serif;
  color: var(--text-primary);
  background: var(--bg-gradient);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

/* Background blob decorations for premium glassmorphism feel */
body::before, body::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.45;
  pointer-events: none;
}

body::before {
  top: 10%;
  left: -100px;
  background: #a1c4fd;
}

body::after {
  bottom: 15%;
  right: -100px;
  background: #c2ffd8;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Mitr', sans-serif;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
}

/* Glassmorphism utility classes */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 var(--shadow-color);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel:hover {
  background: var(--glass-bg-hover);
  box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.08);
}

/* Layout container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  position: relative;
  z-index: 1;
}

/* Header styling */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  margin-bottom: 24px;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-img {
  width: 65px;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.header-title h1 {
  font-size: 1.6rem;
  color: #3b3a74;
}

.header-title p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.admin-btn-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-family: 'Mitr', sans-serif;
  font-weight: 400;
  font-size: 0.95rem;
  color: #fff;
  background: var(--primary-gradient);
  padding: 10px 20px;
  border-radius: 30px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.admin-btn-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.admin-btn-link:active {
  transform: translateY(0);
}

/* Booking Layout Grid */
.booking-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 992px) {
  .booking-grid {
    grid-template-columns: 1fr;
  }
}

/* Calendar Card */
.calendar-card {
  padding: 24px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.calendar-header h2 {
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #3b3a74;
}

.month-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-icon {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-weight: bold;
  transition: all 0.2s;
}

.btn-icon:hover:not(:disabled) {
  background: var(--primary-gradient);
  color: #fff;
  border-color: transparent;
}

.btn-icon:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.month-select {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  font-family: 'Mitr', sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  outline: none;
}

.month-select:focus {
  border-color: #667eea;
}

/* Calendar Grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.day-name {
  text-align: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 8px 0;
  font-family: 'Mitr', sans-serif;
}

.day-cell {
  aspect-ratio: 1;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 6px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}

.day-cell:hover:not(.empty-cell):not(.closed-day) {
  background: var(--glass-bg-hover);
  transform: scale(1.05);
}

.day-number {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* Day highlighting status */
.day-cell.highlight-green {
  border: 2px solid var(--color-vacant);
  background: var(--color-vacant-bg);
}
.day-cell.highlight-red {
  border: 2px solid var(--color-booked);
  background: var(--color-booked-bg);
}
.day-cell.highlight-blue {
  border: 2px solid var(--color-visited);
  background: var(--color-visited-bg);
}
.day-cell.closed-day {
  background: var(--color-closed-bg);
  border-color: var(--color-closed-border);
  opacity: 0.45;
  cursor: not-allowed;
}

/* Dots inside day cells representing rooms */
.day-dots {
  display: flex;
  gap: 3px;
  margin-top: 4px;
}

.day-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.day-dot.vacant { background-color: var(--color-vacant); }
.day-dot.booked { background-color: var(--color-booked); }
.day-dot.visited { background-color: var(--color-visited); }

.day-cell.selected-day {
  box-shadow: 0 0 0 3px #667eea;
  background: rgba(255, 255, 255, 0.85);
  transform: scale(1.03);
}

.day-cell.empty-cell {
  border: none;
  background: transparent;
  cursor: default;
  pointer-events: none;
}

/* Calendar Legend */
.calendar-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.legend-color {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.legend-color.vacant {
  background-color: var(--color-vacant-bg);
  border: 1px solid var(--color-vacant);
}
.legend-color.booked {
  background-color: var(--color-booked-bg);
  border: 1px solid var(--color-booked);
}
.legend-color.visited {
  background-color: var(--color-visited-bg);
  border: 1px solid var(--color-visited);
}
.legend-color.closed {
  background-color: var(--color-closed-bg);
  border: 1px solid var(--color-closed-border);
}

/* Slots and Details Panel */
.details-panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  min-height: 480px;
}

.details-header {
  margin-bottom: 16px;
}

.details-header h2 {
  font-size: 1.25rem;
  color: #3b3a74;
  margin-bottom: 4px;
}

.details-header p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.slots-container {
  flex-grow: 1;
  overflow-y: auto;
  max-height: 340px;
  margin-bottom: 16px;
  padding-right: 4px;
}

/* Scrollbar styling */
.slots-container::-webkit-scrollbar, .tab-content::-webkit-scrollbar, tbody::-webkit-scrollbar {
  width: 6px;
}
.slots-container::-webkit-scrollbar-thumb, .tab-content::-webkit-scrollbar-thumb, tbody::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}

.slot-card {
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 10px;
  border: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.25);
}

.slot-card:hover {
  transform: translateY(-1px);
}

.slot-card.status-vacant {
  border-color: var(--color-vacant-border);
}
.slot-card.status-vacant:hover {
  background-color: var(--color-vacant-bg);
}

.slot-card.status-booked {
  border-color: var(--color-booked-border);
  background-color: var(--color-booked-bg);
  cursor: not-allowed;
}

.slot-card.status-visited {
  border-color: var(--color-visited-border);
  background-color: var(--color-visited-bg);
  cursor: not-allowed;
}

.slot-info {
  display: flex;
  flex-direction: column;
}

.slot-room {
  font-family: 'Mitr', sans-serif;
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.slot-time {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.slot-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'Mitr', sans-serif;
}

.slot-badge.vacant {
  background-color: var(--color-vacant);
  color: #fff;
}
.slot-badge.booked {
  background-color: var(--color-booked);
  color: #fff;
}
.slot-badge.visited {
  background-color: var(--color-visited);
  color: #fff;
}

.no-slots-msg {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
  font-size: 0.95rem;
}

/* Booking form wrapper */
.booking-form-wrapper {
  margin-top: 10px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--glass-border);
}

.booking-form-wrapper h3 {
  font-size: 1.05rem;
  margin-bottom: 12px;
  color: #3b3a74;
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.6);
  font-family: 'Sarabun', sans-serif;
  font-size: 0.9rem;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s;
}

.form-control:focus {
  border-color: #667eea;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.btn-primary {
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: 8px;
  font-family: 'Mitr', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: #fff;
  background: var(--primary-gradient);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  transition: all 0.2s;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.45);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Contact Info Section */
.contact-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  margin-top: 24px;
  text-align: center;
  border-radius: 12px;
}

.contact-icon {
  font-size: 1.5rem;
  color: #e53e3e;
  animation: pulse 2s infinite;
}

.contact-info-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.contact-phone-link {
  color: #3b82f6;
  text-decoration: none;
  font-weight: bold;
}

.contact-phone-link:hover {
  text-decoration: underline;
}

/* Admin Dashboard Layout */
.admin-container {
  max-width: 1300px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  margin-bottom: 20px;
}

.admin-nav-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.tab-btn {
  padding: 10px 20px;
  border-radius: 30px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  font-family: 'Mitr', sans-serif;
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.8);
}

.tab-btn.active {
  background: var(--primary-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.tab-content {
  display: none;
  padding: 24px;
  min-height: 400px;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease-in-out;
}

/* Table Design */
.table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  margin-top: 16px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.15);
}

.admin-table th, .admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--glass-border);
}

.admin-table th {
  background: rgba(102, 126, 234, 0.1);
  font-family: 'Mitr', sans-serif;
  font-weight: 500;
  color: #3b3a74;
}

.admin-table tr:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* Action Buttons inside Tables/Panels */
.btn-action-group {
  display: flex;
  gap: 8px;
}

.btn-small {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  font-family: 'Mitr', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-edit {
  background-color: rgba(59, 130, 246, 0.15);
  color: #1e3a8a;
  border-color: rgba(59, 130, 246, 0.3);
}
.btn-edit:hover {
  background-color: #3b82f6;
  color: #fff;
}

.btn-delete {
  background-color: rgba(239, 68, 68, 0.15);
  color: #7f1d1d;
  border-color: rgba(239, 68, 68, 0.3);
}
.btn-delete:hover {
  background-color: #ef4444;
  color: #fff;
}

.btn-complete {
  background-color: rgba(16, 185, 129, 0.15);
  color: #064e3b;
  border-color: rgba(16, 185, 129, 0.3);
}
.btn-complete:hover {
  background-color: #10b981;
  color: #fff;
}

/* Dashboard / Stats Layout */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 20px;
  text-align: center;
}

.stat-val {
  font-size: 2.2rem;
  font-weight: 700;
  color: #3b3a74;
  margin: 8px 0;
  font-family: 'Mitr', sans-serif;
}

.stat-lbl {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Filter sections */
.filter-bar {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.2);
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}

.filter-bar-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-bar-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Charts structure */
.charts-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  margin-top: 20px;
}

@media (max-width: 992px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  padding: 24px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
}

.chart-card h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: #3b3a74;
}

.chart-container {
  flex-grow: 1;
  position: relative;
  width: 100%;
  height: 250px;
}

/* Login Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 95%;
  max-width: 450px;
  padding: 30px;
  transform: translateY(-20px);
  transition: transform 0.3s;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 1.25rem;
  color: #3b3a74;
}

.close-modal-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}

.close-modal-btn:hover {
  color: var(--text-primary);
}

/* Holiday items */
.holiday-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
}

.holiday-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid var(--glass-border);
}

.holiday-date {
  font-weight: 500;
  font-size: 0.9rem;
}

/* Dynamic rooms item settings */
.room-settings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.room-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid var(--glass-border);
}

.room-name-text {
  font-family: 'Mitr', sans-serif;
  font-size: 0.95rem;
}

/* Backup and Restore Box */
.backup-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .backup-section {
    grid-template-columns: 1fr;
  }
}

.backup-card {
  padding: 20px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid var(--glass-border);
}

.backup-card h4 {
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: #3b3a74;
}

.backup-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* Templates grid */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.template-day-card {
  padding: 16px;
}

.template-day-title {
  font-size: 1.1rem;
  color: #3b3a74;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.template-room-group {
  margin-bottom: 12px;
}

.template-room-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.template-slots-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.template-slot-checkbox {
  display: none;
}

.template-slot-label {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.25);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.template-slot-checkbox:checked + .template-slot-label {
  background: var(--color-vacant);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Custom Notifications */
.notification-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 14px 20px;
  border-radius: 8px;
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  font-family: 'Mitr', sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  min-width: 250px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

.toast.success {
  background-color: rgba(16, 185, 129, 0.9);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.toast.error {
  background-color: rgba(239, 68, 68, 0.9);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.toast.info {
  background-color: rgba(59, 130, 246, 0.9);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Footer Section */
footer {
  margin-top: 40px;
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- Admin Photo Gallery Styles --- */
.admin-photo-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--glass-border);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.admin-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-photo-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.admin-photo-item:hover .admin-photo-overlay {
  opacity: 1;
}

.photo-action-btn {
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  transition: transform 0.1s;
}

.photo-action-btn:hover {
  transform: scale(1.1);
}

.photo-action-btn.delete-photo {
  color: #ef4444;
}

.photo-action-btn.cover-photo {
  color: #cbd5e1;
}

.photo-action-btn.cover-photo.active {
  color: #f59e0b;
  background: #fff;
}

/* Ensure active cover photo stars are always visible */
.admin-photo-item .photo-action-btn.cover-photo.active {
  opacity: 1;
}

/* --- Slideshow Styles --- */
.slideshow-container {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid var(--glass-border);
}

.slide-nav-btn {
  transition: background 0.2s, transform 0.2s;
}

.slide-nav-btn:hover {
  background: rgba(0, 0, 0, 0.7) !important;
  transform: translateY(-50%) scale(1.05);
}

.slide-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.2);
  transition: all 0.2s;
}

.slide-dot.active {
  background: #fff;
  transform: scale(1.2);
  box-shadow: 0 0 8px rgba(255,255,255,0.6);
}

/* Style for disabled unclickable slots in past */
.slot-card.status-closed {
  border-color: var(--color-closed-border);
  background-color: var(--color-closed-bg);
  cursor: not-allowed;
  opacity: 0.7;
}

.slot-badge.closed {
  background-color: #94a3b8;
  color: #fff;
}

.slide-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  display: flex;
  align-items: flex-end;
  background-color: #0b0a1a; /* Dark premium background for container gaps */
}

.slide-item.active {
  opacity: 1;
}

.slide-image {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Shows entire photo without cropping */
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.slide-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px 40px;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.3) 60%, rgba(0,0,0,0) 100%);
  color: #fff;
  z-index: 2;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  text-align: left;
}

.slide-caption h3 {
  font-family: 'Mitr', sans-serif;
  font-size: 1.4rem;
  margin-bottom: 4px;
  color: #ffffff;
}

.slide-caption p {
  font-size: 0.9rem;
  opacity: 0.9;
  font-family: 'Sarabun', sans-serif;
  margin: 0;
}

/* Mobile Responsiveness Fine-tuning (Screen widths <= 576px) */
@media (max-width: 576px) {
  .container {
    padding: 12px;
  }
  
  header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px;
    gap: 16px;
  }
  
  .logo-section {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
  
  .logo-img {
    width: 55px;
  }
  
  .header-title h1 {
    font-size: 1.3rem;
  }
  
  .header-title p {
    font-size: 0.8rem;
  }
  
  .admin-btn-link {
    width: 100%;
    justify-content: center;
    padding: 10px 0;
  }
  
  .calendar-card {
    padding: 12px;
  }
  
  .details-header {
    text-align: center;
  }
  
  .contact-section {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
  
  .calendar-header {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    margin-bottom: 16px;
  }
  
  .calendar-grid {
    gap: 4px;
    max-width: 340px;
    margin: 0 auto;
    width: 100%;
  }
  
  .calendar-legend {
    justify-content: center;
    gap: 10px 14px;
    padding-top: 16px;
    margin-top: 16px;
  }
  
  .day-name {
    font-size: 0.75rem;
    padding: 4px 0;
  }
  
  .day-cell {
    padding: 4px;
    border-radius: 8px;
  }
  
  .day-number {
    font-size: 0.95rem;
  }
  
  .day-dots {
    gap: 2px;
    margin-top: 2px;
  }
  
  .day-dot {
    width: 4px;
    height: 4px;
  }
  
  .slideshow-container {
    height: 280px !important;
  }
}

/* Template grid display: force 5 columns on desktop/notebook to align Monday to Friday in a single row */
@media (min-width: 992px) {
  .templates-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}


