/* CSS Variables - Dark Theme */
:root {
  --bg: #0b1020;               /* фон страницы */
  --bg2: #121833;              /* второй фон/карточки */
  --text: #EAF0FF;             /* основной текст */
  --muted: #9fb2ff;            /* вторичный */
  --accent: #7C3AED;           /* фиолетовая */
  --accent2: #6EE7FF;          /* бирюза */
  --ring: rgba(255,255,255,.12);
  --ok: #22C55E;
  --danger: #EF4444;
  --chip: #1b2038;
  --shadow: 0 12px 40px rgba(0,0,0,.35);
  --radius: 16px;
}

/* Light/Pink Theme */
[data-theme="light"] {
  --bg: #FFF5F7;
  --bg2: #FFE8EC;
  --text: #2D1B2E;
  --muted: #8B5A8E;
  --accent: #E91E8C;
  --accent2: #FF6B9D;
  --ring: rgba(233,30,140,.15);
  --ok: #10B981;
  --danger: #EF4444;
  --chip: #FFD4E0;
  --shadow: 0 12px 40px rgba(233,30,140,.15);
}

[data-theme="light"] body {
  background: radial-gradient(circle at 20% 10%, #FFE8EC 0%, #FFF5F7 50%, #FFD4E0 100%) fixed;
}

/* Base Styles */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(80% 100% at 20% 0%, #1a1f3e 0%, #0b1020 60%) fixed;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Layout */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.topbar {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}

/* Brand */
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 800;
}

.brand .dot {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
}

/* Language Dropdown */
.lang-dropdown {
  position: relative;
  display: inline-block;
}

.lang-current {
  border: 1px solid var(--ring);
  background: #0e1430b3;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-current:hover {
  background: #1a2040;
}

.lang-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 5px;
  background: var(--bg2);
  border: 1px solid var(--ring);
  border-radius: 12px;
  box-shadow: var(--shadow);
  min-width: 120px;
  z-index: 1000;
  display: none;
}

.lang-menu.show {
  display: block;
}

.lang-menu a {
  display: block;
  padding: 10px 15px;
  transition: background 0.2s;
}

.lang-menu a:hover {
  background: var(--chip);
}

.lang-menu a.active {
  background: var(--accent);
  color: #fff;
}

/* Chips and Buttons */
.chip {
  border: 1px solid var(--ring);
  background: #0e1430b3;
  padding: 8px 12px;
  border-radius: 999px;
  transition: all 0.3s;
}

.chip.ghost {
  background: transparent;
  border: 1px solid var(--ring);
}

.chip.ghost:hover {
  background: #0e1430b3;
  border-color: #3b82f6;
}

.cta {
  background: linear-gradient(90deg, #8b5cf6, #06b6d4);
  color: #fff;
  border: 1px solid rgba(139, 92, 246, 0.5);
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: all 0.3s;
}

.cta:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  border-color: rgba(139, 92, 246, 0.8);
}

.btn {
  background: #0e1430;
  border: 1px solid var(--ring);
  border-radius: 999px;
  padding: 10px 14px;
  text-decoration: none;
  transition: all 0.3s;
}

.btn:hover {
  border-color: var(--accent2);
  background: rgba(139,92,246,0.1);
}

