/* ============================================
   Grid Planner — Design System
   Notion-inspired dark theme
   ============================================ */

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

/* ── CSS Variables ─────────────────────── */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-surface: #16161e;
  --bg-surface-hover: #1e1e2a;
  --bg-surface-active: #252535;
  --bg-glass: rgba(22, 22, 30, 0.7);

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.1);
  --border-accent: rgba(139, 92, 246, 0.3);

  --accent: #8b5cf6;
  --accent-hover: #a78bfa;
  --accent-glow: rgba(139, 92, 246, 0.15);
  --accent-gradient: linear-gradient(135deg, #8b5cf6, #6d28d9);

  --text-primary: #f0f0f5;
  --text-secondary: #8888a0;
  --text-tertiary: #55556a;
  --text-accent: #c4b5fd;

  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 30px rgba(139, 92, 246, 0.1);

  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Light Mode System (White & Purple) ── */
:root.light-theme {
  --bg-primary: linear-gradient(135deg, #fdfbff 0%, #f4f0ff 100%);
  --bg-secondary: #f7f5ff;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f1ecff;
  --bg-surface-active: #e6dbff;
  --bg-glass: rgba(255, 255, 255, 0.75);

  --border-subtle: rgba(124, 58, 237, 0.05);
  --border-light: rgba(124, 58, 237, 0.12);
  --border-accent: rgba(124, 58, 237, 0.35);

  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-glow: rgba(124, 58, 237, 0.15);
  --accent-gradient: linear-gradient(135deg, #7c3aed, #5b21b6);

  --text-primary: #1e1b4b; /* Deep Indigo Black */
  --text-secondary: #5d537a; /* Soft Violet-Grey */
  --text-tertiary: #a199bf; /* Soft Lavender-Grey */
  --text-accent: #7c3aed;

  --shadow-sm: 0 4px 12px rgba(124, 58, 237, 0.03);
  --shadow-md: 0 12px 30px rgba(124, 58, 237, 0.06);
  --shadow-lg: 0 24px 60px rgba(124, 58, 237, 0.12);
  --shadow-glow: 0 0 40px rgba(124, 58, 237, 0.15);
}

/* ── Reset ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition-normal), color var(--transition-normal), border-color var(--transition-normal);
}

a { color: var(--text-accent); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }

/* ── Layout ────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header / Navbar ───────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
}

.navbar-inner {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.navbar-brand .icon {
  width: 32px;
  height: 32px;
  background: var(--accent-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.navbar-back {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.navbar-back:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

/* ── Page Header ───────────────────────── */
.page-header {
  padding: 48px 0 32px;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

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

/* ── Brand Cards Grid ──────────────────── */
.brands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  padding-bottom: 60px;
}

.brand-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}
.brand-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity var(--transition-normal);
}
.brand-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}
.brand-card:hover::before { opacity: 1; }

.brand-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.brand-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.brand-name {
  font-size: 1.1rem;
  font-weight: 600;
}

