/* ================================================
   School #13 им. Аль-Хорезми — Главный стиль
   Выпуск 1975, г. Ургенч
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=Cormorant+Garamond:wght@300;400;600&family=Raleway:wght@300;400;500;700&display=swap');

:root {
  --gold:        #C9A84C;
  --gold-light:  #E8D08A;
  --gold-dark:   #8B6914;
  --deep-blue:   #0D1B3E;
  --navy:        #1A2D5A;
  --navy-light:  #243D75;
  --crimson:     #8B1A1A;
  --cream:       #FDF6E3;
  --ivory:       #F7F0DC;
  --text-dark:   #1C1612;
  --text-mid:    #4A3F35;
  --text-light:  #8A7B6A;
  --border:      #D4B96A;
  --shadow:      rgba(13, 27, 62, 0.25);
  --header-h:    75px;
  --footer-h:    180px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Raleway', sans-serif;
  background: var(--cream);
  color: var(--text-dark);
  overflow-x: hidden;
}

/* ================================================
   SCROLLABLE BODY LAYOUT
   ================================================ */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: linear-gradient(135deg, var(--deep-blue) 0%, var(--navy) 60%, var(--navy-light) 100%);
  border-bottom: 3px solid var(--gold);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 20px;
  box-shadow: 0 4px 30px var(--shadow);
}

.site-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(135deg, var(--deep-blue) 0%, var(--navy) 100%);
  border-top: 3px solid var(--gold);
  z-index: 1000;
  color: var(--cream);
  padding: 14px 30px;
  height: var(--footer-h);
}

.main-content {
  flex: 1;
  margin-top: var(--header-h);
  margin-bottom: var(--footer-h);
  overflow-y: auto;
  padding: 32px 24px;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(201,168,76,0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(13,27,62,0.06) 0%, transparent 60%),
    var(--cream);
}

/* ================================================
   LOGO (CIRCULAR)
   ================================================ */
.logo-wrap {
  flex-shrink: 0;
  width: 76px; height: 76px;
  position: relative;
}

.logo-wrap svg.circular-text {
  width: 76px; height: 76px;
  animation: rotateLogo 20s linear infinite;
}

@keyframes rotateLogo {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.logo-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  line-height: 1;
}

.logo-center .logo-num {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 900;
  color: var(--gold);
  display: block;
}

.logo-center .logo-sub {
  font-size: 7px;
  color: var(--gold-light);
  font-weight: 600;
  letter-spacing: 1px;
}

/* ================================================
   NAVIGATION
   ================================================ */
.site-nav {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a,
.site-nav .dropdown > a {
  color: var(--cream);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 4px;
  transition: all 0.25s;
  white-space: nowrap;
  position: relative;
}

.site-nav a::after {
  content: '';
  position: absolute;
  bottom: 4px; left: 14px; right: 14px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.25s;
  transform-origin: center;
}

.site-nav a:hover::after,
.site-nav a.active::after { transform: scaleX(1); }

.site-nav a:hover,
.site-nav a.active {
  color: var(--gold-light);
  background: rgba(201,168,76,0.12);
}

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--navy);
  border: 1px solid var(--gold);
  border-radius: 6px;
  min-width: 220px;
  box-shadow: 0 12px 40px var(--shadow);
  overflow: hidden;
  z-index: 200;
}
.dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a {
  display: block;
  padding: 10px 18px;
  font-size: 12px;
  letter-spacing: 0.8px;
  border-radius: 0;
  border-bottom: 1px solid rgba(201,168,76,0.15);
}
.dropdown-menu a:last-child { border-bottom: none; }

/* Auth buttons */
.nav-auth {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-nav {
  padding: 7px 18px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s;
  border: none;
}

.btn-gold {
  background: var(--gold);
  color: var(--deep-blue);
}
.btn-gold:hover { background: var(--gold-light); }

.btn-outline-gold {
  border: 2px solid var(--gold);
  color: var(--gold);
  background: transparent;
}
.btn-outline-gold:hover { background: var(--gold); color: var(--deep-blue); }

/* ================================================
   FOOTER
   ================================================ */
.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  height: 100%;
}

