/* FiaDent Dental Laboratory - Stylesheet */
:root {
  --primary: #0080ff;
  --primary-hover: #0066cc;
  --primary-light: #e6f2ff;
  --primary-glow: rgba(0, 128, 255, 0.25);
  
  --bg-gradient: linear-gradient(135deg, #d7faf8 0%, #d1e6ff 50%, #e8fbf0 100%);
  --card-bg: rgba(255, 255, 255, 0.96);
  --card-border: rgba(255, 255, 255, 0.9);
  
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  
  --contact-bg: linear-gradient(135deg, #f0f7ff 0%, #e8f5ff 100%);
  --badge-bg: linear-gradient(90deg, #e6fbf5 0%, #e6f2ff 100%);
  --badge-text: #0080ff;
  --badge-border: #0080ff;
  
  --border-color: #e2e8f0;
  --input-bg: #f8fafc;
  --input-border: #cbd5e1;
  
  --telegram: #229ed9;
  --telegram-hover: #1c87ba;
  --viber: #7360f2;
  --viber-hover: #5e4bd6;
  
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 30px rgba(0, 128, 255, 0.12);
  --shadow-lg: 0 20px 45px rgba(0, 0, 0, 0.16);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --primary: #38bdf8;
  --primary-hover: #0ea5e9;
  --primary-light: #0f2744;
  --primary-glow: rgba(56, 189, 248, 0.3);
  
  --bg-gradient: linear-gradient(135deg, #0b1120 0%, #0f172a 50%, #030712 100%);
  --card-bg: rgba(30, 41, 59, 0.95);
  --card-border: #334155;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  
  --contact-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --badge-bg: linear-gradient(90deg, #0f766e 0%, #0284c7 100%);
  --badge-text: #ffffff;
  --badge-border: #38bdf8;
  
  --border-color: #334155;
  --input-bg: #0f172a;
  --input-border: #475569;
  
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 45px rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Container */
.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 16px 80px 16px;
  flex: 1;
}

/* Header & Brand */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px 20px 4px;
  position: relative;
}

.brand-wrapper {
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.brand-logo {
  font-size: 2.8rem;
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.5px;
  line-height: 1.1;
  display: flex;
  align-items: center;
  gap: 4px;
}

.brand-logo .logo-fia {
  color: var(--text-primary);
}

.brand-logo .logo-dent {
  color: var(--primary);
}

.brand-logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  margin-right: 6px;
  filter: drop-shadow(0 2px 6px rgba(0, 128, 255, 0.2));
}

.brand-subtitle {
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-top: 4px;
}

.theme-toggle-btn {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  outline: none;
}

.theme-toggle-btn:hover {
  transform: scale(1.06);
  border-color: var(--primary);
}

/* Main Card Container */
.main-card {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition);
}

.grid-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: start;
}

@media (min-width: 860px) {
  .grid-layout {
    grid-template-columns: 1.05fr 1px 0.95fr;
    gap: 24px;
  }
}

.divider {
  display: none;
  background: repeating-linear-gradient(
    to bottom,
    var(--primary) 0,
    var(--primary) 6px,
    transparent 6px,
    transparent 12px
  );
  width: 2px;
  height: 100%;
  opacity: 0.4;
}

@media (min-width: 860px) {
  .divider {
    display: block;
  }
}

.divider-horizontal {
  display: block;
  background: repeating-linear-gradient(
    to right,
    var(--primary) 0,
    var(--primary) 6px,
    transparent 6px,
    transparent 12px
  );
  height: 2px;
  width: 100%;
  opacity: 0.35;
  margin: 12px 0;
}

@media (min-width: 860px) {
  .divider-horizontal {
    display: none;
  }
}

/* Profile Column */
.profile-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.avatar-wrapper {
  position: relative;
  width: 104px;
  height: 104px;
  flex-shrink: 0;
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--primary);
  box-shadow: var(--shadow-sm);
  background: var(--primary-light);
}

.avatar-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 32px;
  height: 32px;
  background: var(--card-bg);
  border: 2px solid var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.avatar-badge img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.profile-meta h1 {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.badge-tag {
  display: inline-block;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--badge-text);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.profile-bio {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 12px;
}

.profile-bio strong {
  color: var(--text-primary);
  font-weight: 700;
}

.features-list {
  list-style: none;
  margin-bottom: 20px;
}

.features-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.45;
  margin-bottom: 8px;
}

.features-list li span.icon {
  font-size: 1.1rem;
  line-height: 1;
}

/* Contact Box */
.contact-box {
  background: var(--contact-bg);
  border: 2px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border-color);
}

.contact-item {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

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

.contact-lbl {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 2px;
}

.contact-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  word-break: break-all;
}

/* Action Buttons */
.btn-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.btn-group.full {
  grid-template-columns: 1fr auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  outline: none;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 14px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-telegram {
  background: var(--telegram);
  color: #ffffff;
}

.btn-telegram:hover {
  background: var(--telegram-hover);
  box-shadow: 0 4px 14px rgba(34, 158, 217, 0.3);
  transform: translateY(-1px);
}

.btn-viber {
  background: var(--viber);
  color: #ffffff;
}

.btn-viber:hover {
  background: var(--viber-hover);
  box-shadow: 0 4px 14px rgba(115, 96, 242, 0.3);
  transform: translateY(-1px);
}

.btn-dark {
  background: var(--text-primary);
  color: var(--card-bg);
}

[data-theme="dark"] .btn-dark {
  background: #334155;
  color: #ffffff;
}

.btn-dark:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--primary);
  padding: 10px;
}

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

/* Pricelist Column */
.pricelist-wrapper {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--primary);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  background: #ffffff;
  transition: var(--transition);
}

.pricelist-wrapper:hover {
  transform: scale(1.01);
  box-shadow: var(--shadow-md);
}

.pricelist-badge {
  position: absolute;
  top: 0;
  left: 0;
  background: rgba(0, 128, 255, 0.95);
  color: #ffffff;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  border-bottom-right-radius: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(4px);
  z-index: 2;
}

.pricelist-img {
  width: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.pricelist-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.pricelist-actions .btn {
  flex: 1;
}

/* Floating Action Button */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-full);
  padding: 14px 22px;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 25px var(--primary-glow);
  cursor: pointer;
  z-index: 90;
  transition: var(--transition);
}

.fab:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px var(--primary-glow);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--card-bg);
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 24px;
  position: relative;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.modal-title h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.modal-title p {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  border-radius: 50%;
  transition: var(--transition);
}

.btn-close:hover {
  color: var(--primary);
  transform: rotate(90deg);
}

/* Service Category Chips */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

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

.chip {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

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

.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* Form Inputs */
.form-input, .form-textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-textarea {
  resize: vertical;
  min-height: 70px;
}

/* Message Preview Box */
.preview-box {
  background: var(--input-bg);
  border: 1px dashed var(--primary);
  border-radius: 10px;
  padding: 12px;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text-secondary);
  white-space: pre-wrap;
  margin-bottom: 18px;
}

/* Image Zoom Lightbox */
.lightbox-card {
  max-width: 95vw;
  max-height: 94vh;
  width: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.lightbox-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}

.zoom-buttons {
  display: flex;
  gap: 8px;
}

.lightbox-viewport {
  overflow: auto;
  max-height: calc(90vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #000000;
  user-select: none;
}

.lightbox-img {
  max-width: 100%;
  height: auto;
  display: block;
  transition: transform 0.2s ease-out;
  cursor: grab;
}

.lightbox-img:active {
  cursor: grabbing;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1e293b;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 2000;
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Footer */
.footer {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin-top: auto;
}

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