/* ==========================================================================
   Bros Before Hours - Design System
   Clean SaaS Aesthetic (Inspired by Monday.com, Google Calendar)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ==========================================================================
   1. THEME SYSTEM (CSS VARIABLES)
   ========================================================================== */

/* Theme 1: Midnight (Clean Dark - Default) */
:root, [data-theme="midnight"] {
  --bg-app: #0f172a;
  --bg-sidebar: #0b1120;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --bg-input: #0f172a;
  --bg-input-focus: #1e293b;
  --bg-overlay: rgba(15, 23, 42, 0.7);
  
  --border-subtle: #334155;
  --border-default: #475569;
  --border-focus: #3b82f6;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --brand-primary: #3b82f6;
  --brand-primary-hover: #2563eb;
  --brand-gradient: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
  --brand-glow: 0 0 10px rgba(59, 130, 246, 0.15);
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  --glass-bg: rgba(30, 41, 59, 0.8);
  --glass-border: rgba(255, 255, 255, 0.1);
  
  /* Status Colors */
  --color-success: #16a34a;
  --color-error: #dc2626;
  --color-warning: #d97706;
  
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
}

/* Theme 2: Arctic (Clean Light) */
[data-theme="arctic"] {
  --bg-app: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #ffffff;
  --bg-input-focus: #f8fafc;
  --bg-overlay: rgba(15, 23, 42, 0.4);
  
  --border-subtle: #e2e8f0;
  --border-default: #cbd5e1;
  --border-focus: #2563eb;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --brand-primary: #2563eb;
  --brand-primary-hover: #1d4ed8;
  --brand-gradient: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  --brand-glow: 0 0 10px rgba(37, 99, 235, 0.15);
  
  --glass-bg: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(0, 0, 0, 0.05);
}

/* Theme 3: Ember (Warm Dark) */
[data-theme="ember"] {
  --bg-app: #1c1917;
  --bg-sidebar: #0c0a09;
  --bg-card: #292524;
  --bg-card-hover: #44403c;
  --bg-input: #1c1917;
  --bg-input-focus: #292524;
  --bg-overlay: rgba(28, 25, 23, 0.7);
  
  --border-subtle: #44403c;
  --border-default: #57534e;
  --border-focus: #ea580c;
  
  --text-primary: #fafaf9;
  --text-secondary: #a8a29e;
  --text-muted: #78716c;
  
  --brand-primary: #ea580c;
  --brand-primary-hover: #c2410c;
  --brand-gradient: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
  --brand-glow: 0 0 10px rgba(234, 88, 12, 0.15);
  
  --glass-bg: rgba(41, 37, 36, 0.8);
  --glass-border: rgba(255, 255, 255, 0.08);
}

/* Theme 4: Neon (Purple Dark - Toned down) */
[data-theme="neon"] {
  --bg-app: #171026;
  --bg-sidebar: #0f0a1a;
  --bg-card: #231836;
  --bg-card-hover: #3b285d;
  --bg-input: #171026;
  --bg-input-focus: #231836;
  --bg-overlay: rgba(23, 16, 38, 0.7);
  
  --border-subtle: #3b285d;
  --border-default: #4c3675;
  --border-focus: #9333ea;
  
  --text-primary: #faf5ff;
  --text-secondary: #d8b4fe;
  --text-muted: #a855f7;
  
  --brand-primary: #9333ea;
  --brand-primary-hover: #7e22ce;
  --brand-gradient: linear-gradient(135deg, #9333ea 0%, #a855f7 100%);
  --brand-glow: 0 0 10px rgba(147, 51, 234, 0.15);
  
  --glass-bg: rgba(35, 24, 54, 0.8);
  --glass-border: rgba(255, 255, 255, 0.08);
}

/* Theme 5: Forest (Green Light) */
[data-theme="forest"] {
  --bg-app: #f0fdf4;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #dcfce7;
  --bg-input: #ffffff;
  --bg-input-focus: #f0fdf4;
  --bg-overlay: rgba(20, 83, 45, 0.4);
  
  --border-subtle: #dcfce7;
  --border-default: #bbf7d0;
  --border-focus: #16a34a;
  
  --text-primary: #14532d;
  --text-secondary: #15803d;
  --text-muted: #22c55e;
  
  --brand-primary: #16a34a;
  --brand-primary-hover: #15803d;
  --brand-gradient: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
  --brand-glow: 0 0 10px rgba(22, 163, 74, 0.15);
  
  --glass-bg: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(22, 163, 74, 0.1);
}

/* ==========================================================================
   2. RESET & TYPOGRAPHY
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Times New Roman', Times, serif !important;
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  color: var(--text-primary);
}

ul {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }

/* ==========================================================================
   3. UTILITIES
   ========================================================================== */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-4 { margin-left: 1rem; }
.mr-2 { margin-right: 0.5rem; }

.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }

.w-full { width: 100%; }
.h-full { height: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   4. ANIMATIONS
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   5. COMPONENTS
   ========================================================================== */

/* Cards */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
}

.glass-card {
  background-color: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  white-space: nowrap;
}

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

.btn-primary {
  background-color: var(--brand-primary);
  color: #ffffff;
}
.btn-primary:hover:not(:disabled) {
  background-color: var(--brand-primary-hover);
  box-shadow: var(--brand-glow);
}

.btn-secondary {
  background-color: var(--bg-card-hover);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}
.btn-secondary:hover:not(:disabled) {
  background-color: var(--border-subtle);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) {
  background-color: var(--bg-card-hover);
  color: var(--text-primary);
}

.btn-danger {
  background-color: var(--color-error);
  color: #ffffff;
}
.btn-danger:hover:not(:disabled) {
  filter: brightness(1.1);
}

.btn-success {
  background-color: var(--color-success);
  color: #ffffff;
}
.btn-success:hover:not(:disabled) {
  filter: brightness(1.1);
}

.btn-icon {
  padding: 0.5rem;
  border-radius: var(--radius-md);
}

.btn-google {
  background-color: #ffffff;
  color: #3c4043;
  border: 1px solid #dadce0;
  font-weight: 500;
}
.btn-google:hover:not(:disabled) {
  background-color: #f8f9fa;
  box-shadow: var(--shadow-sm);
}
/* Ensure dark mode override for google button doesn't happen unless specifically styled */

/* Form Inputs */
.form-group {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2); /* Adjust per theme if needed, but generic blue works */
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  line-height: 1.25rem;
}

.badge-requested { background-color: rgba(217, 119, 6, 0.1); color: var(--color-warning); border: 1px solid rgba(217, 119, 6, 0.2); }
.badge-approved, .badge-success { background-color: rgba(22, 163, 74, 0.1); color: var(--color-success); border: 1px solid rgba(22, 163, 74, 0.2); }
.badge-denied, .badge-blocked, .badge-error { background-color: rgba(220, 38, 38, 0.1); color: var(--color-error); border: 1px solid rgba(220, 38, 38, 0.2); }
.badge-owner { background-color: rgba(59, 130, 246, 0.1); color: var(--brand-primary); border: 1px solid rgba(59, 130, 246, 0.2); }
.badge-member { background-color: var(--bg-card-hover); color: var(--text-secondary); border: 1px solid var(--border-subtle); }

/* Avatars */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--brand-primary);
  color: #fff;
  font-weight: 600;
  overflow: hidden;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1rem;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 1.75rem; height: 1.75rem; font-size: 0.75rem; }
.avatar-lg { width: 4rem; height: 4rem; font-size: 1.5rem; }

/* Category Chips */
.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.category-chip {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  background-color: var(--bg-card-hover);
  color: var(--text-secondary);
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
}

.category-chip:hover {
  background-color: var(--border-subtle);
  color: var(--text-primary);
}
.category-chip.active {
  background-color: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
}

