/* ==========================================================================
   Арт-Караван: Галерея произведений Ирины Коваленко
   Стили оформления веб-сайта для публикации в интернете
   ========================================================================== */

:root {
  --bg-main: #0f1013;
  --bg-card: #181a20;
  --bg-card-hover: #222630;
  --bg-surface: #1e2129;
  --bg-elevated: #282c37;
  
  --text-main: #f0f2f5;
  --text-muted: #9aa0a6;
  --text-dim: #6c737f;

  --gold: #d4a373;
  --gold-hover: #e2b78a;
  --gold-glow: rgba(212, 163, 115, 0.25);
  
  --accent-blue: #58a6ff;
  --accent-green: #3fb950;
  --accent-red: #f85149;

  --border: #2a2e39;
  --border-focus: #d4a373;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.6);
  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* ==========================================================================
   HEADER & NAVBAR
   ========================================================================== */

.site-header {
  background: rgba(18, 20, 25, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 28px;
}

.header-container {
  max-width: 1540px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-logo-img {
  width: 48px;
  height: 48px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px var(--gold-glow));
  transition: transform 0.25s ease;
}

.brand-block:hover .brand-logo-img {
  transform: scale(1.06) rotate(2deg);
}

.brand-title {
  font-family: "Georgia", serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--gold);
  line-height: 1.25;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

.nav-link:hover, .nav-link.active {
  color: var(--gold);
  background: rgba(212, 163, 115, 0.1);
}

.auth-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

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

.btn-primary:hover {
  background: var(--gold-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(212, 163, 115, 0.08);
}

.btn-danger {
  background: rgba(248, 81, 73, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(248, 81, 73, 0.3);
}

.btn-danger:hover {
  background: var(--accent-red);
  color: #fff;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(212, 163, 115, 0.15);
  border: 1px solid rgba(212, 163, 115, 0.4);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
}

/* ==========================================================================
   HERO / BANNER
   ========================================================================== */

.hero-section {
  padding: 40px 28px 24px;
  max-width: 1540px;
  margin: 0 auto;
  width: 100%;
}

.hero-box {
  background: linear-gradient(135deg, rgba(30, 33, 41, 0.8), rgba(20, 22, 28, 0.9)),
              radial-gradient(circle at top right, rgba(212, 163, 115, 0.15), transparent 70%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 42px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.hero-content {
  max-width: 800px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(212, 163, 115, 0.15);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

.hero-title {
  font-family: "Georgia", serif;
  font-size: 34px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 12px;
}

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

.hero-desc {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
}

.hero-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 16px 22px;
  border-radius: var(--radius-md);
  text-align: center;
  min-width: 110px;
}

.stat-number {
  font-size: 26px;
  font-weight: 700;
  color: var(--gold);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   CONTROLS, SEARCH & FILTERS
   ========================================================================== */

.controls-section {
  max-width: 1540px;
  margin: 0 auto 24px;
  padding: 0 28px;
  width: 100%;
}

.controls-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-and-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.search-wrapper {
  flex: 1;
  min-width: 280px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 15px;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.filter-selects {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.custom-select {
  padding: 11px 16px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.custom-select:focus {
  border-color: var(--gold);
}

/* Чипсы серий */
.series-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.chip {
  padding: 7px 16px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.chip:hover {
  color: var(--text-main);
  border-color: var(--gold);
}

.chip.active {
  background: var(--gold);
  color: #121316;
  font-weight: 600;
  border-color: var(--gold);
}

/* Полоса действий (экспорт, счетчик) */
.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.results-info {
  font-size: 14px;
  color: var(--text-muted);
}

.results-info strong {
  color: var(--gold);
}

/* ==========================================================================
   GALLERY GRID
   ========================================================================== */

.gallery-section {
  max-width: 1540px;
  margin: 0 auto;
  padding: 0 28px 60px;
  width: 100%;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 24px;
}

.art-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.art-card:hover {
  transform: translateY(-4px);
  border-color: rgba(212, 163, 115, 0.4);
  box-shadow: var(--shadow-md);
}

.card-img-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #111;
  overflow: hidden;
  cursor: pointer;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.art-card:hover .card-img {
  transform: scale(1.04);
}

.card-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  backdrop-filter: blur(8px);
}

.badge-series {
  background: rgba(24, 26, 32, 0.85);
  color: var(--gold);
  border: 1px solid rgba(212, 163, 115, 0.4);
}

.badge-2k {
  background: rgba(63, 185, 80, 0.2);
  color: #7ee787;
  border: 1px solid rgba(63, 185, 80, 0.4);
  align-self: flex-start;
}

/* Селектор для PDF */
.card-select-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: rgba(24, 26, 32, 0.85);
  border: 1px solid var(--border);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
  z-index: 2;
}

.card-select-btn:hover {
  background: var(--gold);
  color: #121316;
  border-color: var(--gold);
}

.card-select-btn.selected {
  background: var(--gold);
  color: #121316;
  border-color: var(--gold);
}

.card-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

.card-id {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.8px;
}

.card-title {
  font-family: "Georgia", serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
}

.card-meta span strong {
  color: var(--text-main);
}

.card-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.card-price-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-price-value {
  font-size: 14px;
  color: var(--gold);
  font-weight: 700;
}

.btn-edit-card {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  background: rgba(212, 163, 115, 0.12);
  border: 1px solid rgba(212, 163, 115, 0.3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: none; /* скрыта для гостей, показывается редактору */
}

.btn-edit-card:hover {
  background: var(--gold);
  color: #121316;
}

/* ==========================================================================
   MODALS (Lightbox, Edit, Login, PDF)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop.open {
  display: flex;
  animation: fadeIn 0.2s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-window {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  position: relative;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(24, 26, 32, 0.85);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: var(--gold);
  color: #121316;
}

/* Lightbox Modal */
.lightbox-content {
  width: 95vw;
  max-width: 1400px;
  height: 85vh;
  display: flex;
  overflow: hidden;
}

.lightbox-img-pane {
  flex: 1 1 65%;
  background: #08090a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-sm);
}

.lightbox-info-pane {
  flex: 1 1 35%;
  min-width: 340px;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  padding: 36px 30px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lightbox-title {
  font-family: "Georgia", serif;
  font-size: 24px;
  color: var(--text-main);
  line-height: 1.3;
}

.lightbox-meta-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.lightbox-meta-table td {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.lightbox-meta-table td:first-child {
  color: var(--text-muted);
  width: 40%;
}

.lightbox-meta-table td:last-child {
  color: var(--text-main);
  font-weight: 500;
}

/* Edit Form Modal */
.edit-modal-window {
  width: 90vw;
  max-width: 680px;
  padding: 32px 36px;
}

.modal-header-title {
  font-family: "Georgia", serif;
  font-size: 22px;
  color: var(--gold);
  margin-bottom: 20px;
}

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

.form-group-full {
  grid-column: span 2;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--gold);
}

/* Login Modal */
.login-modal-window {
  width: 90vw;
  max-width: 420px;
  padding: 36px 32px;
  text-align: center;
}

.login-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-full);
  background: rgba(212, 163, 115, 0.15);
  color: var(--gold);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.login-title {
  font-family: "Georgia", serif;
  font-size: 22px;
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Toast */
.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 22px;
  background: var(--bg-elevated);
  border: 1px solid var(--gold);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  display: none;
  animation: slideUp 0.3s ease forwards;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   ABOUT PAGE STYLES
   ========================================================================== */

.about-page-container {
  max-width: 1200px;
  margin: 40px auto 80px;
  padding: 0 28px;
}

.about-hero {
  display: flex;
  gap: 48px;
  align-items: flex-start;
  margin-bottom: 50px;
  flex-wrap: wrap;
}

.about-photo-wrapper {
  flex: 0 0 380px;
  position: relative;
}

.about-photo {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.about-photo-frame {
  position: absolute;
  inset: -10px;
  border: 2px solid rgba(212, 163, 115, 0.3);
  border-radius: 20px;
  pointer-events: none;
  z-index: -1;
}

.about-bio-pane {
  flex: 1;
  min-width: 320px;
}

.about-name {
  font-family: "Georgia", serif;
  font-size: 38px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.2;
  margin-bottom: 12px;
}

.about-title {
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 24px;
  font-weight: 500;
}

.about-text {
  font-size: 16px;
  color: var(--text-main);
  line-height: 1.8;
  margin-bottom: 20px;
}

.highlight-box {
  background: rgba(212, 163, 115, 0.08);
  border-left: 4px solid var(--gold);
  padding: 16px 20px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 24px 0;
}

.about-sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
  margin-top: 40px;
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.about-card-title {
  font-family: "Georgia", serif;
  font-size: 20px;
  color: var(--gold);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  padding: 24px 28px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 900px) {
  .hero-box { padding: 24px; }
  .hero-title { font-size: 26px; }
  .lightbox-content { flex-direction: column; height: 90vh; }
  .lightbox-img-pane { height: 50%; }
  .lightbox-info-pane { height: 50%; border-left: none; border-top: 1px solid var(--border); }
  .about-hero { flex-direction: column; align-items: center; text-align: center; }
  .about-photo-wrapper { flex: 0 0 280px; }
}