.brand-handle {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.brand-stats {
  display: flex;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.brand-stat {
  display: flex;
  flex-direction: column;
}
.brand-stat-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
}
.brand-stat-label {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Add Brand Card ────────────────────── */
.brand-card-add {
  background: transparent;
  border: 2px dashed var(--border-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 180px;
  color: var(--text-tertiary);
  transition: all var(--transition-normal);
}
.brand-card-add:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}
.brand-card-add .add-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all var(--transition-normal);
}
.brand-card-add:hover .add-icon {
  transform: scale(1.1);
}

/* ── Buttons ───────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 2px 12px rgba(139, 92, 246, 0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
}
.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-accent);
}

.btn-ghost {
  color: var(--text-secondary);
  padding: 8px 12px;
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-surface); }

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

/* ── Modal ─────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 480px;
  padding: 32px;
  transform: translateY(20px) scale(0.95);
  transition: transform var(--transition-slow);
  box-shadow: var(--shadow-lg);
}
.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ── Form ──────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color var(--transition-fast);
  outline: none;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder { color: var(--text-tertiary); }

/* ── Tabs ──────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab {
  padding: 12px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.tab:hover { color: var(--text-primary); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

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

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

.calendar-month {
  font-size: 1.25rem;
  font-weight: 600;
}

.calendar-nav {
  display: flex;
  gap: 8px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border-subtle);
}

.calendar-weekday {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: normal;
  padding: 10px 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.calendar-day {
  min-height: var(--calendar-cell-height, 120px);
  background: var(--bg-secondary);
  padding: 8px 10px;
  cursor: pointer;
  transition: background var(--transition-fast);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
}
.calendar-day:hover {
  background: var(--bg-surface-hover, rgba(255, 255, 255, 0.03));
}
.calendar-day.empty {
  background: rgba(255, 255, 255, 0.01);
  cursor: default;
}
.calendar-day.empty:hover {
  background: rgba(255, 255, 255, 0.01);
}

.calendar-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 4px;
}

.calendar-day-number {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.calendar-day-title {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--accent);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-left: 5px;
  cursor: pointer;
  border-radius: 3px;
  padding: 1px 3px;
  transition: background var(--transition-fast);
}

.calendar-day-title:hover {
  background: rgba(139, 92, 246, 0.15);
}

.notion-day-add-btn {
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text-tertiary);
  opacity: 0;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
  transition: opacity var(--transition-fast), color var(--transition-fast);
}

.calendar-day:hover .notion-day-add-btn {
  opacity: 1;
}

.notion-day-add-btn:hover {
  color: var(--accent);
}

.calendar-day.today .calendar-day-number {
  color: var(--accent);
  background: rgba(139, 92, 246, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

/* ── Notion Card inside Cell ────────────── */
.notion-card {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  padding: 6px 8px;
  margin-top: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all var(--transition-fast);
  text-align: left;
}

.notion-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  border-color: var(--border-accent);
}

.notion-card-cover {
  width: 100%;
  height: 54px;
  border-radius: 3px;
  background-size: cover;
  background-position: center;
  margin-bottom: 2px;
}

.notion-card-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notion-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.notion-badge {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 1.5px 6px;
  border-radius: 3px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* ── Grid Preview (3x5 Instagram) ──────── */
.grid-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  max-width: 480px;
  margin: 0 auto;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.grid-cell {
  aspect-ratio: 1;
  background: var(--bg-surface);
  background-size: cover;
  background-position: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}
.grid-cell:hover { opacity: 0.8; }
.grid-cell:hover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(139, 92, 246, 0.2);
}

/* ── Detail Sidebar ────────────────────── */
.detail-panel {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 90%;
  max-width: 720px;
  max-height: 90vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-normal);
  overflow-y: auto;
  padding: 32px 32px;
}
.detail-panel.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: all;
}

.detail-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 149;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}
.detail-panel-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.detail-image {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  background-size: cover;
  background-position: center;
  margin-bottom: 20px;
}

.detail-caption {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 16px;
  white-space: pre-wrap;
}

.detail-actions {
  display: flex;
  gap: 8px;
}

/* ── Stats Cards ───────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
}
.stat-card-label {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.stat-card-value {
  font-size: 1.5rem;
  font-weight: 700;
}

/* ── Photo Grid ────────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.photo-item {
  aspect-ratio: 1;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  background-size: cover;
  background-position: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 2px solid transparent;
}
.photo-item:hover { transform: scale(1.03); }
.photo-item.selected { border-color: var(--accent); }

/* ── Empty State ───────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-tertiary);
}
.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}
.empty-state-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ── Toast Notifications ───────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-size: 0.875rem;
  box-shadow: var(--shadow-md);
  animation: slideInRight 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--error); }

/* ── Animations ────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-surface-hover) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Responsive ────────────────────────── */
@media (max-width: 768px) {
  .brands-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 1.5rem; }
  .detail-panel { width: 95%; padding: 24px 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .calendar-day { padding: 4px; }
  .calendar-day-number { font-size: 0.65rem; }
}

/* ── Scrollbar ─────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ── Brand Detail Header ──────────────── */
.brand-detail-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 32px 0;
}

.brand-detail-avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.brand-detail-info h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.brand-detail-info .handle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.brand-detail-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