.footer-col h4 {
  font-family: 'Playfair Display', serif;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(201,168,76,0.3);
}

.footer-col p, .footer-col a {
  font-size: 12px;
  color: rgba(253,246,227,0.75);
  line-height: 1.7;
  text-decoration: none;
}

.footer-col a:hover { color: var(--gold-light); }

.footer-map-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(201,168,76,0.15);
  border: 1px solid rgba(201,168,76,0.4);
  color: var(--gold-light) !important;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  margin-top: 6px;
  transition: all 0.25s;
}
.footer-map-link:hover { background: rgba(201,168,76,0.3); }

.footer-dev {
  font-size: 11px;
  color: rgba(253,246,227,0.5);
  margin-top: 6px;
}

/* ================================================
   HEADINGS & DECORATIVE
   ================================================ */
.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 42px;
  font-weight: 900;
  color: var(--deep-blue);
  line-height: 1.1;
  position: relative;
  display: inline-block;
  margin-bottom: 8px;
}

.page-title span { color: var(--gold); }

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  color: var(--navy);
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 5px; height: 32px;
  background: var(--gold);
  border-radius: 3px;
}

.divider {
  height: 2px;
  background: linear-gradient(to right, var(--gold), transparent);
  margin: 24px 0;
  border: none;
  border-radius: 2px;
}

/* ================================================
   CARDS
   ================================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.person-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  border: 1px solid rgba(201,168,76,0.2);
  transition: all 0.3s;
  position: relative;
}

.person-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(13,27,62,0.18);
  border-color: var(--gold);
}

.person-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(to right, var(--gold), var(--gold-dark));
}

.card-photo {
  width: 100%; height: 220px;
  object-fit: cover;
  display: block;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
}

.card-photo-placeholder {
  width: 100%; height: 220px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  color: rgba(201,168,76,0.4);
}

.card-body {
  padding: 18px;
}

.card-name {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--deep-blue);
  margin-bottom: 6px;
}

.card-sub {
  font-size: 13px;
  color: var(--gold-dark);
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.card-info {
  font-size: 12.5px;
  color: var(--text-mid);
  line-height: 1.6;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.badge-gold {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: white;
}

.badge-blue {
  background: var(--deep-blue);
  color: var(--gold-light);
}

.badge-green { background: #2d7a3a; color: white; }
.badge-red   { background: var(--crimson); color: white; }

/* ================================================
   TABLES
   ================================================ */
.table-wrap {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  border: 1px solid rgba(201,168,76,0.2);
}

.table-toolbar {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(201,168,76,0.2);
  background: linear-gradient(135deg, var(--deep-blue) 0%, var(--navy) 100%);
  flex-wrap: wrap;
}

.table-toolbar h3 {
  font-family: 'Playfair Display', serif;
  color: var(--gold-light);
  font-size: 18px;
  margin-right: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--gold-light);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 14px 16px;
  text-align: left;
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid rgba(201,168,76,0.12);
  transition: background 0.18s;
}

tbody tr:hover { background: rgba(201,168,76,0.05); }

tbody td {
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--text-dark);
  vertical-align: middle;
}

.td-photo img {
  width: 48px; height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
}

.td-photo .no-photo {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--navy);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  font-size: 22px;
  border: 2px solid var(--gold);
}

.actions { display: flex; gap: 6px; }

/* ================================================
   BUTTONS
   ================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.22s;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.btn-primary   { background: var(--gold); color: var(--deep-blue); }
.btn-primary:hover { background: var(--gold-dark); color: white; }

.btn-secondary { background: var(--navy); color: var(--gold-light); }
.btn-secondary:hover { background: var(--deep-blue); }

.btn-danger    { background: var(--crimson); color: white; }
.btn-danger:hover { background: #6b1414; }

.btn-success   { background: #2d7a3a; color: white; }
.btn-success:hover { background: #1f5a2a; }

.btn-sm { padding: 5px 10px; font-size: 11.5px; }

.btn-print {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
}
.btn-print:hover { background: rgba(255,255,255,0.2); }

/* ================================================
   FORMS
   ================================================ */
