/* ==========================
   Windows 11 Design System — Full Element Reset
   ========================== */

:root {
  /* Палитра Windows 11 */
  --win11-bg: #f3f3f3;
  --win11-surface: #ffffff;
  --win11-text: #202020;
  --win11-text-secondary: #606060;
  --win11-accent: #006dea; /* Fluent Pink/Purple — как в настройках Win11 */
  --win11-accent-hover: #0060ce;
  --win11-border: #e5e5e5;
  --win11-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
  --win11-hover-bg: rgba(0, 120, 212, 0.08);
  --win11-active-bg: rgba(0, 120, 212, 0.16);
  --win11-radius: 6px;
  --win11-focus-ring: 2px solid rgba(0, 120, 212, 0.12);
}

/* ==========================
   Global Reset + Base Styles
   ========================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  font-family:
    "Segoe UI Variable", "Segoe UI", "Segoe UI Symbol", Tahoma, Geneva, Verdana,
    sans-serif;
  font-size: 15px;
  line-height: 1.6;
  background: var(--win11-bg);
  color: var(--win11-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

html,
body {
  margin: 0;
  padding: 0;
}

/* ==========================
   Typography — H1..H6, P, Blockquotes, etc.
   ========================== */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.3;
  margin: 1.25rem 0 0.75rem;
  color: var(--win11-text);
}

h1 {
  font-size: 2.25rem;
}
h2 {
  font-size: 1.75rem;
}
h3 {
  font-size: 1.5rem;
}
h4 {
  font-size: 1.25rem;
}
h5 {
  font-size: 1.125rem;
}
h6 {
  font-size: 1rem;
}

p {
  margin: 0 0 1.25rem;
  color: var(--win11-text-secondary);
  font-weight: 400;
}

/* Lists */
ul,
ol {
  margin: 1rem 0 1.25rem 1.5rem;
  color: var(--win11-text-secondary);
}

ul li,
ol li {
  margin-bottom: 0.5rem;
  position: relative;
}

ul {
  list-style: none;
}

ul li::before {
  content: "•";
  color: var(--win11-accent);
  font-weight: 700;
  position: absolute;
  left: -1rem;
}

ol {
  list-style: decimal;
  padding-left: 2rem;
}

ol li::marker {
  font-weight: 600;
  color: var(--win11-accent);
}

/* Links */
a {
  color: var(--win11-accent);
  text-decoration: none;
  font-weight: 500;
  transition:
    color 0.2s,
    background 0.2s;
  padding: 0 2px;
  border-radius: 4px;
}

a:hover {
  color: var(--win11-accent-hover);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

a:focus {
  outline: none;
  background: rgba(98, 0, 234, 0.1);
}

a.btn {
  padding: 0.5rem;
}

/* Blockquotes */
blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--win11-surface);
  border-left: 4px solid var(--win11-accent);
  border-radius: 0 12px 12px 0;
  box-shadow: var(--win11-shadow);
  font-style: italic;
}

blockquote p {
  margin: 0;
}

/* Code & Preformatted */
code {
  background: rgba(0, 0, 0, 0.04);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.9em;
  color: #d63384;
}

pre {
  background: #1e1e1e;
  color: #dcdcdc;
  padding: 1rem;
  border-radius: 12px;
  overflow-x: auto;
  margin: 1rem 0;
  font-family: "Consolas", "Courier New", monospace;
  white-space: pre;
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* Horizontal rule */
hr {
  border: none;
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
  margin: 2rem 0;
}

/* ==========================
   Forms — Inputs, Buttons, etc.
   ========================== */

form {
  max-width: 1200px;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--win11-text);
}

input,
textarea,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--win11-border);
  border-radius: 8px;
  background: var(--win11-surface);
  font-size: 15px;
  font-family: inherit;
  color: var(--win11-text);
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background 0.2s;
}

input::placeholder,
textarea::placeholder {
  color: #888;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  background: var(--win11-surface);
  border-color: var(--win11-accent);
  box-shadow: 0 0 0 2px var(--win11-focus-ring);
}

input:invalid:not(:focus),
textarea:invalid:not(:focus) {
  border-color: #d63384;
}

/* ====== Кнопки — стилизованы по dashboard.html ====== */
input[type="checkbox"]{
  max-width: 30px;
}
button,
input[type="button"],
input[type="submit"],
input[type="reset"],
.btn {
  background-color: var(--win11-surface);
  color: var(--win11-text);
  border: 1px solid var(--win11-border);
  border-radius: var(--win11-radius);
  padding: 6px 16px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--win11-shadow);
  transition:
    background-color 0.2s,
    border-color 0.2s,
    transform 0.1s;
  outline: none;
}

button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
input[type="reset"]:hover,
.btn:hover {
  background-color: var(--win11-hover-bg);
  border-color: var(--win11-accent);
}

