/* BAPS Bochasan Mandir Utara Management System (BUWA) */
/* Core Styling & Design System */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Noto+Sans+Gujarati:wght@300;400;500;600;700&display=swap');

:root {
  /* Color Tokens */
  --primary: #E86C25;       /* BAPS Saffron */
  --primary-hover: #D45B18; /* Darker Saffron */
  --primary-light: #FDEEE6; /* Saffron Tint */
  --dark-gold: #C5A059;     /* Gold Accent */
  
  --bg-main: #F8F9FA;
  --bg-sidebar: #1E2229;    /* Dark Sidebar */
  --bg-card: #FFFFFF;
  
  --text-primary: #2C3E50;
  --text-muted: #7F8C8D;
  --text-light: #ECF0F1;
  
  --border-color: #E2E8F0;
  --border-focus: #E86C25;
  
  /* Status Colors */
  --status-available: #10B981;  /* Green */
  --status-occupied: #EF4444;   /* Red */
  --status-maintenance: #F59E0B;/* Yellow */
  --status-closed: #9CA3AF;     /* Gray */
  
  /* System Fonts */
  --font-family: 'Outfit', 'Noto Sans Gujarati', sans-serif;
  
  /* Shadows & Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
}

/* Login Page Container */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(rgba(17, 19, 23, 0.55), rgba(17, 19, 23, 0.75)), url('https://www.baps.org/Data/Sites/1/Media/LocationImages/128128-bochasan.jpg') no-repeat center center;
  background-size: cover;
  position: relative;
  overflow: hidden;
  padding: 20px;
}

/* Background Decorative Circles */
.login-container::before {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(232, 108, 37, 0.15) 0%, transparent 70%);
  top: -100px;
  right: -100px;
  z-index: 1;
}

.login-container::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(197, 160, 89, 0.1) 0%, transparent 70%);
  bottom: -150px;
  left: -150px;
  z-index: 1;
}

/* Login Box (Glassmorphism & Shadows) */
.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 35px;
  z-index: 2;
  position: relative;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transform: translateY(0);
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-logo {
  text-align: center;
  margin-bottom: 30px;
}

