
/* ===== VSHPI Neon Glass Design System ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Space+Grotesk:wght@600;700&display=swap');

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

:root {
  --bg:            #131313;
  --surface:       #1f1f1f;
  --surface-low:   #1b1b1b;
  --surface-high:  #2a2a2a;
  --surface-lowest:#0e0e0e;
  --on-surface:    #e2e2e2;
  --on-muted:      #b9cacb;
  --outline:       #849495;
  --outline-var:   #3a494b;
  --cyan:          #00dbe7;
  --cyan-dim:      #00dbe7;
  --cyan-bright:   #74f5ff;
  --purple:        #b600f8;
  --purple-dim:    #ebb2ff;
  --error:         #ffb4ab;
  --error-bg:      #93000a;
  --success:       #22c55e;
  --radius-sm:     0.25rem;
  --radius:        0.5rem;
  --radius-md:     0.75rem;
  --radius-lg:     1rem;
  --radius-full:   9999px;
}

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--on-surface);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* На странице визитки body не скроллится — iframe занимает всё место */
body.page-card-view {
  height: 100vh;
  overflow: hidden;
}
body.page-card-view .site-footer { display: none; }
body.page-card-view .main-content-fullscreen {
  height: calc(100vh - 64px);
  flex: none;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--cyan); border-radius: 10px; }

/* ── Typography ── */
h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: monospace; background: rgba(255,255,255,.06); padding: .1em .4em; border-radius: var(--radius-sm); font-size: .9em; }