button:active,
input[type="button"]:active,
input[type="submit"]:active,
input[type="reset"]:active,
.btn:active {
  background-color: var(--win11-active-bg);
  transform: translateY(1px);
}

button:focus-visible,
input[type="button"]:focus-visible,
input[type="submit"]:focus-visible,
input[type="reset"]:focus-visible,
.btn:focus-visible {
  border-color: var(--win11-accent);
  box-shadow: 0 0 0 2px var(--win11-focus-ring);
}

/* Основные кнопки (primary) */
.btn-primary,
button.primary,
input[type="submit"].primary {
  background-color: var(--win11-accent);
  color: white;
  border-color: var(--win11-accent);
}

.btn-primary:hover,
button.primary:hover,
input[type="submit"].primary:hover {
  background-color: var(--win11-accent-hover);
}

/* Вторичные кнопки (secondary) */
.btn-secondary,
button.secondary,
input[type="button"].secondary {
  background-color: transparent;
  border-color: var(--win11-border);
  color: var(--win11-text-secondary);
}

.btn-secondary:hover,
button.secondary:hover,
input[type="button"].secondary:hover {
  background-color: var(--win11-hover-bg);
  color: var(--win11-text);
}

/* ==========================
   Cards — для любых блоков
   ========================== */

.card-grid {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  margin: auto;
  max-width: 1200px;
  grid-template-columns: repeat(3, calc(33% - 1rem));
}
.card-grid .card {
  width: 100%;
}
footer .card-grid .card {
  border: none;
  box-shadow: none;
}
.content {
  padding: 4rem 2rem;
  background: var(--win11-surface);
  border-radius: var(--win11-radius);
  box-shadow: var(--win11-shadow);
  margin-bottom: 2rem;
}
.card {
  background: var(--win11-surface);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: var(--win11-shadow);
  padding: 1.5rem;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.card-header {
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: 1rem;
  color: var(--win11-text);
}

.card-content {
  margin-top: 0.5rem;
}

/* ==========================
   Tables — как в файле Excel
   ========================== */

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

th,
td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

th {
  background: rgba(98, 0, 234, 0.1);
  color: var(--win11-text);
}

td {
  color: var(--win11-text-secondary);
}

tr:hover td {
  background: rgba(98, 0, 234, 0.08);
}

/* ==========================
   Header & Navigation
   ========================== */

header {
  background: var(--win11-surface);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 0.75rem 2rem;
  position: sticky;
  width: 100%;
  padding: 5px;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

header nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header nav .logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--win11-text); /* тёмный текст */
  letter-spacing: -0.5px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

header nav ul {
  display: flex;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
}
header nav ul li::before {
  content: none !important;
  display: none !important;
}
header nav ul li {
  position: static !important;
  margin: 0 !important;
  padding-left: 0 !important;
}

header nav a {
  text-decoration: none;
  color: var(--win11-text); /* тёмный текст */
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

/* Акцентная подсветка текущей страницы — СИНИЕ */
header nav a.active {
  background: rgba(0, 120, 212, 0.1);
  color: var(--win11-accent);
  font-weight: 600;
}

/* Подчёркивание активного пункта — СИНИЙ */
header nav a.active::after {
  content: "";
  position: absolute;
  bottom: 0.5rem;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--win11-accent);
  border-radius: 1px;
}

header nav a:hover {
  text-decoration: none;
  background: rgba(0, 120, 212, 0.08);
  color: var(--win11-accent);
}

header nav a:focus {
  outline: none;
  background: rgba(0, 120, 212, 0.1);
}

main {
  flex: 1;
  padding: 2rem;
  background: var(--win11-bg);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ==========================
   Footer & Layout
   ========================== */

footer {
  width: 100%;
  background: var(--win11-surface);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  margin-top: auto;
}

footer .card-grid {
  width: 100%;
}

footer p {
  color: #666;
  font-size: 0.9rem;
  text-align: center;
}

footer .card ul li::before {
  content: none !important;
  display: none !important;
}

footer .card ul li a {
  color: #8f8f8f;
  text-decoration: none;
}

.card-image {
  padding: 10px;
}

.card-image img {
  max-width: 1200px;
  border-radius: 10px;
}

/* Плавная анимация меню */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1000;
  transition: transform 0.3s;
}

a .menu-toggle {
  text-decoration: none;
}

.menu-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px 0;
  background-color: #999999;
  transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}
.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Toast-уведомление скопировано — Windows 11 */
.copied-toast {
  position: fixed;
  top: 20px;
  right: -320px;
  background: var(--win11-surface);
  color: var(--win11-text);
  font-family:
    "Segoe UI Variable", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: pre;
}

.copied-toast::before {
  content: "✅";
  font-size: 1.1rem;
}