.form-card {
  background: white;
  border-radius: 14px;
  padding: 36px;
  box-shadow: 0 8px 40px rgba(13,27,62,0.12);
  border: 1px solid rgba(201,168,76,0.2);
  max-width: 520px;
  margin: 0 auto;
}

.form-card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  color: var(--deep-blue);
  margin-bottom: 4px;
}

.form-card .subtitle {
  color: var(--text-light);
  font-size: 13px;
  margin-bottom: 28px;
}

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

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-mid);
  margin-bottom: 7px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 15px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-family: 'Raleway', sans-serif;
  font-size: 14px;
  color: var(--text-dark);
  transition: border 0.22s, box-shadow 0.22s;
  background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.15);
}

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

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ================================================
   ALERTS / FLASH
   ================================================ */
.alert {
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success { background: #e8f5e9; color: #2e7d32; border-left: 4px solid #4caf50; }
.alert-error   { background: #fce4ec; color: #b71c1c; border-left: 4px solid #ef5350; }
.alert-info    { background: #e3f2fd; color: #0d47a1; border-left: 4px solid #42a5f5; }

/* ================================================
   HOME PAGE HERO
   ================================================ */
.hero {
  text-align: center;
  padding: 60px 20px 40px;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(201,168,76,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.hero-year {
  font-family: 'Playfair Display', serif;
  font-size: 140px;
  font-weight: 900;
  line-height: 0.9;
  color: var(--deep-blue);
  opacity: 0.06;
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  user-select: none;
  letter-spacing: -8px;
}

.hero-emblem {
  width: 90px; height: 90px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--deep-blue), var(--navy-light));
  border: 3px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  box-shadow: 0 0 40px rgba(201,168,76,0.3);
}

.hero-tagline {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  color: var(--text-mid);
  font-style: italic;
  margin: 8px 0 28px;
}

/* ================================================
   MUSIC PLAYER BAR
   ================================================ */
.music-bar {
  position: fixed;
  right: 20px;
  bottom: calc(var(--footer-h) + 16px);
  background: linear-gradient(135deg, var(--deep-blue), var(--navy));
  border: 1px solid var(--gold);
  border-radius: 40px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 30px rgba(13,27,62,0.4);
  z-index: 999;
  transition: all 0.3s;
}

.music-bar.hidden { transform: translateX(120%); }

.music-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: rgba(201,168,76,0.1);
  color: var(--gold);
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.22s;
}

.music-btn:hover { background: var(--gold); color: var(--deep-blue); }

.music-info {
  font-size: 11px;
  color: var(--gold-light);
  max-width: 150px;
}

.music-info .track-name {
  font-weight: 700;
  font-size: 12px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-info .track-artist {
  color: rgba(201,168,76,0.6);
  font-size: 10.5px;
}

/* ================================================
   PRINT STYLES
   ================================================ */
@media print {
  .site-header, .site-footer, .music-bar,
  .table-toolbar .btn, .actions, .nav-auth { display: none !important; }
  .main-content { margin: 0; padding: 0; }
  .table-wrap { box-shadow: none; border: 1px solid #ccc; }
  .person-card { break-inside: avoid; }
}

/* ================================================
   MODAL
   ================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13,27,62,0.75);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-overlay.open { display: flex; }

.modal {
  background: white;
  border-radius: 14px;
  padding: 32px;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  border-top: 4px solid var(--gold);
  box-shadow: 0 20px 60px rgba(13,27,62,0.4);
}

.modal-close {
  position: absolute;
  top: 14px; right: 18px;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-light);
  cursor: pointer;
}

.modal h2 {
  font-family: 'Playfair Display', serif;
  color: var(--deep-blue);
  margin-bottom: 20px;
}

/* ================================================
   VISIT COUNTER
   ================================================ */
.visit-badge {
  background: rgba(201,168,76,0.15);
  border: 1px solid rgba(201,168,76,0.4);
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 11px;
  color: var(--gold-light);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ================================================
   SCROLLBAR
   ================================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 900px) {
  :root { --footer-h: 280px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .site-nav a { font-size: 11px; padding: 6px 8px; }
  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

@media (max-width: 600px) {
  :root { --header-h: 70px; --footer-h: 320px; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero .page-title { font-size: 28px; }
  .form-row { grid-template-columns: 1fr; }
}