/* Loading */
.spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100vw;
  background-color: var(--bg-app);
}

/* ==========================================================================
   6. LAYOUT
   ========================================================================== */

#app, .app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: var(--bg-app);
}

/* Sidebar */
.sidebar {
  width: 260px;
  height: 100%;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease;
  z-index: 40;
}

.sidebar.collapsed {
  width: 64px;
}

.sidebar-header {
  height: 64px;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-brand {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
}

.sidebar.collapsed .sidebar-brand {
  display: none;
}

.sidebar-collapse-btn {
  color: var(--text-secondary);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-collapse-btn:hover { background-color: var(--bg-card-hover); color: var(--text-primary); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  margin: 0 0.5rem;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.sidebar-item:hover, .sidebar-item.active {
  background-color: var(--bg-card-hover);
  color: var(--text-primary);
}

.sidebar-item i {
  width: 1.5rem;
  text-align: center;
  font-size: 1.25rem;
}

.sidebar-item span {
  margin-left: 0.75rem;
  font-weight: 500;
}

.sidebar.collapsed .sidebar-item {
  justify-content: center;
  padding: 0.75rem 0;
}
.sidebar.collapsed .sidebar-item span {
  display: none;
}
.sidebar.collapsed .sidebar-item i {
  margin: 0;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
}

.sidebar.collapsed .sidebar-user-info {
  display: none;
}

/* Main Content Area */
.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0; /* Important for flex children to truncate */
}

.topbar {
  height: 64px;
  padding: 0 1.5rem;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

/* Dashboard Grid */
.dashboard-main {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
}
@media (max-width: 1024px) {
  .dashboard-main { grid-template-columns: 1fr; }
}

.dashboard-side {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  padding: 1rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  text-align: center;
}
.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--brand-primary);
}
.stat-card .stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ==========================================================================
   7. SPECIFIC SCREENS / VIEWS
   ========================================================================== */

/* Auth Screen */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  background: var(--bg-app);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 2.5rem;
  animation: slideUp 0.4s ease forwards;
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
  color: var(--text-muted);
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-subtle);
}
.auth-divider span {
  padding: 0 0.75rem;
  font-size: 0.875rem;
}

.auth-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.setup-notice {
  background-color: rgba(217, 119, 6, 0.1);
  border: 1px solid rgba(217, 119, 6, 0.2);
  color: var(--color-warning);
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease forwards;
}

.modal.modal-ai-full {
  max-width: 1100px !important;
  width: 92vw !important;
  height: 88vh !important;
  max-height: 900px !important;
  display: flex !important;
  flex-direction: column !important;
}
.modal.modal-ai-full .modal-body {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  padding: 1rem 1.25rem !important;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close {
  color: var(--text-secondary);
  font-size: 1.25rem;
}
.modal-close:hover { color: var(--text-primary); }

.modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 200;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 300px;
  animation: slideInRight 0.3s ease forwards;
}

.toast-success { border-left: 4px solid var(--color-success); }
.toast-error { border-left: 4px solid var(--color-error); }
.toast-info { border-left: 4px solid var(--brand-primary); }
.toast-warning { border-left: 4px solid var(--color-warning); }

.toast-message {
  font-size: 0.875rem;
  color: var(--text-primary);
  flex: 1;
}

/* Join Code */
.join-code {
  font-family: monospace;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.25rem;
  padding: 1rem;
  background-color: var(--bg-input);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--brand-primary);
  margin: 1rem 0;
  cursor: pointer;
}

/* Request Cards */
.request-card {
  padding: 1rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.request-card:hover { border-color: var(--border-default); }

.request-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.request-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Calendar List Cards */
.calendar-list-card {
  display: flex;
  align-items: center;
  padding: 1rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  transition: all 0.2s ease;
  cursor: pointer;
}
.calendar-list-card:hover {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-sm);
  background-color: var(--bg-card-hover);
}

.calendar-list-icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-md);
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-right: 1rem;
}

