/* ========================================
   ROCKS CRM - Booking Flow Styles
   Uses variables from style.css when loaded together.
   Falls back to own definitions for standalone use.
   ======================================== */

:root {
  --primary: #111111;
  --accent: #9999CC;
  --bg-light: #f2f2f2;
  --bg-white: #ffffff;
  --text-dark: #4a4a4a;
  --text-light: #888888;
  --border-light: #e0e0e0;
  --border-dark: #cccccc;
  --success: #4CAF50;
  --error: #e53935;
  --disabled: #cccccc;
  --focus: #111111;
  --radius: 16px;
  --radius-sm: 8px;
  --transition: 0.3s ease;
}

/* ========================================
   GLOBAL BOOKING CONTAINER
   ======================================== */

.booking-container {
  background-color: var(--bg-light);
  min-height: 100vh;
  padding: 20px;
  font-family: 'Inter', 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-dark);
}

.booking-wrapper {
  background-color: var(--bg-white);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 600px;
  margin: 0 auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ========================================
   LANGUAGE SWITCHER
   ======================================== */

.booking-lang-switch {
  display: flex;
  gap: 8px;
  float: right;
  margin-bottom: 20px;
}

.lang-btn {
  padding: 6px 12px;
  border: 1px solid var(--border-light);
  background-color: transparent;
  color: var(--text-dark);
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lang-btn:hover {
  border-color: var(--text-dark);
}

.lang-btn.active {
  background-color: var(--focus);
  color: var(--bg-white);
  border-color: var(--focus);
}

/* ========================================
   STEP INDICATOR
   ======================================== */

.booking-steps {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  position: relative;
  padding: 0 10px;
}

.booking-steps::before {
  content: '';
  position: absolute;
  top: 24px;
  left: 20px;
  right: 20px;
  height: 1px;
  background-color: var(--border-light);
  z-index: 1;
}

.booking-step {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.step-num {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 8px;
  transition: all var(--transition);
  background-color: var(--bg-light);
  border: 2px solid var(--border-light);
  color: var(--text-light);
}

.step-label {
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  max-width: 80px;
}

/* Active step */
.booking-step.active .step-num {
  background-color: var(--focus);
  color: var(--bg-white);
  border-color: var(--focus);
}

.booking-step.active .step-label {
  color: var(--primary);
  font-weight: 700;
}

/* Completed step */
.booking-step.completed .step-num {
  background-color: var(--success);
  color: var(--bg-white);
  border-color: var(--success);
}

.booking-step.completed .step-num::after {
  content: '✓';
  position: absolute;
}

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

/* Inactive step */
.booking-step.inactive .step-num {
  background-color: transparent;
  border-color: var(--border-light);
  color: var(--text-light);
}

/* ========================================
   SECTION HEADINGS
   ======================================== */

.booking-section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 24px;
  text-align: center;
}

.booking-subtitle {
  font-size: 14px;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 20px;
}

/* ========================================
   CATEGORY CARDS
   ======================================== */

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.category-card {
  padding: 20px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
  background-color: var(--bg-light);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.category-card:hover {
  border-color: var(--text-dark);
  background-color: #f5f5f5;
}

.category-card.selected {
  border-color: var(--focus);
  background-color: var(--bg-white);
  box-shadow: 0 2px 8px rgba(51, 51, 51, 0.15);
}

.category-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.category-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  word-break: break-word;
}

/* Mobile: 2 columns */
@media (max-width: 600px) {
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========================================
   SERVICE LIST
   ======================================== */

.services-list {
  list-style: none;
  padding: 0;
  margin: 0 0 32px 0;
}

.service-item {
  padding: 16px;
  border-left: 4px solid transparent;
  background-color: var(--bg-light);
  margin-bottom: 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.service-item:hover {
  background-color: #f5f5f5;
}

.service-item.selected {
  border-left-color: var(--focus);
  background-color: var(--bg-white);
  box-shadow: 0 2px 8px rgba(51, 51, 51, 0.1);
}

.service-info {
  flex: 1;
}

.service-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
}

.service-duration {
  font-size: 12px;
  color: var(--text-light);
}

.service-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  min-width: 60px;
  text-align: right;
}

/* ========================================
   MASTER CARDS
   ======================================== */

.masters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.master-card {
  padding: 16px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
  background-color: var(--bg-light);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.master-card:hover {
  border-color: var(--text-dark);
  background-color: #f5f5f5;
}

.master-card.selected {
  border-color: var(--focus);
  background-color: var(--bg-white);
  box-shadow: 0 2px 8px rgba(51, 51, 51, 0.15);
}

.master-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #9999CC 0%, #7a7aaa 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-white);
  font-weight: 700;
  font-size: 24px;
  margin: 0 auto 12px;
}

.master-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.master-specialty {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 8px;
}

.master-rating {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.master-rating::before {
  content: '★ ';
  color: #FFD700;
}

/* Mobile: single column */
@media (max-width: 600px) {
  .masters-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========================================
   CALENDAR
   ======================================== */

.booking-calendar {
  margin-bottom: 32px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.calendar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

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

.calendar-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-light);
  background-color: var(--bg-white);
  color: var(--primary);
  border-radius: 4px;
  cursor: pointer;
  font-size: 18px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-btn:hover {
  border-color: var(--primary);
  background-color: var(--bg-light);
}

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

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.calendar-day-header {
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  color: var(--text-light);
  padding: 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.calendar-day {
  aspect-ratio: 1;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  background-color: var(--bg-white);
  color: var(--text-dark);
}

.calendar-day:hover:not(.disabled):not(.other-month) {
  border-color: var(--text-dark);
  background-color: #f5f5f5;
}

.calendar-day.today {
  border-color: var(--focus);
  font-weight: 700;
}

.calendar-day.selected {
  background-color: var(--focus);
  color: var(--bg-white);
  border-color: var(--focus);
  font-weight: 700;
}

.calendar-day.disabled,
.calendar-day.other-month {
  color: var(--disabled);
  cursor: not-allowed;
  background-color: #fafafa;
}

/* ========================================
   TIME SLOTS
   ======================================== */

.time-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.time-slot {
  padding: 12px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
  background-color: var(--bg-light);
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.time-slot:hover:not(.disabled) {
  border-color: var(--text-dark);
  background-color: #f5f5f5;
}

.time-slot.selected {
  background-color: var(--focus);
  color: var(--bg-white);
  border-color: var(--focus);
}

.time-slot.disabled {
  color: var(--disabled);
  cursor: not-allowed;
  background-color: #fafafa;
  border-color: var(--disabled);
}

/* Mobile: 3 columns */
@media (max-width: 600px) {
  .time-slots {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ========================================
   CONFIRMATION FORM
   ======================================== */

.booking-form {
  margin-bottom: 24px;
}

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

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-input,
.form-select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-family: "Open Sans", Arial, Helvetica, sans-serif;
  font-size: 14px;
  color: var(--text-dark);
  background-color: var(--bg-white);
  transition: all var(--transition);
  box-sizing: border-box;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(51, 51, 51, 0.1);
}

.form-input::placeholder {
  color: var(--text-light);
}

/* ========================================
   BOOKING SUMMARY
   ======================================== */

.booking-summary {
  background-color: var(--bg-light);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
}

.summary-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-dark);
  border-bottom: 1px solid var(--border-light);
}

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

.summary-label {
  font-weight: 500;
}

.summary-value {
  font-weight: 600;
  color: var(--primary);
}

.summary-row.total {
  padding: 12px 0;
  font-size: 16px;
  border-top: 2px solid var(--border-dark);
  margin-top: 8px;
}

.summary-row.total .summary-value {
  font-size: 18px;
  font-weight: 700;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn,
.btn-primary,
.btn-secondary,
.btn-back {
  padding: 14px 24px;
  border: none;
  border-radius: 6px;
  font-family: "Open Sans", Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.3px;
}

.btn-primary {
  background-color: var(--accent);
  color: var(--bg-white);
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.9;
  box-shadow: 0 4px 12px rgba(153, 153, 204, 0.3);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.98);
}

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

.btn-secondary {
  background-color: var(--bg-light);
  color: var(--primary);
  border: 1px solid var(--border-light);
  width: 100%;
}

.btn-secondary:hover {
  border-color: var(--primary);
  background-color: #f5f5f5;
}

.btn-back {
  background-color: transparent;
  color: var(--primary);
  border: 1px solid var(--border-light);
  width: auto;
  padding: 10px 16px;
  font-size: 13px;
}

.btn-back:hover {
  border-color: var(--primary);
  background-color: var(--bg-light);
}

.btn-group {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.btn-group .btn-back {
  flex: 1;
}

.btn-group .btn-primary {
  flex: 1;
}

/* ========================================
   BOOKING HEADER
   ======================================== */

.booking-header {
  text-align: center;
  margin-bottom: 32px;
  overflow: auto;
}

.booking-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.booking-description {
  font-size: 14px;
  color: var(--text-light);
}

/* ========================================
   SUCCESS SCREEN
   ======================================== */

.success-screen {
  text-align: center;
  padding: 40px 20px;
}

.success-checkmark {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 48px;
  color: var(--bg-white);
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
  from {
    transform: scale(0);
  }
  to {
    transform: scale(1);
  }
}

.success-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}

.success-message {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 24px;
}

.booking-code {
  background-color: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
}

.booking-code-label {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.booking-code-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  font-family: monospace;
  letter-spacing: 2px;
}

/* ========================================
   LOADING STATE
   ======================================== */

.booking-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.booking-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--border-light);
  border-top-color: var(--focus);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

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

.booking-loading-text {
  font-size: 14px;
  color: var(--text-light);
}

/* ========================================
   NOTIFICATIONS / TOAST
   ======================================== */

.booking-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--bg-white);
  border-left: 4px solid var(--focus);
  border-radius: 4px;
  padding: 16px 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 14px;
  color: var(--text-dark);
  max-width: 400px;
  animation: slideIn 0.3s ease;
  z-index: 1000;
}

.booking-toast.success {
  border-left-color: var(--success);
}

.booking-toast.error {
  border-left-color: var(--error);
}

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

/* ========================================
   EMPTY STATE
   ======================================== */

.empty-state {
  text-align: center;
  padding: 40px 20px;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.empty-state-message {
  font-size: 14px;
  color: var(--text-light);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablet (945px and below - rocks.uz breakpoint) */
@media (max-width: 945px) {
  .booking-wrapper {
    padding: 30px;
    max-width: 100%;
  }

  .booking-steps {
    padding: 0;
  }

  .booking-steps::before {
    left: 10px;
    right: 10px;
  }

  .step-number {
    width: 44px;
    height: 44px;
    font-size: 16px;
  }

  .step-label {
    font-size: 11px;
    max-width: 70px;
  }
}

/* Small devices (600px and below) */
@media (max-width: 600px) {
  .booking-container {
    padding: 12px;
  }

  .booking-wrapper {
    padding: 20px;
    border-radius: 12px;
  }

  .booking-lang-switch {
    float: none;
    justify-content: center;
    margin-bottom: 16px;
  }

  .booking-title {
    font-size: 22px;
  }

  .booking-section-title {
    font-size: 18px;
  }

  .step-number {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }

  .step-label {
    font-size: 10px;
    max-width: 60px;
  }

  .btn,
  .btn-primary,
  .btn-secondary {
    font-size: 13px;
    padding: 12px 16px;
  }

  .booking-form .form-input,
  .booking-form .form-select {
    font-size: 16px; /* Prevent zoom on iOS */
  }

  .success-screen {
    padding: 30px 16px;
  }

  .success-checkmark {
    width: 70px;
    height: 70px;
    font-size: 40px;
  }

  .success-title {
    font-size: 20px;
  }

  .booking-code-value {
    font-size: 20px;
  }

  .booking-toast {
    bottom: 12px;
    right: 12px;
    left: 12px;
    max-width: none;
  }
}

/* Extra small devices (400px and below) */
@media (max-width: 400px) {
  .booking-wrapper {
    padding: 16px;
  }

  .booking-title {
    font-size: 20px;
  }

  .booking-step {
    gap: 4px;
  }

  .step-number {
    width: 36px;
    height: 36px;
    font-size: 12px;
    margin-bottom: 4px;
  }

  .step-label {
    font-size: 9px;
  }

  .categories-grid,
  .masters-grid,
  .time-slots {
    gap: 12px;
  }

  .master-avatar {
    width: 56px;
    height: 56px;
    font-size: 20px;
  }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }

.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* ========================================
   TIER SELECTION CARDS
   ======================================== */

.tier-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.tier-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border: 2px solid var(--border-light);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--white);
}

.tier-card:hover {
  border-color: var(--accent);
  background: rgba(212, 175, 55, 0.04);
}

.tier-card.selected {
  border-color: var(--accent);
  background: rgba(212, 175, 55, 0.08);
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.15);
}

.tier-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tier-icon {
  font-size: 28px;
  line-height: 1;
}

.tier-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.tier-count {
  font-size: 13px;
  color: var(--text-muted);
}

.tier-price {
  font-weight: 600;
  font-size: 15px;
  color: var(--accent-dark);
  white-space: nowrap;
}

/* ========================================
   MASTER TIER BADGE
   ======================================== */

.master-tier-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-dark);
  background: rgba(212, 175, 55, 0.12);
  padding: 2px 8px;
  border-radius: 6px;
  margin-left: 8px;
  vertical-align: middle;
}

/* ========================================
   TELEGRAM BUTTON & COUNTDOWN
   ======================================== */

.btn-telegram {
  display: block;
  text-align: center;
  background: #0088cc;
  color: #ffffff;
  padding: 14px 24px;
  border-radius: 12px;
  text-decoration: none;
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 15px;
  transition: background 0.2s ease;
}

.btn-telegram:hover {
  background: #006da3;
  color: #ffffff;
  text-decoration: none;
}

.tg-countdown-text {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 16px;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
  .booking-lang-switch,
  .btn-back,
  .calendar-nav {
    display: none;
  }

  .booking-wrapper {
    box-shadow: none;
    border: 1px solid var(--border-light);
  }
}
