/* Safari Planner Styles — Aperture22 */

:root {
  /* Packing list checkbox dimensions */
  --packing-checkbox-width: 18px;
  --packing-checkbox-gap: 8px;
}

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

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  min-height: 100vh;
}

/* Remove old header styles - now using shared navbar */

/* Main Layout */
.planner-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

.auth-required {
  text-align: center;
  padding: 60px 20px;
  color: #cbd5e1;
}

.auth-required a {
  color: #60a5fa;
  text-decoration: underline;
}

.planner-container {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 24px;
  align-items: start;
}

/* Left Panel: Form */
.planner-form-panel {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 24px;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.planner-form-panel h2 {
  margin: 0 0 8px 0;
  font-size: 1.5rem;
  color: #f1f5f9;
  font-weight: 600;
}

.panel-description {
  margin: 0 0 24px 0;
  font-size: 0.875rem;
  color: #94a3b8;
  line-height: 1.5;
}

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

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #cbd5e1;
}

.required {
  color: #f87171;
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.875rem;
  color: #e2e8f0;
  background: #0f172a;
  border: 1px solid #475569;
  border-radius: 6px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input[type="text"]:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #60a5fa;
}

.form-group input[type="text"]::placeholder,
.form-group textarea::placeholder {
  color: #64748b;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.checkbox-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: #cbd5e1;
  cursor: pointer;
  padding: 4px 0;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #60a5fa;
}

.generate-btn {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  background: #3b82f6;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}

.generate-btn:hover:not(:disabled) {
  background: #2563eb;
}

.generate-btn:disabled {
  background: #475569;
  cursor: not-allowed;
  opacity: 0.6;
}

.generate-btn.success {
  background: #10b981;
}

.generate-btn.success:hover {
  background: #059669;
}

/* Right Panel: Output */
.planner-output-panel {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 32px;
  min-height: 400px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
  line-height: 1.6;
}

.loading-state {
  text-align: center;
  padding: 60px 20px;
}

.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px auto;
  border: 3px solid #334155;
  border-top-color: #60a5fa;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-state p {
  color: #94a3b8;
  font-size: 0.875rem;
}

.error-state {
  padding: 20px;
  background: #7f1d1d;
  border: 1px solid #991b1b;
  border-radius: 8px;
  color: #fca5a5;
}

/* Plan Display */
.plan-display {
  color: #e2e8f0;
}

.plan-section {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #334155;
}

.plan-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Accordion Styles */
.planner-section-header {
  cursor: pointer;
  padding: 10px;
  font-weight: bold;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s, border-color 0.2s;
}

.planner-section-header:hover {
  background: #1e293b;
  border-color: #475569;
}

.planner-section-body {
  padding: 10px;
}

.hidden {
  display: none;
}

.plan-section h3 {
  margin: 0 0 16px 0;
  font-size: 1.25rem;
  color: #f1f5f9;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-section h4 {
  margin: 16px 0 8px 0;
  font-size: 1.125rem;
  color: #cbd5e1;
  font-weight: 600;
}

.plan-section p {
  margin: 0 0 12px 0;
  line-height: 1.6;
  color: #cbd5e1;
}

.plan-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.plan-list li {
  margin-bottom: 12px;
  padding-left: 24px;
  position: relative;
  line-height: 1.6;
  color: #cbd5e1;
}

.plan-list li::before {
  content: "•";
  position: absolute;
  left: 8px;
  color: #60a5fa;
  font-weight: bold;
}

.packing-item {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  transition: opacity 0.2s, border-color 0.2s;
}

.packing-item.packed {
  opacity: 0.6;
  border-color: #22c55e;
}

.packing-checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--packing-checkbox-gap);
  cursor: pointer;
  width: 100%;
}

.packing-checkbox {
  width: var(--packing-checkbox-width);
  height: var(--packing-checkbox-width);
  cursor: pointer;
  accent-color: #22c55e;
  flex-shrink: 0;
}

.packing-item-header {
  display: flex;
  align-items: center;
  gap: var(--packing-checkbox-gap);
  margin-bottom: 4px;
}

.packing-item-name {
  font-weight: 600;
  color: #f1f5f9;
  transition: text-decoration 0.2s;
}

.packing-item.packed .packing-item-name {
  text-decoration: line-through;
}

.packing-item-reason {
  font-size: 0.875rem;
  color: #94a3b8;
  margin-left: calc(var(--packing-checkbox-width) + var(--packing-checkbox-gap)); /* Checkbox width + gap */
}

.location-card {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  transition: opacity 0.2s, border-left 0.2s;
}

.location-card.completed {
  opacity: 0.6;
  border-left: 3px solid #4CAF50;
}

.location-header {
  margin-bottom: 12px;
}

.location-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 8px;
}

.location-meta {
  font-size: 0.875rem;
  color: #94a3b8;
  margin-bottom: 4px;
}

