/* ============================================
   STYLE.CSS - GraceMe
   Базовые стили (без дубликатов систем)
   ============================================
   Все системные стили перенесены в:
   - button-system.css (кнопки)
   - header.css (header/navigation)
   - footer.css (footer/cookie)
   - card-system.css (карточки/сетки)
   - form-system.css (формы/поля)
   ============================================ */

/* ====== CSS VARIABLES ====== */
:root {
  --primary: #8b5cf6;
  --primary-dark: #7c3aed;
  --primary-light: #a78bfa;
  --primary-rgb: 139, 92, 246;
  --gradient-primary: linear-gradient(135deg, #8b5cf6, #ec4899);
  --gradient-primary-alt: linear-gradient(135deg, #8b5cf6, var(--primary-dark));
  --gradient-sidebar: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --success: #22c55e;
  --success-light: #dcfce7;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --error: #ef4444;
  --error-light: #fee2e2;
  --info: #3b82f6;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.15);
  --radius: 16px;
  --radius-lg: 24px;
  --radius-sm: 8px;
  --radius-full: 9999px;
}

/* ====== GLOBAL BOX-SIZING ====== */
*, *::before, *::after {
  box-sizing: border-box;
}

/* ====== BASE ELEMENTS ====== */
body { 
  font-family: system-ui, -apple-system, sans-serif; 
  background: var(--bg); 
  color: var(--text); 
  line-height: 1.6; 
  transition: background 0.3s;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

html {
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

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

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ====== CONTAINER ====== */
.container { 
  max-width: 1100px; 
  margin: 0 auto; 
  padding: 0 1rem;
  flex: 1;
}

/* Master profile - prevent container shrinking */
.container.master-profile {
  min-width: 900px;
}

@media (max-width: 768px) {
  .container {
    padding: 0 0.875rem;
  }
}

/* ====== NOTIFICATION DROPDOWN ====== */
#notif-dropdown.show { display: block !important; }
#notif-badge.show { display: inline-flex !important; }

/* ====== HERO SECTION ====== */
.hero-section {
  text-align: center;
  padding: 3rem 0 2rem;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, #faf5ff 0%, #f5f0f5 100%);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}

@media (max-width: 768px) {
  .hero-section {
    padding: 2rem 1rem;
    margin-bottom: 1.5rem;
    border-radius: 12px;
  }
}

@media (max-width: 480px) {
  .hero-section {
    padding: 1.5rem 0.75rem;
    border-radius: 10px;
  }
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.05) 0%, transparent 70%);
  animation: heroFloat 20s ease-in-out infinite;
}

@keyframes heroFloat {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20px, -20px); }
}

.hero-title {
  font-size: 2rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: #64748b;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.hero-illustration {
  margin-bottom: 2rem;
}

.hero-illustration svg {
  width: 100%;
  max-width: 600px;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* ====== SECTION TITLE ====== */
.section-title { 
  font-size: 1.5rem; 
  font-weight: 700; 
  color: #1e293b; 
  margin: 2rem 0 1rem; 
  display: flex; 
  align-items: center; 
  gap: 0.5rem; 
}

.section-title::before { 
  content: ''; 
  width: 4px; 
  height: 24px; 
  background: linear-gradient(to bottom, #8b5cf6, var(--primary-dark)); 
  border-radius: 2px; 
}

@media (max-width: 768px) {
  .section-title {
    font-size: 1.3rem;
    margin: 1.5rem 0 0.75rem;
  }
}

@media (max-width: 480px) {
  .section-title {
    font-size: 1.15rem;
  }
}

/* ====== MASTER RATING ====== */
.master-rating {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.35rem 0;
}

.rating-stars {
  color: #fbbf24;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

.rating-value {
  font-weight: 700;
  color: #1e293b;
  font-size: 0.9rem;
}

.rating-count {
  color: #94a3b8;
  font-size: 0.8rem;
}

/* ====== APPOINTMENT ACTIONS ====== */
.appointment-actions { 
  display: flex; 
  gap: 0.5rem; 
  flex-wrap: wrap; 
}

.appt-footer { 
  margin-top: 1rem; 
  display: flex; 
  justify-content: flex-end; 
}

/* ====== TEXT UTILITIES ====== */
.muted { 
  color: #94a3b8; 
  font-size: 0.9rem; 
}

/* ====== PROFILE ====== */
.profile-info { 
  margin-bottom: 1.5rem; 
  padding: 1rem; 
  background: #f8fafc; 
  border-radius: 12px; 
}

/* ====== EMPTY STATE ====== */
.empty-state { 
  text-align: center; 
  padding: 3rem; 
  color: #94a3b8; 
  font-size: 1.1rem; 
}

@media (max-width: 768px) {
  .empty-state {
    padding: 2rem 1rem;
    font-size: 1rem;
  }
}

/* ====== CABINET LAYOUT ====== */
.cabinet-layout { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 1.5rem; 
  align-items: start; 
}

.cabinet-left .card { 
  margin-bottom: 0; 
}

.cabinet-right .card { 
  position: sticky; 
  top: 1rem; 
}

.appointments-table-wrapper { 
  overflow-x: auto; 
  margin: -1.5rem; 
  padding: 0 1.5rem; 
}

.appointments-table { 
  width: 100%; 
  min-width: 500px; 
  border-collapse: collapse; 
  font-size: 0.9rem; 
}

.appointments-table th, 
.appointments-table td { 
  padding: 0.5rem 0.75rem; 
  text-align: left; 
  border-bottom: 1px solid #eee; 
}

.appointments-table th { 
  font-weight: 600; 
  color: #555; 
}

.past-appointment { 
  opacity: 0.5; 
}

@media (max-width: 768px) {
  .cabinet-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .cabinet-right .card {
    position: static;
    margin-bottom: 1rem;
  }
  
  .appointments-table-wrapper {
    margin: -1rem;
    padding: 0 1rem;
    -webkit-overflow-scrolling: touch;
  }
  
  .appointments-table {
    font-size: 0.85rem;
  }
  
  .appointments-table th, 
  .appointments-table td {
    padding: 0.5rem;
  }
}

/* ====== APPOINTMENT ROW ====== */
.appointment-row { 
  padding: 1rem; 
  border: 1px solid #eee; 
  border-radius: 8px; 
  margin-bottom: 0.75rem; 
  background: #fff; 
}

.appointment-date { 
  font-weight: 700; 
  margin-bottom: 0.25rem; 
}

.appointment-service { 
  color: var(--primary); 
  font-weight: 500; 
  margin-bottom: 0.25rem; 
}

.appointment-client { 
  color: #666; 
  font-size: 0.9rem; 
  margin-bottom: 0.25rem; 
}

.appointment-status { 
  font-size: 0.85rem; 
  font-weight: 500; 
  margin-bottom: 0.5rem; 
}

/* ====== STATUS ====== */
.status-confirmed { 
  color: #16a34a; 
  font-weight: 500; 
}

.status-completed { 
  color: #2563eb; 
  font-weight: 500; 
}

.status-cancelled { 
  color: #dc2626; 
  font-weight: 500; 
}

.status-pending { 
  color: #d97706; 
  font-weight: 500; 
}

/* ====== BADGE ====== */
.badge { 
  display: inline-block; 
  padding: 0.25rem 0.6rem; 
  border-radius: 9999px; 
  font-size: 0.75rem; 
  font-weight: 600; 
}

.badge-pending { 
  background: #fefcbf; 
  color: #975a16; 
}

.badge-confirmed { 
  background: #c6f6d5; 
  color: #276749; 
}

.badge-completed { 
  background: #bee3f8; 
  color: #2a4365; 
}

.badge-cancelled { 
  background: #fed7d7; 
  color: #9b2c2c; 
}

.badge-active { 
  background: #c6f6d5; 
  color: #276749; 
}

.badge-inactive { 
  background: #fed7d7; 
  color: #9b2c2c; 
}

/* ====== SEARCH & FILTERS ====== */
.search-section {
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .search-section {
    margin-bottom: 1.5rem;
  }
}

.filters-row {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}

.filters-row .search-input {
  flex: 1;
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .filters-row {
    flex-direction: column;
  }
}

/* ====== CONTACT FORM SECTION ====== */
.contact-form-section {
  padding: 3rem 0;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, #faf5ff 0%, #f5f0f5 100%);
  border-radius: 16px;
}

.contact-form-wrapper {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.1);
}

.contact-form-wrapper h2 {
  text-align: center;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
  font-size: 1.8rem;
}

.contact-subtitle {
  text-align: center;
  color: #718096;
  margin-bottom: 2rem;
  font-size: 1rem;
}

.contact-success {
  background: #f0fff4;
  border: 1px solid #68d391;
  color: #2f855a;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  text-align: center;
  font-weight: 500;
}

.contact-error {
  background: #fff5f5;
  border: 1px solid #fc8181;
  color: #c53030;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  text-align: center;
  font-weight: 500;
}

.btn-submit-contact {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ====== FLOATING CONTACT ICON ====== */
.contact-float-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, var(--primary-dark));
  color: #fff;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
  z-index: 999;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-float-btn:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 6px 30px rgba(139, 92, 246, 0.6);
}

/* ====== STATUS BADGES ====== */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-new {
  background: #dbeafe;
  color: #1e40af;
}

.status-read {
  background: #f3f4f6;
  color: #6b7280;
}

.status-processed {
  background: #d1fae5;
  color: #065f46;
}

.status-spam {
  background: #fee2e2;
  color: #991b1b;
}

/* ====== APPOINTMENTS DISABLED ====== */
.appointments-disabled {
  text-align: center;
  padding: 4rem 0;
}

.appointments-disabled h2 {
  margin-bottom: 0.5rem;
}

.appointments-disabled p {
  color: #718096;
}

/* ====== FILE UPLOAD AREA ====== */
.ba-upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.ba-upload-item label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #1e293b;
}

.file-upload-area {
  border: 2px dashed #e2e8f0;
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  transition: all 0.2s;
  background: #f8fafc;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.file-upload-area:hover {
  border-color: var(--primary);
  background: #faf5ff;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.05);
}

.file-upload-area.has-file {
  border-color: var(--primary);
  background: #faf5ff;
}

.file-upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-upload-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.file-upload-text {
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 600;
  background: rgba(139, 92, 246, 0.1);
  padding: 0.4rem 1.2rem;
  border-radius: 8px;
  margin: 0;
  display: inline-block;
}

/* ====== CABINET PORTFOLIO BEFORE/AFTER ====== */
.ba-pair-thumb {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  position: relative;
}

.ba-pair-thumb img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.ba-pair-thumb img:first-child::after {
  content: 'ДО';
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0,0,0,0.6);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
}