.login-btn {
  background: linear-gradient(90deg, #22c55e, #16a34a);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}

.login-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Cards */
.card {
  background: linear-gradient(180deg, #12183a 0%, #0e1430 100%);
  border: 1px solid var(--ring);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card.pad {
  padding: 16px;
}

/* Hero Badges */
.hb {
  background: rgba(255,255,255,0.05);
  border: 1px solid transparent;
  background-image: linear-gradient(rgba(255,255,255,0.05), rgba(255,255,255,0.05)), linear-gradient(45deg, rgba(139,92,246,0.4), rgba(110,231,255,0.4), rgba(139,92,246,0.4));
  background-origin: border-box;
  background-clip: padding-box, border-box;
  background-size: 100% 100%, 200% 200%;
  border-radius: 16px;
  padding: 16px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: all 0.4s ease;
  animation: gradientShift 3s ease-in-out infinite;
}

.hb:hover {
  background-image: linear-gradient(rgba(255,255,255,0.08), rgba(255,255,255,0.08)), linear-gradient(45deg, rgba(139,92,246,0.8), rgba(110,231,255,0.8), rgba(139,92,246,0.8));
  box-shadow: 0 8px 40px -12px rgba(99,102,241,.6), 0 0 20px rgba(139,92,246,0.3);
  transform: translateY(-2px);
}

.hb b {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
  color: #cbd5ff;
  font-weight: 600;
}

.hb span {
  color: rgba(159,178,255,0.9);
  font-size: 14px;
}

/* Slots */
.slot {
  background: rgba(255,255,255,0.05);
  border: 1px solid transparent;
  background-image: linear-gradient(rgba(255,255,255,0.05), rgba(255,255,255,0.05)), linear-gradient(135deg, rgba(139,92,246,0.3), rgba(110,231,255,0.3));
  background-origin: border-box;
  background-clip: padding-box, border-box;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  height: 100%;
  cursor: pointer;
  transition: all 0.4s ease;
  text-align: center;
  backdrop-filter: blur(10px);
}

.slot:hover {
  background-image: linear-gradient(rgba(255,255,255,0.08), rgba(255,255,255,0.08)), linear-gradient(135deg, rgba(139,92,246,0.6), rgba(110,231,255,0.6));
  box-shadow: 0 8px 40px -12px rgba(99,102,241,.6);
  transform: scale(1.02);
}

.slot .badge {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(34,197,94,.15);
}

.slot.busy {
  cursor: not-allowed;
}

.slot.busy .badge {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(239,68,68,.10);
}

.slot small {
  color: #b7c4ff;
}

/* Slot element classes */
.slot-staff-name {
  color: rgba(159,178,255,0.9);
}

.slot-location {
  color: rgba(159,178,255,0.7);
}

.slot-price {
  color: #6EE7FF;
  font-weight: 600;
}

/* Filter Buttons */
.filter-btn {
  border: 1px solid var(--ring);
  background: #0d1330;
  border-radius: 999px;
  padding: 6px 12px;
  color: #cbd5ff;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
}

.filter-btn:hover {
  border-color: var(--accent2);
  background: rgba(139,92,246,0.1);
}

.filter-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* District Tabs */
.district-tab {
  border: 1px solid var(--ring);
  background: #0d1330;
  border-radius: 999px;
  padding: 8px 16px;
  color: #cbd5ff;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
}

.district-tab:hover {
  border-color: #3b82f6;
  background: #111a40;
}

.district-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Masters */
.master {
  min-width: 220px;
  background: linear-gradient(180deg, #151a40, #0e1430);
  border: 1px solid var(--ring);
  border-radius: 16px;
  padding: 12px;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.master:hover {
  transform: scale(1.05);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3), 0 0 30px rgba(139,92,246,0.4);
  border-color: rgba(139,92,246,0.6);
}

.master:hover::before {
  opacity: 1;
}

.master::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(139,92,246,0.1), rgba(110,231,255,0.1));
  border-radius: 16px;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 1;
}

.master .ph {
  height: 160px;
  border-radius: 12px;
  background: linear-gradient(135deg, #334155, #0f172a);
  position: relative;
  overflow: hidden;
}

.master:hover .ph::after {
  opacity: 1;
}

.master .ph::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(139,92,246,0.3), rgba(110,231,255,0.3));
  opacity: 0;
  transition: opacity 0.4s ease;
  border-radius: 12px;
}

.master h4 {
  margin: 10px 0 6px;
  position: relative;
  z-index: 2;
}

.master .book-btn {
  margin-top: 8px;
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  z-index: 2;
}

.master .book-btn:hover {
  background: #6d28d9;
  transform: translateY(-1px);
}

.master > div:not(.ph) {
  position: relative;
  z-index: 2;
}

/* Navigation Buttons */
.navbtn {
  border: 1px solid var(--ring);
  background: #0d1330;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.3s;
}

.navbtn:hover {
  background: #111a40;
  border-color: #3b82f6;
}

.navbtn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* Reviews */
.review {
  background: linear-gradient(180deg, #151a40, #0e1430);
  border: 1px solid var(--ring);
  border-radius: 16px;
  padding: 16px;
  transition: all 0.3s;
}

.review:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.review-text {
  color: #cbd5ff;
  font-style: italic;
  margin-bottom: 10px;
  line-height: 1.5;
}

.review-author {
  color: var(--accent2);
  font-weight: 600;
  font-size: 14px;
}

/* Service Cards */
.service-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  border: 1px solid var(--ring);
  border-radius: 20px;
  padding: 24px 20px;
  text-align: center;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(139,92,246,0.1), rgba(110,231,255,0.1));
  opacity: 0;
  transition: opacity 0.4s ease;
  border-radius: 20px;
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px -12px rgba(139,92,246,0.25);
  border-color: rgba(139,92,246,0.4);
}

.service-card:hover::before {
  opacity: 1;
}

.service-icon {
  font-size: 48px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.service-card h3 {
  margin: 0 0 8px;
  color: var(--accent2);
  font-size: 20px;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.service-card p {
  margin: 0 0 16px;
  color: rgba(159,178,255,0.8);
  font-size: 14px;
  line-height: 1.4;
  position: relative;
  z-index: 1;
}

.service-price {
  margin: 0 0 20px;
  color: #cbd5ff;
  font-size: 14px;
  position: relative;
  z-index: 1;
}

.service-price span {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--accent2);
  margin-top: 4px;
  text-shadow: 0 0 20px rgba(110,231,255,0.3);
}

.service-btn {
  display: inline-block;
  padding: 12px 24px;
  background: linear-gradient(90deg, #8b5cf6, #06b6d4);
  color: #fff;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
  border: 0;
}

.service-btn:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
  box-shadow: 0 8px 25px -8px rgba(139,92,246,0.4);
}

/* Location Blocks */
.b {
  padding: 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--ring);
  border-radius: 16px;
  height: 100%;
  transition: all 0.3s;
  text-align: center;
}

.b:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(139,92,246,0.4);
  box-shadow: 0 6px 30px -12px rgba(99,102,241,.45);
}