.shot-idea {
  background: #1e293b;
  border-left: 3px solid #60a5fa;
  padding: 12px;
  margin: 8px 0;
  border-radius: 4px;
}

.shot-idea-desc {
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.shot-idea-settings {
  font-size: 0.875rem;
  color: #94a3b8;
  margin-bottom: 4px;
}

.shot-idea-tip {
  font-size: 0.875rem;
  color: #60a5fa;
  font-style: italic;
}

.location-complete-btn {
  margin-top: 12px;
  width: 100%;
  padding: 8px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #cbd5e1;
  background: #0f172a;
  border: 1px solid #475569;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  font-family: inherit;
}

.location-complete-btn:hover {
  background: #1e293b;
  border-color: #4CAF50;
  color: #4CAF50;
}

.location-card.completed .location-complete-btn {
  border-color: #4CAF50;
  color: #4CAF50;
}

.warning {
  background: #7f1d1d;
  border: 1px solid #991b1b;
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 12px;
  font-size: 0.875rem;
  color: #fca5a5;
}

.itinerary-day {
  margin-bottom: 20px;
}

.day-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 10px;
}

.schedule-item {
  background: #0f172a;
  border-left: 3px solid #60a5fa;
  padding: 10px 12px;
  margin: 6px 0;
  border-radius: 4px;
  font-size: 0.875rem;
}

.schedule-time {
  font-weight: 600;
  color: #60a5fa;
}

.schedule-location {
  color: #cbd5e1;
  font-weight: 500;
}

.schedule-activity {
  color: #94a3b8;
}

.challenge-item {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.challenge-title {
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 4px;
}

.challenge-why {
  font-size: 0.875rem;
  color: #94a3b8;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .planner-container {
    grid-template-columns: 1fr;
  }

  .planner-form-panel {
    position: static;
    max-height: none;
  }

  .checkbox-group {
    grid-template-columns: 1fr;
  }

  .planner-output-panel {
    padding: 20px;
  }
}

/* Scrollbar styling for webkit browsers */
.planner-form-panel::-webkit-scrollbar {
  width: 8px;
}

.planner-form-panel::-webkit-scrollbar-track {
  background: #0f172a;
  border-radius: 4px;
}

.planner-form-panel::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
}

.planner-form-panel::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* My Plans Section */
.my-plans-section {
  max-width: 1400px;
  margin: 40px auto 0 auto;
  padding: 0 20px;
}

.my-plans-section h2 {
  font-size: 1.75rem;
  color: #f1f5f9;
  font-weight: 600;
  margin-bottom: 24px;
}

.plans-loading,
.plans-empty {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
}

.plans-group {
  margin-bottom: 32px;
}

.plans-group h3 {
  font-size: 1.25rem;
  color: #cbd5e1;
  font-weight: 600;
  margin-bottom: 16px;
}

.plans-list {
  display: grid;
  gap: 16px;
}

.plan-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.plan-card:hover {
  border-color: #475569;
  background: #1e293b;
}

.plan-card.expanded {
  cursor: default;
}

.plan-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.plan-card-title {
  flex: 1;
}

.plan-card-title h4 {
  font-size: 1.125rem;
  color: #f1f5f9;
  font-weight: 600;
  margin: 0 0 4px 0;
}

.plan-card-meta {
  font-size: 0.875rem;
  color: #94a3b8;
  margin-bottom: 2px;
}

.plan-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.planned {
  background: #1e40af;
  color: #93c5fd;
}

.status-badge.completed {
  background: #065f46;
  color: #6ee7b7;
}

.status-badge.archived {
  background: #374151;
  color: #9ca3af;
}

.status-btn {
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 500;
  color: #cbd5e1;
  background: #0f172a;
  border: 1px solid #475569;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.status-btn:hover {
  background: #1e293b;
  border-color: #60a5fa;
}

.delete-btn {
  padding: 6px 10px;
  font-size: 1rem;
  color: #f87171;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  line-height: 1;
}

.delete-btn:hover {
  background: #7f1d1d;
  border-color: #dc2626;
  color: #fca5a5;
}

.plan-card-content {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #334155;
}

.plan-card-content .plan-display {
  /* Reuse existing plan display styles */
}

.expand-icon {
  font-size: 0.875rem;
  color: #60a5fa;
  transition: transform 0.2s;
}

.plan-card.expanded .expand-icon {
  transform: rotate(180deg);
}

/* Planning Mode Toggle */
.planning-mode-toggle {
  display: flex;
  background: #0f172a;
  border: 1px solid #475569;
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
}

.mode-toggle-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #94a3b8;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.mode-toggle-btn:hover {
  color: #cbd5e1;
}

.mode-toggle-btn.active {
  color: #ffffff;
  background: #3b82f6;
}

/* Detailed Itinerary Section */
.detailed-itinerary-section {
  margin-top: 8px;
}