/* ── Glass panel ── */
.glass {
  background: rgba(31,31,31,.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.1);
}

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.main-content { flex: 1; padding: 2rem 24px; overflow-y: auto; }
.main-content-fullscreen {
  flex: 1;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ── Site Header ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(19,19,19,.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 0 15px rgba(0,219,231,.05);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem; font-weight: 700;
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(0,219,231,.6);
  text-decoration: none;
}
.logo:hover { text-decoration: none; }
.nav { display: flex; align-items: center; gap: .5rem; }
.nav-user { font-size: .8rem; color: var(--on-muted); padding: 0 .5rem; }
.nav-link {
  font-size: .8rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--on-muted); padding: .4rem .75rem; border-radius: var(--radius);
  transition: color .15s, background .15s; text-decoration: none;
}
.nav-link:hover { color: var(--on-surface); background: rgba(255,255,255,.05); text-decoration: none; }
.nav-cta { background: linear-gradient(135deg, var(--purple), var(--cyan)); color: #000 !important; font-weight: 700; }
.nav-cta:hover { box-shadow: 0 0 20px rgba(0,219,231,.4); }
.nav-admin { color: #ffbf00 !important; }

/* ── Footer ── */
.site-footer {
  border-top: 1px solid rgba(255,255,255,.05);
  background: var(--surface-lowest);
  padding: 1.5rem 0 1rem;
}
.footer-inner {
  display: flex; align-items: flex-start; gap: 2rem;
  flex-wrap: wrap; margin-bottom: 1rem;
}
.footer-brand { flex: 1; min-width: 200px; }
.footer-logo {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: .95rem; color: var(--cyan);
}
.footer-desc { font-size: .8rem; color: var(--on-muted); margin-top: .3rem; }
.footer-links-block { display: flex; flex-direction: column; gap: .3rem; }
.footer-link { font-size: .85rem; color: var(--on-muted); text-decoration: none; }
.footer-link:hover { color: var(--cyan); }
.footer-contacts { display: flex; flex-direction: column; gap: .3rem; }
.footer-contacts-label { font-size: .75rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--on-muted); }
.footer-dev { font-size: .85rem; color: var(--on-surface); display: flex; align-items: center; gap: .4rem; }
.footer-dev a { color: var(--on-muted); text-decoration: none; font-size: 1rem; }
.footer-dev a:hover { color: var(--cyan); }
.footer-copy { font-size: .75rem; color: var(--on-muted); text-align: center;
  padding-top: .75rem; border-top: 1px solid rgba(255,255,255,.05); }

/* ── Flash messages ── */
.flash-messages { margin-bottom: 1.5rem; }
.alert {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .9rem 1.1rem; border-radius: var(--radius-md);
  margin-bottom: .75rem; font-size: .9rem;
  border: 1px solid transparent;
  backdrop-filter: blur(10px);
}
.alert-success { background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.3); color: #86efac; }
.alert-danger  { background: rgba(255,180,171,.08); border-color: rgba(255,180,171,.3); color: var(--error); }
.alert-warning { background: rgba(255,191,0,.08); border-color: rgba(255,191,0,.3); color: #fde68a; }
.alert-info    { background: rgba(0,219,231,.08); border-color: rgba(0,219,231,.3); color: var(--cyan); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .6rem 1.25rem; border-radius: var(--radius);
  font-size: .8rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  cursor: pointer; border: 1px solid transparent;
  transition: all .2s; text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  color: #000;
}
.btn-primary:hover { box-shadow: 0 0 20px rgba(0,219,231,.4); }

.btn-success  { background: rgba(34,197,94,.15); color: #86efac; border-color: rgba(34,197,94,.4); }
.btn-success:hover { background: rgba(34,197,94,.25); box-shadow: 0 0 12px rgba(34,197,94,.3); }

.btn-danger   { background: rgba(255,180,171,.1); color: var(--error); border-color: rgba(255,180,171,.4); }
.btn-danger:hover { background: rgba(255,180,171,.2); box-shadow: 0 0 12px rgba(255,180,171,.3); }

.btn-warning  { background: rgba(255,191,0,.1); color: #fde68a; border-color: rgba(255,191,0,.4); }
.btn-warning:hover { background: rgba(255,191,0,.2); }

.btn-outline  { background: transparent; color: var(--cyan); border-color: rgba(0,219,231,.4); }
.btn-outline:hover { background: rgba(0,219,231,.08); box-shadow: 0 0 12px rgba(0,219,231,.2); }

.btn-full { width: 100%; justify-content: center; }
.btn-sm   { padding: .35rem .75rem; font-size: .75rem; }

/* ── Forms ── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: .75rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--cyan); margin-bottom: .4rem; }
.form-input {
  width: 100%; padding: .7rem 1rem;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius); color: var(--on-surface);
  font-size: .9rem; font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.form-input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 10px rgba(0,219,231,.25); }
.form-input--error { border-color: var(--error); }
.form-input-file {
  display: block; width: 100%; padding: .6rem;
  border: 2px dashed rgba(0,219,231,.3); border-radius: var(--radius);
  background: rgba(0,219,231,.03); color: var(--on-muted);
  font-size: .9rem; cursor: pointer; transition: border-color .2s;
}
.form-input-file:hover { border-color: var(--cyan); }
.form-error { display: block; font-size: .8rem; color: var(--error); margin-top: .3rem; }
.form-hint  { display: block; font-size: .8rem; color: var(--on-muted); margin-top: .3rem; }
.form-actions { display: flex; gap: .75rem; margin-top: 1.5rem; flex-wrap: wrap; }

/* ── Auth card ── */
.auth-card {
  max-width: 440px; margin: 2rem auto;
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 0 40px rgba(0,219,231,.1), 0 0 80px rgba(182,0,248,.08);
}
.auth-title { font-size: 1.75rem; font-weight: 700; margin-bottom: 1.75rem; text-align: center; color: var(--on-surface); }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: .875rem; color: var(--on-muted); }

/* ── Page header ── */
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 2.5rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: .5rem; }
.page-header h1 span { color: var(--cyan); }
.page-subtitle { color: var(--on-muted); font-size: 1rem; margin-bottom: 1.25rem; }

/* ── Filters panel ── */
.filters-panel {
  padding: 1rem 1.25rem; border-radius: var(--radius-md);
  margin-bottom: 1.75rem;
}
.filters-form { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.filter-group { display: flex; flex-direction: column; gap: .35rem; }
.filter-label { font-size: .75rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--on-muted); }
.filter-input, .filter-select {
  padding: .55rem .85rem;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius); color: var(--on-surface);
  font-size: .9rem; font-family: inherit; min-width: 180px;
  transition: border-color .2s;
}
.filter-input:focus, .filter-select:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 8px rgba(0,219,231,.2); }
.filter-select option { background: var(--surface); }

/* ── Cards grid ── */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.card-item-wrapper { position: relative; }
.card-item {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.25rem; border-radius: var(--radius-md);
  color: var(--on-surface); text-decoration: none;
  transition: all .25s; cursor: pointer;
  border: 1px solid rgba(255,255,255,.08);
}
.card-item:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 15px rgba(0,219,231,.2);
  text-decoration: none;
}
.card-avatar {
  width: 52px; height: 52px; border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  color: #000; display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif; font-size: 1.3rem; font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(0,219,231,.3);
}
.card-name { font-size: 1rem; font-weight: 600; margin-bottom: .3rem; }
.card-rating { display: flex; gap: .75rem; font-size: .8rem; color: var(--on-muted); }
.rating-likes { color: #86efac; }
.rating-dislikes { color: var(--error); }
.card-delete-form { position: absolute; top: .5rem; right: .5rem; }
.btn-delete {
  background: transparent; border: none; font-size: 1rem;
  cursor: pointer; padding: .3rem .5rem; border-radius: var(--radius);
  transition: background .15s; line-height: 1; color: var(--on-muted);
}
.btn-delete:hover { background: rgba(255,180,171,.15); color: var(--error); }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 5rem 1rem; color: var(--on-muted); }
.empty-icon { font-size: 3.5rem; margin-bottom: 1rem; }