.copied-toast.copied-toast-visible {
  right: 20px;
}
.center {
  text-align: center;
}
.warn {
  background-color: #ff0000;
  color: white;
}
a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  background-color: var(--win11-surface);
  color: var(--win11-text);
  border: 1px solid var(--win11-border);
  border-radius: var(--win11-radius);
  box-shadow: var(--win11-shadow);
  text-decoration: none !important;
  transition:
    background-color 0.2s,
    border-color 0.2s,
    transform 0.1s;
}

a.btn:hover {
  background-color: var(--win11-hover-bg);
  border-color: var(--win11-accent);
  text-decoration: none !important;
}

a.btn:active {
  background-color: var(--win11-active-bg);
  transform: translateY(1px);
}
/* Мобильное меню */
@media (max-width: 768px) {
  main {
    padding: 0.5rem;
  }

  .container {
    padding: 0 0rem;
  }

  .menu-toggle {
    display: block;
    position: absolute;
    top: 5px;
    right: 5px;
  }

  .nav-menu {
    display: block;
    position: absolute;
    top: 50px;
    left: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    z-index: 999;
  }

  .nav-menu.active {
    max-height: 100vh;
    overflow-y: auto;
  }

  .nav-menu li {
    margin: 0;
    text-align: center;
  }

  .nav-menu li:last-child {
    border-bottom: none;
  }

  .nav-menu a,
  .nav-menu span {
    display: block;
    padding: 1rem;
    color: #333;
    transition: background 0.2s;
  }

  .nav-menu a:hover,
  .nav-menu span:hover {
    background-color: #f8f8f8;
  }

  .nav-menu span {
    font-weight: 600;
    color: #666;
  }
}

/* Десктоп */
@media (min-width: 769px) {
  .menu-toggle {
    display: none !important;
  }

  .nav-menu {
    display: flex !important;
    flex-direction: row;
    gap: 1.5rem;
    position: static;
    background: none;
    box-shadow: none;
    max-height: none !important;
    overflow: visible !important;
  }

  .nav-menu span {
    font-size: 0.9rem;
    color: #666;
    margin: 0 0.5rem;
    font-weight: 500;
  }
}

/* ==========================
   Responsive (для хедера и нава)
   ========================== */

@media (max-width: 768px) {
  header {
    padding: 0.75rem 1rem;
  }

  header nav {
    flex-direction: column;
    gap: 0.25rem;
  }

  header nav ul {
    flex-direction: column;
    width: 100%;
    gap: 0.15rem;
  }

  header nav a {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }
}

/* ==========================
   Responsive
   ========================== */

@media (max-width: 768px) {
  nav {
    flex-direction: column;
    gap: 0.5rem;
  }

  nav ul {
    gap: 0.25rem;
  }

  header {
    padding: 0.75rem 1.25rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .card {
    padding: 1rem;
  }
}

@media (max-width: 900px) {
  .card-grid {
    margin: 0 -1rem;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================
   Dark Mode (optional)
   ========================== */

@media (prefers-color-scheme: dark) {
  :root {
    --win11-bg: #202020;
    --win11-surface: #2d2d2d;
    --win11-text: #f0f0f0;
    --win11-text-secondary: #c0c0c0;
    --win11-accent: #6200ea;
    --win11-accent-hover: #4a00d4;
    --win11-border: #3a3a3a;
    --win11-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --win11-hover-bg: rgba(255, 255, 255, 0.08);
    --win11-active-bg: rgba(255, 255, 255, 0.16);
    --win11-focus-ring: 2px solid rgba(98, 0, 234, 0.4);
  }

  /* Цвета для button/inputs при темной теме — как в dashboard */
  button,
  input[type="button"],
  input[type="submit"],
  input[type="reset"],
  .btn {
    background-color: var(--win11-surface);
    color: var(--win11-text);
    border: 1px solid var(--win11-border);
  }

  button:hover,
  input[type="button"]:hover,
  input[type="submit"]:hover,
  input[type="reset"]:hover,
  .btn:hover {
    background-color: var(--win11-hover-bg);
    border-color: var(--win11-accent);
  }

  .btn-primary,
  button.primary,
  input[type="submit"].primary {
    background-color: var(--win11-accent);
    color: white;
    border-color: var(--win11-accent);
  }

  .btn-primary:hover,
  button.primary:hover,
  input[type="submit"].primary:hover {
    background-color: var(--win11-accent-hover);
  }

  .btn-secondary,
  button.secondary,
  input[type="button"].secondary {
    background-color: transparent;
    border-color: var(--win11-border);
    color: var(--win11-text-secondary);
  }

  .btn-secondary:hover,
  button.secondary:hover,
  input[type="button"].secondary:hover {
    background-color: var(--win11-hover-bg);
    color: var(--win11-text);
  }
}
