/*
 * Converti Application Styles
 */

/* ========================================
   CSS Variables
   ======================================== */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --success: #10b981;
  --success-light: #d1fae5;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --warning-light: #fef3c7;

  --text: #1f2937;
  --text-light: #6b7280;
  --text-muted: #9ca3af;

  --bg: #ffffff;
  --bg-alt: #f9fafb;
  --bg-dark: #f3f4f6;

  --border: #e5e7eb;
  --border-light: #f3f4f6;

  --radius: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px 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);
}

/* ========================================
   Base Styles
   ======================================== */
*= require simple_calendar

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg-alt);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3, h4 {
  line-height: 1.3;
  font-weight: 600;
}

/* ========================================
   Utility Classes
   ======================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hidden { display: none !important; }
.mt-4 { margin-top: 1rem; }
.flex-1 { flex: 1; }

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg-dark);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary-light);
}

.btn-success {
  background: var(--success);
  color: white;
}

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

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-large {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
}

/* ========================================
   Forms
   ======================================== */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.form-control {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control-file {
  font-size: 0.875rem;
}

.form-hint {
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.form-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.form-section h3, .form-section h4 {
  margin-bottom: 1rem;
  font-size: 1rem;
  color: var(--text);
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.input-group {
  display: flex;
  align-items: center;
}

.input-prefix {
  padding: 0.625rem 0.75rem;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  color: var(--text-light);
}

.input-group .form-control {
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ========================================
   Alerts
   ======================================== */
.alert {
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.alert-error {
  background: var(--danger-light);
  color: #991b1b;
}

.alert-warning {
  background: var(--warning-light);
  color: #92400e;
}

.alert ul {
  margin-left: 1.25rem;
}

/* ========================================
   Status Badges
   ======================================== */
.status-badge {
  display: inline-flex;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  text-transform: capitalize;
}

.status-badge.draft { background: var(--bg-dark); color: var(--text-light); }
.status-badge.processing { background: var(--warning-light); color: #92400e; }
.status-badge.ready { background: var(--primary-light); color: var(--primary-dark); }
.status-badge.published, .status-badge.active { background: var(--success-light); color: #065f46; }
.status-badge.failed { background: var(--danger-light); color: #991b1b; }
.status-badge.pending { background: var(--bg-dark); color: var(--text-light); }

/* ========================================
   Page Header
   ======================================== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.75rem;
}

.page-actions {
  display: flex;
  gap: 0.75rem;
}

/* ========================================
   Wizard Header (Step Navigation)
   ======================================== */
.wizard-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  margin-bottom: 2rem;
}

.wizard-steps {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: var(--text-light);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.15s ease;
}

.wizard-step:hover:not(.disabled) {
  background: var(--bg-alt);
  text-decoration: none;
}

.wizard-step.active {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.wizard-step.completed {
  color: var(--success);
}

.wizard-step.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--bg-dark);
  font-size: 0.8125rem;
  font-weight: 600;
}

.wizard-step.active .step-number {
  background: var(--primary);
  color: white;
}

.wizard-step.completed .step-number {
  background: var(--success);
  color: white;
}

.step-name {
  display: none;
}

@media (min-width: 768px) {
  .step-name {
    display: inline;
  }
}

/* ========================================
   Wizard Content
   ======================================== */
.wizard-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

.wizard-step-header {
  margin-bottom: 2rem;
}

.wizard-step-header h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.wizard-step-header p {
  color: var(--text-light);
}

.wizard-form {
  background: var(--bg);
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.wizard-actions,
.wizard-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 2rem;
  background: var(--bg);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
  z-index: 50;
}

.wizard-sidebar-action {
  margin-top: 1.5rem;
  text-align: center;
}

/* ========================================
   Selectable Cards
   ======================================== */
.selectable-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.selectable-card {
  display: block;
  padding: 1.25rem;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.15s ease;
}

.selectable-card:hover {
  border-color: var(--primary);
}

.selectable-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.selectable-card .card-content h3 {
  font-size: 1rem;
  margin-bottom: 0.375rem;
}

.selectable-card .card-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* ========================================
   Notifications Bar
   ======================================== */
.notifications-bar {
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.notifications-bar:empty,
.notifications-bar:not(:has(.job-status:not(.hidden))):not(:has(.notification)) {
  display: none;
}

.job-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.job-status.hidden {
  display: none;
}

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

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

.notification {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
}

.notification.processing {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.notification.completed {
  background: var(--success-light);
  color: #065f46;
}

.notification.failed {
  background: var(--danger-light);
  color: #991b1b;
}

/* ========================================
   Services Section (Step 3)
   ======================================== */
.services-list {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.service-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.service-card-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.service-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius);
}

.service-info h4 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.service-info p {
  font-size: 0.875rem;
  color: var(--text-light);
}

.service-card-actions {
  display: flex;
  gap: 0.5rem;
}

.service-form-wrapper {
  background: var(--bg-alt);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

/* ========================================
   Page Editor (Two-Pane Layout)
   ======================================== */
.page-editor {
  display: grid;
  grid-template-columns: 400px 1fr;
  min-height: 100vh;
}

.editor-sidebar {
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.editor-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.editor-header h2 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.editor-subtitle {
  font-size: 0.875rem;
  color: var(--text-light);
}

.editor-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  flex: 1;
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-light);
  text-align: center;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  color: var(--text);
  text-decoration: none;
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.editor-panel-content,
.editor-panel-templates,
.editor-panel-media {
  padding: 1.5rem;
  flex: 1;
  overflow-y: auto;
}

.editor-panel-content h3,
.editor-panel-templates h3,
.editor-panel-media h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.editor-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.editor-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.published-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.editor-preview {
  background: var(--bg-dark);
  display: flex;
  flex-direction: column;
}

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

.preview-label {
  font-size: 0.8125rem;
  color: var(--text-light);
  font-weight: 500;
}

.preview-frame {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

.preview-frame.updating {
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

/* ========================================
   Templates Grid (Editor)
   ======================================== */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.template-form {
  display: contents;
}

.template-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
}

.template-card:hover {
  border-color: var(--primary);
}

.template-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.template-thumb {
  width: 80px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}

.template-bold { background: #1f2937; color: white; font-weight: bold; }
.template-futuristic { background: linear-gradient(135deg, #667eea, #764ba2); color: white; }
.template-luxurious { background: linear-gradient(135deg, #d4af37, #f4e4bc); color: #3d3d3d; }
.template-arabic { background: #065f46; color: white; }

.template-icon {
  font-size: 1.5rem;
  font-weight: bold;
}

.template-name {
  font-size: 0.875rem;
  font-weight: 500;
}

.template-badge {
  font-size: 0.6875rem;
  color: var(--primary);
  margin-top: 0.25rem;
}

.template-info {
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.template-info h4 {
  font-size: 0.9375rem;
  margin-bottom: 0.375rem;
}

.template-info p {
  font-size: 0.8125rem;
  color: var(--text-light);
}

/* ========================================
   Media Upload
   ======================================== */
.media-upload {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.media-preview {
  width: 100%;
  max-width: 200px;
}

.media-preview.small {
  max-width: 100px;
}

.preview-image {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.file-name {
  font-size: 0.8125rem;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

/* ========================================
   Landing Page Preview
   ======================================== */
.landing-page-preview {
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.preview-hero {
  padding: 3rem 2rem;
  text-align: center;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg) 100%);
}

.preview-logo {
  max-width: 120px;
  max-height: 60px;
  margin-bottom: 1.5rem;
}

.preview-hero h1 {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

.hero-subheading {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.hero-ctas {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.preview-services,
.preview-reviews,
.preview-offer {
  padding: 2rem;
}

.preview-services {
  background: var(--bg-alt);
}

.preview-services h2,
.preview-reviews h2,
.preview-offer h2 {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.service-item {
  text-align: center;
  padding: 1rem;
}

.service-item .service-image {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 0.75rem;
}

.service-item h3 {
  font-size: 0.9375rem;
  margin-bottom: 0.375rem;
}

.service-item p {
  font-size: 0.8125rem;
  color: var(--text-light);
}

.reviews-grid {
  display: grid;
  gap: 1rem;
}

.review-item {
  padding: 1rem;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
}

.review-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.review-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.review-avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.review-meta strong {
  display: block;
  font-size: 0.875rem;
}

.review-stars {
  font-size: 0.75rem;
  color: var(--warning);
}

.review-content {
  font-size: 0.875rem;
  color: var(--text-light);
}

.preview-offer {
  background: var(--primary);
  color: white;
  text-align: center;
}

.preview-offer h2 {
  color: white;
}

.preview-offer p {
  opacity: 0.9;
  margin-bottom: 1rem;
}

.benefits-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
}

.benefits-list li::before {
  content: "✓ ";
}

.preview-footer {
  padding: 1.5rem 2rem;
  background: var(--bg-dark);
}

.footer-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.cta-button {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  text-decoration: none;
}

.cta-call {
  background: var(--primary);
  color: white;
}

.cta-whatsapp {
  background: #25d366;
  color: white;
}

.cta-maps {
  background: var(--text);
  color: white;
}

/* ========================================
   Projects Grid
   ======================================== */
.projects-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}


.project-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

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

.project-card-header h3 {
  font-size: 1.125rem;
}

.project-card-body {
  padding: 1.5rem;
}

.project-description {
  color: var(--text-light);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.project-progress {
  margin-bottom: 1rem;
}

.progress-label {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
}

.progress-bar {
  height: 6px;
  background: var(--bg-dark);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.project-link {
  font-size: 0.875rem;
}

.project-card-actions {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  background: var(--bg-alt);
}

/* ========================================
   Project Show
   ======================================== */
.project-show {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

.project-overview {
  display: grid;
  gap: 1.5rem;
}

.overview-section {
  background: var(--bg);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.overview-section h2 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.steps-summary {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  background: var(--bg-alt);
}

.step-item.current {
  background: var(--primary-light);
}

.step-item.completed .step-number {
  background: var(--success);
  color: white;
}

.step-edit-link {
  margin-left: auto;
  font-size: 0.8125rem;
}

.details-list {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.5rem 1rem;
}

.details-list dt {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.details-list dd {
  font-size: 0.9375rem;
}

/* ========================================
   Empty State
   ======================================== */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--bg);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
}

.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.empty-state.small {
  padding: 1.5rem;
}

/* ========================================
   Dynamic Fields (Campaign Step)
   ======================================== */
.dynamic-field {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.dynamic-field .form-control {
  flex: 1;
}

.btn-remove {
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-light);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.btn-remove:hover {
  background: var(--danger-light);
  border-color: var(--danger);
  color: var(--danger);
}

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 768px) {
  .page-editor {
    grid-template-columns: 1fr;
  }

  .editor-preview {
    display: none;
  }

  .wizard-content {
    padding: 0 1rem 5rem;
  }

  .wizard-actions,
  .wizard-footer {
    padding: 1rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .selectable-cards {
    grid-template-columns: 1fr;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .templates-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   Bookings
   ======================================== */
.bookings-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

/* Calendar */
.calendar-container {
  background: var(--bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 2rem;
}

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

.calendar-header h2 {
  font-size: 1.25rem;
  margin: 0;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.weekday {
  padding: 0.75rem;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-light);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-collapse: collapse;
}

.calendar-day {
  min-height: 100px;
  padding: 0.5rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
  position: relative;
}

.calendar-day:not(:nth-child(7n)) {
  border-right: 1px solid var(--border-light);
}

.calendar-day.empty {
  background: var(--bg-alt);
}

.calendar-day.today {
  background: var(--primary-light);
}

.calendar-day.has-bookings .day-number {
  color: var(--primary);
  font-weight: 600;
}

.day-number {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
  color: var(--text);
}

.day-bookings {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.booking-dot {
  display: flex;
  flex-direction: column;
  padding: 0.25rem 0.375rem;
  background: var(--primary);
  color: white;
  border-radius: 4px;
  font-size: 0.6875rem;
  text-decoration: none;
  transition: background 0.15s ease;
}

.booking-dot:hover {
  background: var(--primary-dark);
  text-decoration: none;
  color: white;
}

.booking-time {
  font-weight: 600;
}

.booking-name {
  opacity: 0.9;
}

/* Bookings List */
.bookings-list-section {
  background: var(--bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.5rem;
}

.bookings-list-section h3 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.bookings-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Booking Card */
.booking-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease;
}

.booking-card:hover {
  border-color: var(--primary);
}

.booking-card-content {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex: 1;
}

.booking-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.booking-info h4 {
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
}

.booking-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-light);
}

.booking-date,
.booking-service {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.booking-service {
  color: var(--primary);
  font-weight: 500;
}

.booking-contact {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--text-light);
  text-decoration: none;
}

.contact-link:hover {
  color: var(--primary);
}

.booking-card-actions {
  flex-shrink: 0;
}

/* Booking Show Page */
.booking-show-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

.page-subtitle {
  color: var(--text-light);
  font-size: 0.9375rem;
  margin-top: 0.25rem;
}

.booking-details-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
}

.detail-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.detail-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-alt);
}

.booking-avatar-large {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.detail-card-header h2 {
  font-size: 1.375rem;
  margin-bottom: 0.375rem;
}

.detail-section {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.detail-section:last-of-type {
  border-bottom: none;
}

.detail-section h3 {
  font-size: 0.9375rem;
  margin-bottom: 1rem;
  color: var(--text-light);
  font-weight: 500;
}

.detail-actions {
  display: flex;
  gap: 0.75rem;
  padding: 1.5rem;
  background: var(--bg-alt);
  border-top: 1px solid var(--border-light);
}

/* Sidebar Cards */
.sidebar-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.sidebar-card h3 {
  font-size: 0.9375rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.service-preview-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}

.service-preview h4 {
  font-size: 1rem;
  margin-bottom: 0.375rem;
}

.service-preview p {
  font-size: 0.8125rem;
  color: var(--text-light);
}

.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem;
  background: var(--bg-alt);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease;
}

.quick-action-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
}

.quick-action-btn.whatsapp:hover {
  background: #dcf8c6;
  color: #128c7e;
}

/* Booking Form */
.booking-form-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.booking-form-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.booking-form-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-alt);
}

.booking-form-header h2 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.booking-service-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  font-size: 0.9375rem;
  font-weight: 500;
  margin: 0;
}

.booking-form-body {
  padding: 1.5rem;
}

.booking-form-actions {
  padding: 1rem 1.5rem 1.5rem;
}

.booking-form-footer {
  margin-top: 1rem;
  text-align: center;
}

.btn-full {
  width: 100%;
}

/* Service Show Page */
.service-show-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.service-show-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  align-items: start;
}

.service-details {
  background: var(--bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.service-hero-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.service-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-content {
  padding: 1.5rem;
}

.service-content h1 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.service-description {
  color: var(--text-light);
  line-height: 1.7;
}

.service-description p {
  margin-bottom: 1rem;
}

.service-description p:last-child {
  margin-bottom: 0;
}

.service-booking-section {
  position: sticky;
  top: 2rem;
}

.booking-loading {
  background: var(--bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 3rem;
  text-align: center;
  color: var(--text-light);
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 0.8s linear infinite;
}

/* Booking Frame (Turbo Frame) */
.booking-frame {
  background: var(--bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.booking-frame-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-alt);
}

.booking-frame-header h3 {
  font-size: 1.125rem;
  margin: 0;
}

/* Bookings Responsive */
@media (max-width: 768px) {
  .calendar-day {
    min-height: 70px;
    padding: 0.25rem;
  }

  .day-number {
    font-size: 0.75rem;
  }

  .booking-dot {
    padding: 0.125rem 0.25rem;
    font-size: 0.625rem;
  }

  .booking-name {
    display: none;
  }

  .weekday {
    padding: 0.5rem 0.25rem;
    font-size: 0.75rem;
  }

  .booking-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .booking-contact {
    flex-direction: row;
    gap: 1rem;
  }

  .booking-card-actions {
    width: 100%;
  }

  .booking-card-actions .btn {
    width: 100%;
  }

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

  .booking-sidebar {
    order: -1;
  }

  .detail-actions {
    flex-direction: column;
  }

  .service-show-grid {
    grid-template-columns: 1fr;
  }

  .service-booking-section {
    position: static;
  }
}

:root {
  --brand-orange: #f97316;       /* Vibrant Orange */
  --brand-orange-light: #fff7ed; /* Very pale orange for backgrounds */
  --brand-orange-border: #fdba74; /* Soft orange for borders */
  --text-dark: #1c1917;          /* Warm black */
  --text-gray: #57534e;          /* Warm gray */
  --success-green: #10b981;      /* Keep green for "Good" results */
}

/* The main grid container */
.analytics-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  padding: 32px;
  background-color: #fafaf9; /* Warm off-white page background */
}

/* Individual Project Card */
.project-card {
  background: white;
  border: 1px solid #e7e5e4;
  border-top: 4px solid var(--brand-orange); /* Top Accent Bar */
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(249, 115, 22, 0.05); /* Orange-tinted shadow */
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(249, 115, 22, 0.15); /* Stronger glow on hover */
  border-color: var(--brand-orange-border);
}

/* Card Header */
.card-header {
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0;
  letter-spacing: -0.02em;
}

/* Key Metrics Row (Leads) */
.metrics-row {
  display: flex;
  gap: 12px; /* Better spacing than margins */
  margin-bottom: 24px;
}

.metric-box {
  background: var(--brand-orange-light); /* Light Orange BG */
  border: 1px solid #ffedd5;
  padding: 16px;
  border-radius: 10px;
  text-align: center;
  flex: 1;
  transition: background 0.2s;
}

/* Make the 'Qualified' box slightly distinct (Green tint or White) */
.metric-box.qualified-box {
  background: #f0fdf4; /* Light Green Tint */
  border-color: #dcfce7;
}

.metric-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  color: #9a3412; /* Dark Orange Text */
  display: block;
  margin-bottom: 4px;
  letter-spacing: 0.05em;
}

.metric-box.qualified-box .metric-label {
  color: #166534; /* Dark Green Text */
}

.metric-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1;
}

.metric-value.qualified {
  color: var(--success-green);
}

/* Campaign Section */
.campaign-section {
  background: white;
  border-top: 1px dashed #e7e5e4;
  padding-top: 16px;
  margin-top: auto; 
}

.campaign-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #a8a29e;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.campaign-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e7e5e4;
}

/* Data Rows */
.campaign-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  margin-bottom: 10px;
  color: var(--text-dark);
}

.campaign-stat span:first-child {
  color: var(--text-gray);
  font-weight: 500;
}

.campaign-stat strong {
  font-weight: 700;
  background: #f5f5f4;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.85rem;
}

/* Special styling for currency/important numbers */
.campaign-stat strong.highlight {
  background: var(--brand-orange-light);
  color: #ea580c; /* Deep Orange */
}

.no-campaign {
  background: #f5f5f4;
  color: #a8a29e;
  font-size: 0.9rem;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  margin-top: 10px;
}