/* ── Card view (fullscreen) ── */
.card-view-page {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

.card-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .6rem 1.25rem; flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(19,19,19,.95);
  backdrop-filter: blur(20px);
  position: relative;
}

.card-toolbar.toolbar-collapsed { display: none; }

.card-toolbar-left  { display: flex; align-items: center; gap: .75rem; }
.card-toolbar-right { display: flex; align-items: center; gap: .75rem; }

/* Центральная секция — абсолютно по центру тулбара */
.card-toolbar-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: .75rem;
  pointer-events: auto;
}

.card-toolbar-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: .95rem; color: var(--cyan);
}

.back-link { font-size: .8rem; color: var(--on-muted); white-space: nowrap; }
.back-link:hover { color: var(--on-surface); }

.rating-counts { display: flex; gap: .75rem; font-size: .95rem; font-weight: 700; }

.vote-buttons { display: flex; gap: .5rem; }

.btn-vote {
  padding: .35rem .75rem; border-radius: var(--radius-full);
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  cursor: pointer; font-size: .9rem; transition: all .2s; line-height: 1; color: var(--on-muted);
}
.btn-vote:hover { border-color: var(--cyan); color: var(--on-surface); }
.btn-like.active  { background: rgba(34,197,94,.15); border-color: rgba(34,197,94,.5); color: #86efac; }
.btn-dislike.active { background: rgba(255,180,171,.1); border-color: rgba(255,180,171,.4); color: var(--error); }

.vote-hint { font-size: .8rem; color: var(--on-muted); }

.btn-collapse {
  padding: .35rem .85rem; border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04);
  cursor: pointer; font-size: .75rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--on-muted); transition: all .15s; white-space: nowrap;
}
.btn-collapse:hover { border-color: var(--cyan); color: var(--on-surface); }

/* iframe — занимает всё оставшееся место */
.card-iframe-container {
  flex: 1;
  overflow: hidden;
  background: #fff;
  min-height: 0;
  width: 100%;
}

.card-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ── Submit page ── */
.submit-page { max-width: 860px; margin: 0 auto; }
.submit-page h1 { font-size: 2rem; font-weight: 700; margin-bottom: 1.5rem; }
.requirements-block { padding: 1.5rem; border-radius: var(--radius-md); margin-bottom: 1.5rem; }
.requirements-block h2 { font-size: 1rem; font-weight: 700; margin-bottom: .75rem; color: var(--cyan); display: flex; align-items: center; gap: .5rem; }
.requirements-list { padding-left: 1.5rem; }
.requirements-list li { margin-bottom: .6rem; font-size: .9rem; line-height: 1.6; color: var(--on-muted); }
.requirements-list li strong { color: var(--on-surface); }
.requirements-note { margin-top: 1rem; font-size: .85rem; color: var(--on-muted); background: rgba(0,219,231,.05); border: 1px solid rgba(0,219,231,.15); padding: .6rem .85rem; border-radius: var(--radius); }
.upload-form { padding: 1.5rem; border-radius: var(--radius-md); }
.upload-form h2 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; color: var(--on-surface); }