.calendar-list-info {
  flex: 1;
}

.calendar-list-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.calendar-list-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  gap: 1rem;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 3rem;
  color: var(--border-default);
  margin-bottom: 1rem;
}

/* ==========================================================================
   8. NEW FEATURE SPECIFIC CLASSES
   ========================================================================== */

/* Calendar Grid (Home Page) */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
}

.mini-calendar-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  height: 400px;
}

.mini-calendar-card .fc {
  flex: 1;
  font-size: 0.85em; /* Scale down FullCalendar in mini view */
}

/* RSVP Elements */
.rsvp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background-color: var(--bg-input);
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.rsvp-modal .modal-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rsvp-button {
  flex: 1;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.rsvp-button:hover { background-color: var(--bg-card-hover); }
.rsvp-button.available { border-color: var(--color-success); color: var(--color-success); }
.rsvp-button.available i { font-size: 1.5rem; }
.rsvp-button.unavailable { border-color: var(--color-error); color: var(--color-error); }
.rsvp-button.unavailable i { font-size: 1.5rem; }


/* Group Calendar Personal Overlay */
.personal-event-overlay {
  background: repeating-linear-gradient(
    45deg,
    rgba(100, 116, 139, 0.1),
    rgba(100, 116, 139, 0.1) 10px,
    rgba(100, 116, 139, 0.2) 10px,
    rgba(100, 116, 139, 0.2) 20px
  ) !important;
  border: 1px dashed var(--border-default) !important;
  color: transparent !important;
  pointer-events: none; /* Let clicks pass through */
  opacity: 0.7;
}

/* ==========================================================================
   9. FULLCALENDAR OVERRIDES (Clean SaaS style)
   ========================================================================== */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  height: calc(100vh - 140px);
  min-height: 500px;
}

.dashboard-main {
  min-width: 0;
  height: 100%;
}

.dashboard-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  padding-right: 0.5rem;
}

@media (max-width: 992px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    height: auto;
  }
  .dashboard-main {
    height: 600px;
  }
}

.calendar-container, .group-calendar-container {
  height: 100%;
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  padding: 1rem;
}

/* Reset FullCalendar defaults to match our theme */
.fc {
  color: var(--text-primary);
}

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

.fc-theme-standard .fc-scrollgrid {
  border-color: var(--border-subtle) !important;
}

.fc-col-header-cell {
  background-color: var(--bg-card-hover);
  padding: 0.5rem 0;
}

.fc-col-header-cell-cushion {
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: none;
}

.fc-daygrid-day-number {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem;
}

.fc-daygrid-day.fc-day-today {
  background-color: rgba(59, 130, 246, 0.05) !important;
}

.fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
  color: var(--brand-primary);
  font-weight: 700;
}

/* Event Chips */
.fc-event {
  border: none !important;
  border-radius: 4px !important;
  padding: 2px 4px !important;
  font-size: 0.8em;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.fc-daygrid-event {
  margin-top: 2px !important;
}

.fc-h-event .fc-event-main {
  color: #fff;
}

/* Button overrides for FC header */
.fc .fc-button-primary {
  background-color: var(--bg-card) !important;
  border-color: var(--border-subtle) !important;
  color: var(--text-primary) !important;
  text-transform: capitalize;
  border-radius: var(--radius-md) !important;
  font-weight: 500;
  box-shadow: none !important;
}

.fc .fc-button-primary:hover, .fc .fc-button-primary:focus {
  background-color: var(--bg-card-hover) !important;
  border-color: var(--border-default) !important;
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background-color: var(--border-subtle) !important;
  color: var(--text-primary) !important;
}

.fc .fc-toolbar-title {
  font-size: 1.25rem !important;
  font-weight: 600;
}

/* TimeGrid (Week/Day views) */
.fc-timegrid-slot-label-cushion {
  color: var(--text-secondary);
}

.fc-timegrid-event {
  border-radius: 4px !important;
  overflow: hidden;
}

.fc-v-event .fc-event-main {
  color: #fff;
}

/* Now Indicator */
.fc-now-indicator-arrow {
  border-color: var(--color-error) !important;
}
.fc-now-indicator-line {
  border-color: var(--color-error) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .fc-toolbar {
    flex-direction: column;
    gap: 1rem;
  }
}

.animate-fadeIn {
  animation: fadeIn 0.3s ease forwards;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.animate-slideUp {
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slideDown {
  animation: slideDown 0.3s ease forwards;
}

.mobile-menu-btn {
  display: none;
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: inline-flex;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 999;
  }
  .sidebar-overlay.active {
    display: block;
  }
}

/* User Request Overrides */
* {
  font-family: 'Times New Roman', Times, serif !important;
}

.sidebar-item:hover, .btn:hover, .theme-swatch:hover, .mini-calendar-card:hover, .request-card:hover, .fc-button:hover, .calendar-list-card:hover {
  background-color: var(--bg-card-hover) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-focus) !important;
}
.sidebar-item:hover .text-muted, .sidebar-item:hover .text-secondary {
  color: #dddddd !important;
}

/* Theme Picker Cards Redesign */
.theme-picker-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.5rem;
}