.logo-icon {
  width: 75px;
  height: 75px;
  background-color: #FFFFFF;
  border-radius: 50%;
  margin: 0 auto 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-title {
  font-size: 24px;
  color: #1E2229;
  font-weight: 700;
  margin-bottom: 5px;
  text-align: center;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 25px;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.alert-danger {
  background-color: #FDF2F2;
  color: var(--status-occupied);
  border: 1px solid #FCD9D9;
}

.alert-success {
  background-color: #ECFDF5;
  color: var(--status-available);
  border: 1px solid #A7F3D0;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #34495E;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: #FFFFFF;
  color: var(--text-primary);
  font-family: var(--font-family);
  transition: all 0.2s ease-in-out;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(232, 108, 37, 0.15);
}

/* Login Button */
.btn-primary {
  width: 100%;
  padding: 13px 20px;
  font-size: 16px;
  font-weight: 600;
  color: #FFFFFF;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(232, 108, 37, 0.2);
  transition: all 0.2s ease-in-out;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(232, 108, 37, 0.3);
}

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

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

/* Sidebar Styling */
.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  width: 42px;
  height: 42px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #FFFFFF;
  border-radius: 50%;
  padding: 4px;
}

.sidebar-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sidebar-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.sidebar-menu {
  list-style: none;
  padding: 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu-item a {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: #A0AEC0;
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.menu-item a:hover, .menu-item.active a {
  color: #FFFFFF;
  background-color: rgba(232, 108, 37, 0.15);
  border-left: 4px solid var(--primary);
}

.menu-item svg {
  margin-right: 12px;
  width: 18px;
  height: 18px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  color: #718096;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Main Content Panel */
.content-panel {
  flex-grow: 1;
  background-color: var(--bg-main);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.top-nav {
  height: 70px;
  background-color: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  padding: 0 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 15px;
}

.user-name {
  font-weight: 500;
  font-size: 14px;
}

.btn-logout {
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-sm);
  background-color: #FFFFFF;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background-color: #FFF5F5;
  color: var(--status-occupied);
  border-color: #FED7D7;
}

/* Page Contents */
.content-body {
  padding: 30px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

/* Panel Card Container */
.card {
  background-color: #FFFFFF;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  padding: 30px;
  margin-bottom: 25px;
}

.card-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 15px;
  margin-bottom: 25px;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: #1E2229;
}

/* Custom Grid system */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* Metric Cards for Dashboard */
.metric-card {
  background-color: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  border-top: 4px solid var(--primary);
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: transform 0.2s ease;
}

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

.metric-card.available { border-top-color: var(--status-available); }
.metric-card.occupied { border-top-color: var(--status-occupied); }
.metric-card.maintenance { border-top-color: var(--status-maintenance); }
.metric-card.closed { border-top-color: var(--status-closed); }
.metric-card.checkins { border-top-color: #3B82F6; }
.metric-card.checkouts { border-top-color: #EC4899; }
.metric-card.active-bookings { border-top-color: #8B5CF6; }
.metric-card.buildings { border-top-color: #C5A059; }

.metric-value {
  font-size: 28px;
  font-weight: 700;
  color: #1E2229;
}

.metric-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 30px;
  text-align: center;
}

.status-badge.available {
  background-color: #E6FDF4;
  color: var(--status-available);
}

.status-badge.occupied {
  background-color: #FEE2E2;
  color: var(--status-occupied);
}

.status-badge.maintenance {
  background-color: #FEF3C7;
  color: var(--status-maintenance);
}

.status-badge.closed {
  background-color: #F3F4F6;
  color: var(--status-closed);
}

.search-input-ctrl {
  width: 280px;
}

.filter-select-ctrl {
  width: 200px;
}

.edit-details-grid {
  grid-template-columns: 1fr 1.5fr 1.5fr;
}

/* Responsive Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin-top: 15px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  background-color: #FFFFFF;
}

.data-table th, .data-table td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background-color: #F8F9FA;
  font-weight: 600;
  color: var(--text-primary);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background-color: #F9FAFB;
}

/* Blueprint Layout Styles */
.blueprint-wrapper {
  background-color: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 30px;
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

.blueprint-svg {
  width: 100%;
  max-width: 800px;
  height: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: #FAFAFA;
}

.room-shape {
  fill: #FFFFFF;
  stroke: #CBD5E1;
  stroke-width: 2;
  transition: all 0.2s ease;
  cursor: pointer;
}

.room-shape:hover {
  stroke: var(--primary);
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.room-shape.available { fill: #E6FDF4; stroke: #A7F3D0; }
.room-shape.available:hover { fill: #D1FAE5; }

.room-shape.occupied { fill: #FEE2E2; stroke: #FCA5A5; }
.room-shape.occupied:hover { fill: #FEE2E2; }

.room-shape.maintenance { fill: #FEF3C7; stroke: #FDE68A; }
.room-shape.maintenance:hover { fill: #FEF3C7; }

.room-shape.closed { fill: #F3F4F6; stroke: #D1D5DB; cursor: not-allowed; }
.room-shape.closed:hover { fill: #F3F4F6; stroke: #D1D5DB; filter: none; }

.room-label {
  font-size: 20px;
  font-weight: 700;
  fill: #1E2229;
  pointer-events: none; /* Let clicks pass to the room-shape underneath */
}

/* Modal Popover Backdrops */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(30, 34, 41, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  background-color: #FFFFFF;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 500px;
  overflow: hidden;
  animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUp {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 18px 24px;
  background-color: var(--primary);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close {
  background: none;
  border: none;
  color: #FFFFFF;
  font-size: 22px;
  cursor: pointer;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background-color: #F8F9FA;
}

.btn-secondary {
  padding: 8px 16px;
  font-size: 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: #FFFFFF;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background-color: #F3F4F6;
}

/* Print Overrides */
@media print {
  @page {
    size: A4 landscape;
    margin: 8mm;
  }
  body {
    background-color: #FFFFFF;
    color: #000000;
    font-size: 11px !important;
  }
  .sidebar, .top-nav, .btn-primary, .btn-secondary, .form-group, .card-header button, .btn-logout, form, .print-hide {
    display: none !important;
  }
  .content-panel {
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }
  .content-body {
    padding: 0 !important;
    max-width: 100% !important;
  }
  .card {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  .data-table {
    width: 100% !important;
    border-collapse: collapse !important;
    border: 1px solid #000000 !important;
  }
  .data-table th, .data-table td {
    border: 1px solid #000000 !important;
    color: #000000 !important;
    padding: 4px 6px !important;
    font-size: 11px !important;
  }
  .data-table th {
    background-color: #F3F4F6 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* Responsive navigation controls styling */
.mobile-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
  margin-left: -8px;
  border-radius: var(--radius-sm);
  transition: background-color 0.2s ease;
}

.mobile-nav-toggle:hover {
  background-color: var(--border-color);
}

.mobile-sidebar-close-btn {
  display: none;
}

/* Sidebar overlay backdrop */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(17, 19, 23, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1050;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* Responsive design overrides */
@media (max-width: 992px) {
  .mobile-nav-toggle {
    display: flex;
  }
  
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    z-index: 1100;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
  
  .mobile-sidebar-close-btn {
    display: block !important;
  }
  
  .top-nav {
    padding: 0 20px;
  }
  
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  /* Edit details custom grid collapse */
  .edit-details-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 768px) {
  .content-body {
    padding: 20px 15px;
  }
  
  /* Make search and filter toolbars wrap and expand fully */
  .search-input-ctrl, .filter-select-ctrl {
    width: 100% !important;
  }
  
  .blueprint-wrapper {
    padding: 15px;
  }
  
  /* Form actions flex collapse */
  .form-actions-flex {
    flex-direction: column;
    gap: 10px;
  }
  
  .form-actions-flex button, .form-actions-flex a {
    width: 100%;
    flex: none !important;
  }
}

@media (max-width: 1200px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 576px) {
  .user-profile .user-name {
    display: none;
  }
  
  .login-card {
    padding: 30px 20px;
  }
  
  .page-title {
    font-size: 18px;
  }
  
  .metrics-grid {
    grid-template-columns: 1fr !important;
  }
}