.b h5 {
  margin: 0 0 12px;
  font-size: 18px;
  color: #cbd5ff;
}

.b p {
  margin: 0;
  color: rgba(159,178,255,0.9);
  line-height: 1.5;
}

.location-item {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ring);
}

.location-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.location-name {
  color: var(--accent2);
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
}

.location-details {
  color: #cbd5ff;
  font-size: 14px;
  line-height: 1.6;
}

/* Promo Banner */
.promo {
  margin: 44px 0;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--ring);
  background: linear-gradient(45deg, #0ea5e9, #8b5cf6, #06b6d4, #8b5cf6);
  background-size: 400% 400%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  animation: promoGradient 4s ease-in-out infinite;
}

.promo small {
  opacity: .95;
}

.promo .cta {
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.3);
  animation: ctaPulse 2s ease-in-out infinite;
}

.promo .cta:hover {
  background: rgba(255,255,255,0.3);
  animation-play-state: paused;
  transform: scale(1.05);
}

/* Floating Action Buttons */
.fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 99;
}

.fab a {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 12px 14px;
  background: #0d1330;
  border: 1px solid var(--ring);
  text-decoration: none;
  color: #eaf0ff;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}

.fab a:hover {
  background: #111a40;
  transform: translateY(-2px);
}

.fab a.wh {
  border-color: #22c55e4d;
}

.fab a.tg {
  border-color: #60a5fa4d;
}

.fab svg {
  width: 18px;
  height: 18px;
}

/* Address Links */
.addr {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.addr a {
  border: 1px solid var(--ring);
  background: #0d1330;
  border-radius: 999px;
  padding: 8px 12px;
  color: #cbd5ff;
  text-decoration: none;
  transition: all 0.3s;
}

.addr a:hover {
  border-color: #7dd3fc;
  background: #111a40;
}

/* Counters */
#worksCounter {
  background: linear-gradient(135deg, #8b5cf6, #06b6d4, #10b981);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
  font-size: 16px;
}

/* LIGHT THEME OVERRIDES */
[data-theme="light"] .card {
  background: linear-gradient(180deg, #FFE8EC 0%, #FFF5F7 100%);
}

[data-theme="light"] .master {
  background: linear-gradient(180deg, #FFE8EC, #FFF5F7);
}

[data-theme="light"] .master .ph {
  background: linear-gradient(135deg, #FFD4E0, #FFE8EC);
}

[data-theme="light"] .hb {
  background-image: linear-gradient(rgba(233,30,140,0.08), rgba(233,30,140,0.08)),
                    linear-gradient(45deg, rgba(233,30,140,0.3), rgba(255,107,157,0.3));
}

[data-theme="light"] .chip,
[data-theme="light"] .filter-btn,
[data-theme="light"] .district-tab {
  background: rgba(255, 212, 224, 0.6);
  color: #2D1B2E;
}

[data-theme="light"] .filter-btn.active,
[data-theme="light"] .district-tab.active {
  background: #E91E8C;
  color: #000;
}

[data-theme="light"] .btn {
  background: #FFE8EC;
  color: #2D1B2E;
  border-color: rgba(233,30,140,0.3);
}

[data-theme="light"] .navbtn {
  background: #FFE8EC;
  color: #2D1B2E;
  border-color: rgba(233,30,140,0.3);
}

[data-theme="light"] .review,
[data-theme="light"] .service-card,
[data-theme="light"] .b {
  background: linear-gradient(145deg, rgba(255,232,236,0.8), rgba(255,245,247,0.5));
  color: #2D1B2E;
}

[data-theme="light"] .service-card p {
  color: #8B5A8E;
}

[data-theme="light"] .slot {
  background-image: linear-gradient(rgba(233,30,140,0.05), rgba(233,30,140,0.05)),
                    linear-gradient(135deg, rgba(233,30,140,0.2), rgba(255,107,157,0.2));
}

[data-theme="light"] .slot * {
  color: #2D1B2E;
}

[data-theme="light"] .slot-staff-name {
  color: rgba(45, 27, 46, 0.7);
}

[data-theme="light"] .slot-location {
  color: rgba(45, 27, 46, 0.6);
}

[data-theme="light"] .slot-price {
  color: rgba(45, 27, 46, 0.8);
}

[data-theme="light"] .lang-menu {
  background: #FFE8EC;
}

[data-theme="light"] .hero p,
[data-theme="light"] .hb b,
[data-theme="light"] .hb span {
  color: #5D3A5E;
}

[data-theme="light"] h3,
[data-theme="light"] .location-name {
  color: #8B5A8E;
}

[data-theme="light"] .b h5 {
  color: #2D1B2E;
}

[data-theme="light"] .b p,
[data-theme="light"] .location-item,
[data-theme="light"] .location-details {
  color: #5D3A5E;
}

[data-theme="light"] .location-name {
  color: #E91E8C;
  font-weight: 700;
}

[data-theme="light"] .review-text {
  color: #5D3A5E;
}

[data-theme="light"] .review-author {
  color: #E91E8C;
}

[data-theme="light"] .service-price {
  color: #5D3A5E;
}

[data-theme="light"] .fab a {
  background: #FFE8EC;
  border-color: rgba(233,30,140,0.3);
  color: #2D1B2E;
}

[data-theme="light"] .fab a:hover {
  background: #FFD4E0;
  border-color: rgba(233,30,140,0.5);
}

[data-theme="light"] .chip:hover,
[data-theme="light"] .chip.ghost:hover {
  background: rgba(233,30,140,0.15);
  border-color: #E91E8C;
}

[data-theme="light"] .lang-current:hover {
  background: rgba(255, 212, 224, 0.9);
}

[data-theme="light"] .lang-menu a:hover {
  background: rgba(233,30,140,0.1);
}

[data-theme="light"] .lang-current {
  background: #E91E8C;
  color: #000;
  border-color: #E91E8C;
}

[data-theme="light"] .lang-menu a.active {
  background: #E91E8C;
  color: #000;
}

/* Animations */
@keyframes gradientShift {
  0%, 100% { background-position: 100% 100%, 0% 50%; }
  50% { background-position: 100% 100%, 100% 50%; }
}

@keyframes promoGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(255,255,255,0); }
}

/* Header Elements - Strict sizing to ensure consistency across all pages */
.topbar {
  font-size: 14px !important;
}

.topbar nav {
  font-size: 14px !important;
}

.chip {
  padding: 8px 12px !important;
  font-size: 14px !important;
  border-radius: 999px !important;
}

.lang-current {
  padding: 8px 12px !important;
  font-size: 14px !important;
}

.lang-current span {
  font-size: 14px !important;
}

.cta {
  padding: 10px 16px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}

.login-btn {
  padding: 10px 16px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
}

.user-btn {
  padding: 8px 14px !important;
  font-size: 14px !important;
}

.user-btn span {
  font-size: 14px !important;
}

.user-dropdown a {
  font-size: 14px !important;
  padding: 12px 16px !important;
}

.lang-menu a {
  font-size: 14px !important;
  padding: 10px 15px !important;
}

/* Mobile Responsive */
@media (min-width: 768px) {
  .hero-bottom-grid { grid-template-columns: 1.3fr 1fr !important; }
}

@media (max-width: 980px) {
  .topbar { flex-direction: column !important; gap: 10px !important; }
  .topbar nav { width: 100% !important; justify-content: center !important; flex-wrap: wrap !important; }
  .wrap { padding: 4px 10px 10px !important; }
  .brand img { height: 60px !important; }
  .topbar { gap: 6px !important; padding: 2px 0 !important; }
}

@media (max-width: 640px) {
  .topbar nav { flex-wrap: wrap !important; gap: 6px !important; }
  .chip { padding: 6px 10px !important; font-size: 13px !important; }
  .cta { padding: 8px 14px !important; font-size: 13px !important; }
  .login-btn { padding: 8px 14px !important; font-size: 13px !important; }
}

/* District Dropdown Styles */
.district-dropdown {
  transition: all 0.3s ease;
}

.district-dropdown:hover {
  background: rgba(233,30,140,0.15);
  border-color: rgba(233,30,140,0.5);
}

.district-dropdown:focus {
  outline: none;
  border-color: #E91E8C;
  box-shadow: 0 0 0 3px rgba(233,30,140,0.2);
}

.district-dropdown option {
  background: var(--bg2);
  color: var(--text);
  padding: 8px;
}

/* Light Theme Dropdown Styles */
[data-theme="light"] .district-dropdown {
  background: rgba(233,30,140,0.08);
  border-color: rgba(233,30,140,0.3);
  color: #2D1B2E;
}

[data-theme="light"] .district-dropdown:hover {
  background: rgba(233,30,140,0.12);
  border-color: rgba(233,30,140,0.5);
}

[data-theme="light"] .district-dropdown:focus {
  outline: none;
  border-color: #E91E8C;
  box-shadow: 0 0 0 3px rgba(233,30,140,0.1);
}

[data-theme="light"] .district-dropdown option {
  background: #FFF5F7;
  color: #2D1B2E;
}