/* ── Loading ───────────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ── Badge ─────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-success { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-info { background: rgba(59,130,246,0.15); color: var(--info); }
.badge-error { background: rgba(239,68,68,0.15); color: var(--error); }

/* ── Drive Controls ───────────────────── */
.drive-controls {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
}

.drive-controls-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.drive-folder-input {
  flex: 1;
  min-width: 240px;
}

.drive-status {
  margin-top: 12px;
}

/* ── Photo Gallery ────────────────────── */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.photo-card {
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}
.photo-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.photo-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow), var(--shadow-glow);
}
.photo-card.selected::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  z-index: 2;
}

.photo-card-img {
  width: 100%;
  aspect-ratio: 1;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-surface-hover);
}

.photo-card-name {
  padding: 8px 10px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── AI Progress Bar ── */
@keyframes fillProgress {
  0% { width: 0%; }
  40% { width: 70%; }
  90% { width: 95%; }
  100% { width: 100%; }
}
.ai-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-surface-hover);
  border-radius: 2px;
  margin-top: 12px;
  overflow: hidden;
}
.ai-progress-bar-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  animation: fillProgress 15s ease-out forwards;
}

/* ── AI Persona Neon Borders ──────────────── */
@keyframes wavy-neon {
  0% { box-shadow: 0 0 10px rgba(var(--ai-rgb), 0.3), inset 0 0 5px rgba(var(--ai-rgb), 0.1); border-color: rgba(var(--ai-rgb), 0.5); }
  50% { box-shadow: 0 0 30px rgba(var(--ai-rgb), 0.8), inset 0 0 15px rgba(var(--ai-rgb), 0.4); border-color: rgba(var(--ai-rgb), 1); }
  100% { box-shadow: 0 0 10px rgba(var(--ai-rgb), 0.3), inset 0 0 5px rgba(var(--ai-rgb), 0.1); border-color: rgba(var(--ai-rgb), 0.5); }
}

.ai-neon-border {
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  position: relative;
  transition: all 0.5s ease;
}

.ai-neon-border.active {
  animation: wavy-neon 3s ease-in-out infinite;
  background: linear-gradient(180deg, rgba(var(--ai-rgb), 0.05) 0%, transparent 100%);
}

.neon-nova { --ai-rgb: 6, 182, 212; --ai-color: #06b6d4; }
.neon-evo { --ai-rgb: 16, 185, 129; --ai-color: #10b981; }
.neon-helix { --ai-rgb: 139, 92, 246; --ai-color: #8b5cf6; }
.neon-atlas { --ai-rgb: 59, 130, 246; --ai-color: #3b82f6; }
.neon-juno { --ai-rgb: 236, 72, 153; --ai-color: #ec4899; }
.neon-echo { --ai-rgb: 249, 115, 22; --ai-color: #f97316; }
.neon-astra { --ai-rgb: 234, 179, 8; --ai-color: #eab308; }

/* ── Calendars Side-by-Side Dynamic Grid ── */
.calendars-flex-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.calendars-flex-grid > div {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
}

/* Left open, Right closed */
.calendars-flex-grid.left-open {
  grid-template-columns: 1fr;
}
.calendars-flex-grid.left-open > :nth-child(1) {
  grid-column: 1 / -1;
  order: 1;
}
.calendars-flex-grid.left-open > :nth-child(2) {
  grid-column: 1 / -1;
  order: 2;
}

/* Right open, Left closed */
.calendars-flex-grid.right-open {
  grid-template-columns: 1fr;
}
.calendars-flex-grid.right-open > :nth-child(1) {
  grid-column: 1 / -1;
  order: 2;
}
.calendars-flex-grid.right-open > :nth-child(2) {
  grid-column: 1 / -1;
  order: 1;
}

/* Both open */
.calendars-flex-grid.both-open {
  grid-template-columns: 1fr;
}
.calendars-flex-grid.both-open > :nth-child(1) {
  grid-column: 1 / -1;
  order: 1;
}
.calendars-flex-grid.both-open > :nth-child(2) {
  grid-column: 1 / -1;
  order: 2;
}

@media (max-width: 1200px) {
  .calendars-flex-grid {
    grid-template-columns: 1fr !important;
  }
}