.field-subtext {
  margin: 4px 0 16px 0;
  font-size: 0.8125rem;
  color: #94a3b8;
  line-height: 1.5;
}

.itinerary-days-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.day-card {
  background: #0f172a;
  border: 1px solid #475569;
  border-radius: 8px;
  padding: 16px;
  position: relative;
}

.day-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.day-number {
  font-size: 0.875rem;
  font-weight: 600;
  color: #f1f5f9;
}

.day-remove-btn {
  padding: 4px 8px;
  font-size: 0.875rem;
  color: #f87171;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
}

.day-remove-btn:hover {
  background: #7f1d1d;
  border-color: #dc2626;
  color: #fca5a5;
}

.day-type-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.day-type-btn {
  flex: 1;
  padding: 6px 10px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #94a3b8;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.day-type-btn:hover {
  border-color: #475569;
  color: #cbd5e1;
}

.day-type-btn.active {
  color: #ffffff;
  background: #3b82f6;
  border-color: #3b82f6;
}

.day-card input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  font-size: 0.8125rem;
  color: #e2e8f0;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 6px;
  font-family: inherit;
  transition: border-color 0.2s;
  margin-bottom: 8px;
}

.day-card input[type="text"]:focus {
  outline: none;
  border-color: #60a5fa;
}

.day-card input[type="text"]::placeholder {
  color: #64748b;
}

.add-day-btn {
  width: 100%;
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #60a5fa;
  background: #0f172a;
  border: 1px dashed #475569;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.add-day-btn:hover:not(:disabled) {
  border-color: #60a5fa;
  background: #1e293b;
}

.add-day-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.validation-message {
  margin-top: 12px;
  padding: 10px 12px;
  background: #7f1d1d;
  border: 1px solid #991b1b;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #fca5a5;
}


/* Progressive Day-by-Day Animation Styles */
.day-section-wrapper {
  margin-bottom: 24px;
}

.day-section {
  padding: 20px;
  background: rgba(30, 41, 59, 0.5);
  border-radius: 8px;
  border-left: 3px solid #3b82f6;
}

.day-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 16px 0;
  color: #f1f5f9;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding-bottom: 8px;
}

.day-schedule {
  margin-top: 20px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 6px;
}

.day-schedule h4 {
  margin: 0 0 12px 0;
  font-size: 1rem;
  color: #cbd5e1;
}

.schedule-notes {
  margin-top: 4px;
  font-size: 0.875rem;
  color: #94a3b8;
  font-style: italic;
}

/* Ensure smooth transitions for progressive rendering */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.day-section-wrapper.animating {
  animation: slideIn 0.5s ease forwards;
}

/* ── Plan Navigation ─────────────────────────────────────────────────────── */

.plan-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #FFFFFF;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  padding: 12px 16px;
  margin-bottom: 20px;
  border-radius: 8px;
}

.plan-nav-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #E5E7EB #FFFFFF;
}

.plan-nav-pills::-webkit-scrollbar {
  height: 6px;
}

.plan-nav-pills::-webkit-scrollbar-track {
  background: #FFFFFF;
}

.plan-nav-pills::-webkit-scrollbar-thumb {
  background: #E5E7EB;
  border-radius: 3px;
}

.plan-nav-pills::-webkit-scrollbar-thumb:hover {
  background: #D1D5DB;
}

.plan-nav-pill {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid #E5E7EB;
  background: #F3F4F6;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.plan-nav-pill:hover {
  background: #E5E7EB;
}

.plan-nav-pill.active {
  background: var(--color-accent, #2563EB);
  color: #FFFFFF;
  border-color: var(--color-accent, #2563EB);
}

/* ── Back to Top Button ───────────────────────────────────────────────────── */

.back-to-top-btn {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-accent, #2563EB);
  color: #FFFFFF;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: opacity 0.3s ease, transform 0.2s ease;
  z-index: 90;
  opacity: 0.8;
}

.back-to-top-btn:hover {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.back-to-top-btn.hidden {
  display: none;
}

/* ── Day Notes ────────────────────────────────────────────────────────────── */

.day-notes-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #334155;
}

.day-notes-label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.day-notes-textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #1e293b;
  color: #e2e8f0;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.day-notes-textarea::placeholder {
  color: #64748b;
}

.day-notes-textarea:focus {
  outline: none;
  border-color: var(--color-accent, #2563EB);
}

.day-notes-status {
  display: inline-block;
  font-size: 0.8rem;
  margin-top: 6px;
  font-weight: 500;
}

.day-notes-status.saving {
  color: #64748b;
}

.day-notes-status.saved {
  color: #10B981;
}

.day-notes-status.error {
  color: #EF4444;
}

/* Mobile adjustments for navigation */
@media (max-width: 768px) {
  .plan-nav {
    padding: 8px 12px;
  }
  
  .plan-nav-pill {
    font-size: 0.8rem;
    padding: 5px 14px;
  }
  
  .back-to-top-btn {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
  }
}
