/* CSS Variables */
:root {
  --primary: var(--primary-color, #f5a623);
  /* Note: primary-dark and primary-light are approximately derived 
     For true dynamic colors, these are set via inline styles in the template */
  --primary-dark: var(--primary-color-dark, color-mix(in srgb, var(--primary) 85%, black));
  --primary-light: var(--primary-color-light, color-mix(in srgb, var(--primary) 30%, white));

  --success: #4caf50;
  --success-light: #e8f5e9;

  --text-dark: #333333;
  --text-primary: #444444;
  --text-secondary: #666666;
  --text-muted: #999999;
  --text-light: #bbbbbb;

  --bg-white: #ffffff;
  --bg-light: #f8f9fa;
  --bg-gray: #f0f0f0;

  --border-light: #e8e8e8;
  --border-medium: #dddddd;

  --link-color: #2196f3;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);

  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 4px;
  --radius-xl: 6px;
  --radius-full: 50%;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-white);
}

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

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

ul {
  list-style: none;
}

/* Container */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

/* =========================================
   Header / Breadcrumb
   ========================================= */
.header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-light);
  padding: 12px 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.breadcrumb a {
  color: var(--text-secondary);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb .separator {
  color: var(--text-light);
}

.breadcrumb .current {
  color: var(--text-muted);
}

/* =========================================
   Main Layout
   ========================================= */
.main {
  padding: 24px 0 48px;
}

.profile-layout {
  display: grid;
  grid-template-columns: 200px 1fr 300px;
  gap: 32px;
  margin-bottom: 32px;
}

/* =========================================
   Profile Card (Left Column)
   ========================================= */
.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-photo {
  width: 180px;
  height: 180px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
  background: var(--bg-gray);
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-placeholder {
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  font-size: 64px;
  font-weight: 700;
}

.profile-photo img[style*="display: none"]+.photo-placeholder {
  display: flex;
}

.profile-social {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.social-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  transition: all 0.2s;
}

.social-icon:hover {
  background: var(--bg-gray);
  color: var(--text-dark);
  text-decoration: none;
}

.profile-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-light);
  padding: 6px 12px;
  border-radius: var(--radius-full);
}

.stat svg {
  width: 14px;
  height: 14px;
}

.profile-actions {
  display: flex;
  gap: 8px;
  width: 100%;
}

.btn-icon-only {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-light);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon-only:hover {
  background: var(--bg-gray);
}

/* =========================================
   Profile Info (Center Column)
   ========================================= */
.profile-info {
  padding-top: 4px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Fix anchor overlap */
section.tab-panel {
  scroll-margin-top: 80px;
}

h2,
h3 {
  scroll-margin-top: 80px;
}

.section-block {
  background: white;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid var(--border-light);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.tutor-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
}

.btn-share {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-share:hover {
  background: var(--bg-gray);
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--success-light);
  color: var(--success);
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-full);
}

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

.info-list {
  margin-bottom: 12px;
}

.info-list li {
  position: relative;
  padding-left: 16px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
}

.info-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--text-light);
}

.references-link {
  display: inline-block;
  color: var(--link-color);
  font-size: 14px;
  margin-bottom: 16px;
}

.price-times {
  display: flex;
  gap: 48px;
  padding: 16px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 16px;
}

.price-block,
.times-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.price-block .label,
.times-block .label {
  font-size: 12px;
  color: var(--text-muted);
}

.price-block .value {
  font-size: 14px;
  color: var(--text-secondary);
}

.price-block .value strong {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.times-block .value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
}

.subjects {
  margin-top: 4px;
}

.subjects-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-block;
  padding: 6px 14px;
  background: var(--bg-white);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--text-primary);
  transition: all 0.2s;
}

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

/* =========================================
   Booking Sidebar (Right Column)
   ========================================= */
.booking-sidebar {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  height: fit-content;
}

.sidebar-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.sidebar-actions .btn {
  flex: 1;
  font-size: 13px;
}

.calendar-widget {
  border-top: 1px solid var(--border-light);
  padding-top: 20px;
}

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

.calendar-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-medium);
  border-radius: 24px;
  transition: 0.3s;
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle input:checked+.toggle-slider {
  background-color: var(--link-color);
}

.toggle input:checked+.toggle-slider::before {
  transform: translateX(20px);
}

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

.cal-month {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
}

.cal-nav-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
}

.cal-nav-btn:hover {
  background: var(--bg-light);
}

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

.cal-day-header {
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 8px 0;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: default;
}

.cal-day.other {
  color: var(--text-light);
}

.cal-day.today {
  font-weight: 600;
  color: var(--text-dark);
}

.cal-day.available {
  background: var(--primary-light);
  color: var(--text-dark);
  cursor: pointer;
  font-weight: 500;
}

.cal-day.available:hover {
  background: var(--primary);
  color: white;
}

.cal-day.selected {
  background: var(--primary) !important;
  color: white !important;
}

.calendar-hint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* =========================================
   Buttons
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  border: none;
}

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

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

.btn-outline {
  background: var(--bg-white);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}

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

.btn-link {
  background: none;
  color: var(--link-color);
  padding: 10px;
}

.btn-link:hover {
  text-decoration: underline;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

/* =========================================
   Tabs
   ========================================= */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 24px;
}

.tab {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.tab:hover {
  color: var(--text-dark);
}

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

/* =========================================
   Tab Content
   ========================================= */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.tab-panel h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 16px;
}

.description-text {
  background: var(--bg-light);
  border-radius: var(--radius-md);
  padding: 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
}

.description-text p {
  margin: 0;
}

/* Lesson Types */
.lesson-types {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lesson-type-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.lesson-info h4 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.lesson-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

.lesson-duration {
  font-weight: 400;
  color: var(--text-muted);
}

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

.references-header h3 {
  margin-bottom: 0;
}

.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.review-card {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: var(--bg-light);
  border-radius: var(--radius-md);
}

.review-avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-gray);
  border-radius: var(--radius-full);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}

.review-content {
  flex: 1;
}

.review-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.reviewer-name {
  font-size: 14px;
  color: var(--link-color);
}

.review-type {
  font-size: 12px;
  color: var(--text-muted);
}

.review-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
}

/* =========================================
   Footer
   ========================================= */
.footer {
  background: var(--bg-light);
  border-top: 1px solid var(--border-light);
  padding: 20px 0;
  text-align: center;
}

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

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 992px) {
  .profile-layout {
    grid-template-columns: 180px 1fr;
  }

  .booking-sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  .profile-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .profile-card {
    flex-direction: row;
    gap: 16px;
    align-items: flex-start;
  }

  .profile-photo {
    width: 100px;
    height: 100px;
    margin-bottom: 0;
  }

  .photo-placeholder {
    font-size: 36px;
  }

  .profile-social,
  .profile-stats {
    display: none;
  }

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

  .price-times {
    flex-direction: column;
    gap: 16px;
  }

  .tabs {
    overflow-x: auto;
  }

  .tab {
    white-space: nowrap;
    padding: 12px 16px;
  }
}