@media (min-width: 640px) {
    .theme-picker-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.theme-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.theme-card:hover {
    background-color: var(--bg-card-hover) !important;
    border-color: var(--border-focus) !important;
}

.theme-card.active {
    border-color: #06b6d4 !important;
}

.theme-card.active::after {
    content: "✓";
    position: absolute;
    top: -8px;
    right: -8px;
    background: #06b6d4;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-family: system-ui, sans-serif !important;
}

.theme-card-preview {
    width: 100%;
    height: 70px;
    border-radius: 4px;
    margin-bottom: 0.75rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255,255,255,0.05);
}

.mini-app-topbar {
    height: 12px;
    background: rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    padding: 0 4px;
    gap: 3px;
}
.mini-app-topbar span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
}
.mini-app-body {
    display: flex;
    flex: 1;
}
.mini-app-sidebar {
    width: 25%;
    border-right: 1px solid rgba(255,255,255,0.05);
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mini-app-content {
    flex: 1;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.mini-line {
    height: 3px;
    border-radius: 2px;
    background: rgba(255,255,255,0.2);
}

.theme-card-label {
    font-size: 0.75rem;
    text-align: center;
    color: var(--text-secondary);
}
.theme-card.active .theme-card-label {
    color: #06b6d4;
}

/* AI Agent FAB & Chatbot UI */
.ai-fab {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--brand-gradient);
    color: white;
    font-weight: 800;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.ai-fab:hover {
    transform: scale(1.1);
}

.ai-msg {
    display: flex;
    margin-bottom: 0.25rem;
}
.ai-msg-user {
    justify-content: flex-end;
}
.ai-msg-bot {
    justify-content: flex-start;
}

.ai-msg-bubble {
    max-width: 90%;
    padding: 0.85rem 1.1rem;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.65;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.ai-msg-user .ai-msg-bubble {
    background: var(--brand-gradient);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}
.ai-msg-bot .ai-msg-bubble {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.chip {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    border-radius: 9999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.chip:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background: var(--bg-card-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* ── Explore View ────────────────────────────────────────── */
.explore-layout {
    display: flex;
    flex-direction: row;
    height: calc(100vh - 64px); /* Subtract topbar */
    overflow: hidden;
}

.explore-sidebar {
    width: 350px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background-color: var(--bg-app);
}

.explore-map-container {
    flex: 1;
    position: relative;
    background-color: #f0f0f0; /* Fallback for maps */
}

@media (max-width: 768px) {
    .explore-layout {
        flex-direction: column;
    }
    .explore-sidebar {
        width: 100%;
        height: 50vh;
        border-bottom: 1px solid var(--border-default);
    }
    .explore-map-container {
        height: 50vh;
        min-height: auto !important;
        border-left: none !important;
    }
}