/* ── Admin ── */
.admin-page h1 { font-size: 2rem; font-weight: 700; margin-bottom: .75rem; }
.admin-subtitle { color: var(--on-muted); margin-bottom: 1.5rem; font-size: .9rem; }
.admin-table { width: 100%; border-collapse: collapse; border-radius: var(--radius-md); overflow: hidden; }
.admin-table th, .admin-table td { padding: .85rem 1.1rem; text-align: left; border-bottom: 1px solid rgba(255,255,255,.06); font-size: .875rem; }
.admin-table th { background: rgba(255,255,255,.04); font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--on-muted); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(255,255,255,.03); }
.admin-submission-page { max-width: 1100px; margin: 0 auto; }
.admin-submission-page h1 { font-size: 1.5rem; font-weight: 700; margin: 1rem 0; }
.submission-meta { padding: 1rem 1.25rem; border-radius: var(--radius-md); margin-bottom: 1.25rem; font-size: .9rem; }
.submission-meta p { margin-bottom: .4rem; }
.status-badge { display: inline-block; padding: .2rem .7rem; border-radius: var(--radius-full); font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.status-pending  { background: rgba(255,191,0,.1); color: #fde68a; border: 1px solid rgba(255,191,0,.3); }
.status-approved { background: rgba(34,197,94,.1); color: #86efac; border: 1px solid rgba(34,197,94,.3); }
.status-rejected { background: rgba(255,180,171,.1); color: var(--error); border: 1px solid rgba(255,180,171,.3); }
.submission-layout { display: grid; grid-template-columns: 280px 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
.requirements-sidebar { padding: 1.25rem; border-radius: var(--radius-md); align-self: start; }
.requirements-sidebar h3 { font-size: .85rem; font-weight: 700; margin-bottom: .75rem; color: var(--cyan); }
.requirements-list--compact li { font-size: .8rem; margin-bottom: .4rem; }
.preview-area { padding: 1.25rem; border-radius: var(--radius-md); }
.preview-area h3 { font-size: .85rem; font-weight: 700; margin-bottom: .75rem; color: var(--on-surface); }
.admin-preview-iframe { width: 100%; height: 500px; border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius); }
.admin-actions { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: flex-start; padding: 1.25rem; border-radius: var(--radius-md); }
.inline-form { display: inline; }
.reject-form { flex: 1; min-width: 280px; }
.reject-form .form-group { margin-bottom: .75rem; }
.admin-nav { margin-bottom: .75rem; }

/* ── Mobile burger menu ── */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius);
  color: var(--on-surface);
  cursor: pointer;
  padding: .4rem .6rem;
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
}
.nav-toggle:hover { border-color: var(--cyan); color: var(--cyan); }

/* ── Responsive ── */
@media (max-width: 768px) {
  /* Header */
  .site-header .container {
    flex-wrap: nowrap;
    height: auto;
    padding: .6rem 1rem;
    gap: .5rem;
  }
  .logo { font-size: 1rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: rgba(19,19,19,.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,.1);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: .5rem 1rem .75rem;
    z-index: 200;
  }
  .nav.nav-open { display: flex; }
  .nav-user { padding: .5rem 0; border-bottom: 1px solid rgba(255,255,255,.06); margin-bottom: .25rem; }
  .nav-link { padding: .6rem .5rem; font-size: .85rem; border-radius: var(--radius); }
  .nav-cta { margin-top: .25rem; text-align: center; justify-content: center; }

  /* Layout */
  .container { padding: 0 16px; }
  .main-content { padding: 1.25rem 16px; }

  /* Page header */
  .page-header h1 { font-size: 1.5rem; }
  .page-subtitle { font-size: .9rem; }

  /* Filters */
  .filters-form { flex-direction: column; align-items: stretch; gap: .75rem; }
  .filter-input, .filter-select { min-width: unset; width: 100%; }
  .filter-group { width: 100%; }

  /* Cards grid */
  .cards-grid { grid-template-columns: 1fr 1fr; gap: .75rem; }

  /* Card toolbar — stack vertically on mobile */
  .card-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: .5rem;
    padding: .6rem 1rem;
  }
  .card-toolbar-center {
    position: static;
    transform: none;
    justify-content: center;
    order: 2;
  }
  .card-toolbar-left  { order: 1; justify-content: space-between; }
  .card-toolbar-right { order: 3; justify-content: flex-end; }

  /* Card view page — allow scroll in Firefox */
  body.page-card-view {
    height: auto;
    overflow: auto;
    overflow-x: hidden;
  }
  body.page-card-view .main-content-fullscreen {
    height: auto;
    overflow: visible;
  }
  .card-view-page {
    height: auto;
    overflow: visible;
    min-height: 100vh;
  }
  .card-iframe-container {
    overflow: visible;
    height: auto !important;
  }
  .card-iframe {
    height: 80vh;
    min-height: 400px;
  }

  /* Submit page */
  .submit-page h1 { font-size: 1.5rem; }
  .requirements-block { padding: 1rem; }
  .upload-form { padding: 1rem; }

  /* Admin */
  .submission-layout { grid-template-columns: 1fr; }
  .admin-actions { flex-direction: column; }
  .admin-table { font-size: .8rem; }
  .admin-table th, .admin-table td { padding: .6rem .75rem; }

  /* Auth */
  .auth-card { margin: 1rem auto; padding: 1.5rem 1.25rem; }
}

@media (max-width: 480px) {
  .cards-grid { grid-template-columns: 1fr; }
  .card-toolbar-left { flex-wrap: wrap; gap: .4rem; }
  .rating-counts { font-size: .85rem; }
  .vote-buttons .btn-vote { padding: .3rem .6rem; font-size: .85rem; }
  .card-iframe { height: 70vh; min-height: 350px; }

  /* Admin table — hide less important columns */
  .admin-table .col-hide-mobile { display: none; }
  .admin-actions { gap: .75rem; }
  .reject-form { min-width: unset; }
}
