/*
 * Minimal styles for Salon HQ
 */

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

/* Spacing utilities */
.page-content {
  padding: 20px;
}
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.-mt-4 { margin-top: -1rem; }
.p-4 { padding: 1rem; }
.pt-8 { padding-top: 2rem; }
.pb-8 { padding-bottom: 2rem; }
.py-4 { padding: 1rem 0; }
.py-8 { padding: 2rem 0; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.min-h-screen { min-height: 100vh; }

/* Flex utilities */
.flex { display: flex; }
.flex-1 { flex: 1; }
.flex-col { flex-direction: column; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 1rem; }

/* Border utilities */
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-red-200 { border-color: #fecaca; }

/* Text utilities */
.text-2xl { font-size: 1.5rem; }
.text-xl { font-size: 1.25rem; }
.text-sm { font-size: 0.875rem; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-green-700 { color: #15803d; }
.text-green-800 { color: #166534; }
.text-yellow-700 { color: #a16207; }
.text-yellow-800 { color: #854d0e; }
.text-blue-700 { color: #1d4ed8; }
.text-blue-800 { color: #1e40af; }
.text-red-600 { color: #dc2626; }
.text-red-700 { color: #b91c1c; }
.text-red-800 { color: #991b1b; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

/* Background utilities */
.bg-transparent { background-color: transparent; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-green-50 { background-color: #f0fdf4; }
.bg-yellow-50 { background-color: #fefce8; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-red-50 { background-color: #fef2f2; }

/* Border utilities for inputs */
.border-b-2 { border-bottom-width: 2px; border-bottom-style: solid; }
.border-transparent { border-color: transparent; }
.border-gray-300 { border-color: #d1d5db; }
.border-blue-500 { border-color: #3b82f6; }

/* Rounded utilities */
.rounded { border-radius: 0.25rem; }

/* Focus utilities */
.focus\:outline-none:focus { outline: none; }
.focus\:border-blue-500:focus { border-color: #3b82f6; }

/* Transition utilities */
.transition-colors { transition-property: color, background-color, border-color; transition-duration: 150ms; }
.hover\:border-gray-300:hover { border-color: #d1d5db; }

/* Border utilities for status boxes */
.border { border-width: 1px; border-style: solid; }
.border-green-200 { border-color: #bbf7d0; }
.border-yellow-200 { border-color: #fef08a; }
.border-blue-200 { border-color: #bfdbfe; }
.border-gray-200 { border-color: #e5e7eb; }

/* Link styles */
.link { color: #3498db; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* Badge styles */
.badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }

/* Base */
body {
  font-family: "Fira Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #f5f5f5;
}

/* Shared heading styles */
.heading-1 {
  font-size: 1.8em;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 0.4em;
  color: #2c3e50;
}

.heading-2 {
  font-size: 1.4em;
  font-weight: 600;
  margin-bottom: 0.4em;
  color: #34495e;
}

.heading-3 {
  font-size: 1.2em;
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.4em;
  color: #34495e;
}

/* Shared paragraph styles */
.text-paragraph {
  margin-bottom: 1em;
  line-height: 1.6;
}

.text-paragraph-sm {
  margin-bottom: 0.75em;
  font-size: 0.9em;
  line-height: 1.5;
}

.text-paragraph-lg {
  margin-bottom: 1.25em;
  font-size: 1.1em;
  line-height: 1.7;
}

/* Prose content (long-form pages like privacy policy, terms) */
.prose ul,
.prose ol {
  padding-left: 1.5em;
  margin-bottom: 1em;
}

.prose li {
  margin-bottom: 0.25em;
}

/* Layout - keep existing h1, h2 for backward compatibility */
h1 {
  font-size: 1.8em;
  margin-bottom: 0.5em;
  color: #2c3e50;
}

h2 {
  font-size: 1.4em;
  margin-bottom: 0.5em;
  color: #34495e;
}

p {
  margin-bottom: 1em;
}

/* Links */
a {
  color: #3498db;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  margin: 1em 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

th {
  background: #f8f9fa;
  font-weight: 600;
  color: #495057;
}

tr:hover {
  background: #f8f9fa;
}

/* Forms */
form > div,
.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  margin-bottom: 0.4em;
  font-weight: 500;
  color: #495057;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="date"],
input[type="time"],
select,
textarea {
  width: 100%;
  max-width: 500px;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  min-height: 44px;
  font-family: inherit;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

select.auto-width {
  width: auto;
  max-width: none;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Buttons */
.btn,
input[type="submit"],
button {
  background: #3498db;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  min-height: 44px;
  font-family: inherit;
}

.btn:hover,
input[type="submit"]:hover,
button:hover {
  background: #2980b9;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 14px;
  min-height: auto;
}

.btn-primary {
  background: #3498db;
}

.btn-danger {
  background: #e74c3c;
}

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

.btn-disabled {
  background: #95a5a6;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-disabled:hover {
  background: #95a5a6;
}

/* Flash messages */
p[style*="color: green"] {
  background: #d4edda;
  color: #155724;
  padding: 12px;
  border-radius: 4px;
  border: 1px solid #c3e6cb;
  margin-bottom: 1em;
}

/* Error messages */
div[style*="color: red"] {
  background: #f8d7da;
  color: #721c24;
  padding: 12px;
  border-radius: 4px;
  border: 1px solid #f5c6cb;
  margin-bottom: 1em;
}

/* Navigation */
.main-nav {
  background: #2c3e50;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
}

.nav-brand {
  font-weight: 600;
  font-size: 1.1em;
}

.nav-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  font-size: 14px;
}

.nav-tab {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  padding: 14px 20px;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-tab:hover {
  color: white;
  text-decoration: none;
  border-bottom-color: rgba(255,255,255,0.3);
}

.nav-tab.active {
  color: white;
  border-bottom-color: #3498db;
}

.nav-logout-btn {
  background: transparent;
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 4px;
}

.nav-logout-btn:hover {
  background: rgba(255,255,255,0.1) !important;
}

div > a,
p > a {
  display: inline-block;
  margin-right: 10px;
}

/* Width utilities */
.w-full { width: 100%; }

/* Table container for absolute positioning */
.table-container {
  position: relative;
}

/* Date grouping */
.date-group {
  margin-bottom: 1.5rem;
}

.date-header {
  font-size: 1.1em;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid #3498db;
}

.appointments-list {
  background: white;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  overflow: hidden;
}

.appointment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid #eee;
}

.appointment-row:last-child {
  border-bottom: none;
}

.appointment-row:hover {
  background: #eef2ff;
  cursor: pointer;
}

.appointment-info {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.appointment-time {
  font-weight: 600;
  min-width: 80px;
}

.appointment-client {
  color: #3498db;
}

.appointment-status {
  min-width: 300px;
  text-align: right;
}

/* Actions panel - absolutely positioned over status cell */
.actions-panel {
  position: absolute;
  padding: 0;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  border-radius: 4px;
  z-index: 10;
  width: auto;
  overflow: hidden;
}

.actions-panel > div {
  display: flex;
  gap: 1px;
  align-items: stretch;
  height: 100%;
  background: #ddd;
}

/* All direct children of the flex row must stretch to full height */
.actions-panel > div > * {
  display: flex;
  align-items: stretch;
  height: 100%;
}

/* Forms wrapping button_to must also stretch */
.actions-panel form {
  display: flex;
  align-items: stretch;
  height: 100%;
  margin: 0;
}

/* All buttons inside the panel: equal height, centered content, no individual rounding */
.actions-panel .btn,
.actions-panel .btn-disabled,
.actions-panel .btn-danger,
.actions-panel .btn-close,
.actions-panel button,
.actions-panel a.btn {
  height: 100%;
  min-height: 0;
  border-radius: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Row highlight when actions are open */
.row-highlight {
  background-color: #e8f4f8 !important;
}

/* Status colors */
.status-confirmed {
  color: #27ae60;
  font-weight: 600;
}

.status-reschedule {
  color: #e74c3c;
  font-weight: 600;
}

.status-default {
  color: #95a5a6;
}

/* Landing page */
.landing-root {
  min-height: 100vh;
}
.landing-hero {
  padding: 64px 20px 40px;
  background-color: #2c3e50;
  text-align: center;
}
.landing-hero-title {
  font-size: 2.8em;
  font-weight: 700;
  color: white;
  margin-bottom: 0.1em;
}
.landing-hero-tagline {
  font-size: 1.1em;
  line-height: 1.7;
  color: #94a3b8;
  max-width: 480px;
  margin: 0 auto;
}
.landing-feature-heading {
  font-size: 1.15em;
  font-weight: 600;
  color: #34495e;
  margin-bottom: 0.3em;
}

/* Utility */
.hidden {
  display: none;
}

/* Toggle button */
.btn-toggle {
  background: #ecf0f1;
  color: #2c3e50;
  border: 1px solid #bdc3c7;
  padding: 6px 12px;
  font-size: 14px;
  min-height: auto;
}

.btn-toggle:hover {
  background: #d5dbdb;
}

/* Close button in actions panel */
.btn-close {
  background: #ecf0f1;
  color: #666;
  border: 1px solid #bdc3c7;
  padding: 0 16px;
  font-size: 18px;
  min-height: 44px;
  min-width: 44px;
  line-height: 1;
}

.btn-close:hover {
  background: #d5dbdb;
  color: #333;
}

/* Hamburger nav toggle (hidden on desktop) */
.nav-toggle-btn {
  display: none;
  background: transparent;
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 4px;
  min-height: auto;
  font-size: 20px;
  line-height: 1;
}

.nav-toggle-btn:hover {
  background: rgba(255,255,255,0.1) !important;
}

/* Content container for prose pages */
.content-container {
  max-width: 48rem;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Logout button visibility: desktop vs mobile */
.nav-logout-mobile { display: none; }
.nav-logout-desktop { display: block; }

/* Responsive: smartphone (max-width: 640px) */
@media (max-width: 640px) {
  .page-content {
    padding: 12px;
  }

  .main-nav {
    flex-wrap: wrap;
    padding: 8px 12px 2px;
    gap: 4px;
  }

  .nav-toggle-btn {
    display: block;
  }

  .nav-tabs {
    width: 100%;
    flex-direction: column;
    gap: 0;
    margin-top: 0;
    border-top: none;
    padding-top: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-8px);
    transition: max-height 0.35s ease, opacity 0.3s ease, transform 0.3s ease,
                margin-top 0.3s ease, padding-top 0.3s ease;
  }

  .nav-tabs.open {
    max-height: 500px;
    opacity: 1;
    transform: translateY(0);
    margin-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.15);
    padding-top: 4px;
  }

  .nav-logout-mobile { display: block; margin-bottom: 8px; }
  .nav-logout-desktop { display: none; }

  form.nav-logout-mobile {
    margin: 0;
    width: 100%;
  }

  form.nav-logout-mobile button {
    width: 100%;
    background: transparent;
    color: rgba(255,255,255,0.7);
    border: none;
    border-left: 3px solid transparent;
    border-radius: 0;
    padding: 10px 12px;
    text-align: left;
    font-size: 14px;
    min-height: auto;
    cursor: pointer;
  }

  form.nav-logout-mobile button:hover {
    color: white;
    background: transparent !important;
    border-left-color: rgba(255,255,255,0.3);
  }

  .nav-tab {
    padding: 10px 12px;
    border-bottom: none;
    border-left: 3px solid transparent;
  }

  .nav-tab:hover {
    border-bottom-color: transparent;
    border-left-color: rgba(255,255,255,0.3);
  }

  .nav-tab.active {
    border-bottom-color: transparent;
    border-left-color: #3498db;
  }

  .appointment-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .appointment-info {
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .appointment-status {
    min-width: auto;
    width: 100%;
  }

  .appointment-status > div {
    flex-wrap: wrap;
    gap: 8px;
  }

  .actions-panel {
    position: static !important;
    right: auto !important;
    top: auto !important;
    height: auto !important;
    margin: 0 12px 8px;
  }

  .actions-panel > div {
    flex-wrap: wrap;
  }

  table {
    display: block;
    overflow-x: auto;
  }

  th, td {
    padding: 8px;
  }

  .landing-hero-title {
    font-size: 1.8em;
  }

  .landing-hero {
    padding: 40px 16px 32px;
  }
}