.ba-pair-thumb img:last-child::after {
  content: 'ПОСЛЕ';
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(139, 92, 246, 0.9);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
}

/* ====== CLS FIX: image placeholders ====== */
.client-portfolio-image {
  min-height: 240px;
}

@media (max-width: 768px) {
  .client-portfolio-image {
    min-height: 180px;
  }
}

/* ====== RESPONSIVE OVERRIDES ====== */
@media (max-width: 768px) {
  /* Containers */
  .container,
  .main-content,
  main,
  body {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
  
  /* Cards full width */
  .card,
  .master-card,
  .service-card,
  .appointment-card,
  .profile-card,
  .stat-card {
    width: 100% !important;
    max-width: 100% !important;
    padding: 1rem !important;
    margin-bottom: 1rem !important;
    box-sizing: border-box !important;
  }
  
  /* Inputs full width */
  input,
  select,
  textarea {
    width: 100% !important;
    box-sizing: border-box !important;
    font-size: 16px !important;
  }
  
  /* Headers compact */
  h1 {
    font-size: 1.5rem !important;
    margin-bottom: 1rem !important;
  }
  
  h2 {
    font-size: 1.25rem !important;
  }
  
  h3 {
    font-size: 1.1rem !important;
  }
  
  /* Flex containers column */
  .flex,
  .section-header,
  .filter-actions {
    flex-direction: column !important;
  }
  
  .flex > *,
  .section-header > *,
  .filter-actions > * {
    width: 100% !important;
  }
  
  /* Tables scrollable */
  table,
  .table-wrapper {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Hero */
  .hero-section { 
    padding: 2rem 1rem; 
  }
  
  .hero-buttons { 
    flex-direction: column; 
    align-items: center; 
  }
  
  /* Floating button */
  .contact-float-btn {
    bottom: 1rem;
    right: 1rem;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
  
  /* Modal */
  .modal-content {
    padding: 1.5rem;
    width: 95%;
    max-width: 100%;
  }
  
  /* Contact form */
  .contact-form-wrapper {
    padding: 1.5rem;
  }
  
  .contact-form-wrapper h2 {
    font-size: 1.5rem;
  }
  
  .contact-float-btn {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 55px;
    height: 55px;
    font-size: 1.5rem;
  }
  
  .action-buttons {
    display: flex;
    gap: 0.5rem;
  }
  
  /* Ba upload grid */
  .ba-upload-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .form { 
    max-width: 100%; 
  }

  .appointments-table-wrapper {
    margin: -1rem;
    padding: 0 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 480px) {
  /* Extra compact for small screens */
  body {
    padding: 0.5rem !important;
  }
  
  .container,
  main {
    padding: 0.5rem !important;
  }
  
  .card,
  .master-card {
    padding: 0.875rem !important;
    margin-bottom: 0.75rem !important;
  }
  
  .btn {
    padding: 0.75rem 1rem !important;
    font-size: 0.95rem !important;
    min-height: 48px !important;
  }
  
  .hero-title { 
    font-size: 1.3rem; 
  }
  
  .hero-subtitle { 
    font-size: 0.95rem; 
  }
}
