/* =========================
   Базовая типографика / сетка
   ========================= */

:root {
    --bg-page: #f5f6f8;
    --bg-card: #ffffff;
    --bg-card-alt: #fafafa;
    --text-main: #1a1a1a;
    --text-dim: #6b6b6b;
    --border-soft: #dedede;
    --border-mid: #cfcfcf;
    --accent: #2b6fff;
    --radius-card: 12px;
    --radius-chip: 6px;
    --shadow-card: 0 8px 24px rgba(0,0,0,0.06);
    --shadow-card-hover: 0 10px 28px rgba(0,0,0,0.09);
    --font-main: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Inter,"Helvetica Neue",Arial,sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0 16px;
    background: var(--bg-page);
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 15px;
    line-height: 1.5;
}

/* Контейнер по центру */
body > header,
body > section,
.page-wrap {
    max-width: 1200px;
    margin: 0 auto 24px;
}

body > footer,
.page-wrap {
    max-width: 1200px;
    margin: 0 auto;
}

/* Заголовки секций */
h1, h2, h3 {
    color: var(--text-main);
    line-height: 1.2;
    margin: 0 0 12px;
    font-weight: 600;
}

h1 {
    font-size: 22px;
}

h2 {
    font-size: 18px;
    margin-top: 32px;
}

h3 {
    font-size: 16px;
    margin-top: 24px;
}

p {
    margin: 0 0 12px;
    color: var(--text-main);
}

.container {
    max-width: 1200px;
    margin: 0 auto 24px;
}

/* =========================
   Хедер
   ========================= */
header {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-card);
    padding: 10px 0;
    box-shadow: var(--shadow-card);
    margin-bottom: 20px;
}

header .container {
    margin: 0 auto;
}

header .logo {
    max-height: 40px;
}

.userheader {
    display: flex;
    align-items: center;
    justify-content: end;
    position: relative;
}

.dropbtn {
    background: var(--primary-color);
    border-radius: 6px;
    cursor: pointer;
    width: 26px;
    margin-left: 5px;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    border-radius: 0.5em;
    border: 1px solid var(--primary-color);
    display: none;
    position: absolute;
    background-color: #fff;
    min-width: 160px;
    overflow: auto;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
}
.dropdown-content.show {
    right: 0;
    top: 30px;
}

.dropdown-content a {
    color: black;
    padding: 3px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    color: var(--primary-color);
}

.dropdown a:hover {background-color: #ddd;}

.show {display: block;}


/* =========================
   Поиск
   ========================= */

.search {
    background: transparent;
    padding: 24px 0 8px;
}

.search h1 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-main);
}

.search form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-card);
    padding: 12px 16px;
    box-shadow: var(--shadow-card);
}

.search form input[type="text"],
.search form input[type="search"] {
    flex: 1;
    min-width: 160px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-chip);
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
    background: #fff;
    color: var(--text-main);
}

.search form input[type="text"]:focus,
.search form input[type="search"]:focus {
    border-color: var(--accent);
}

.search form button {
    appearance: none;
    border: 0;
    border-radius: var(--radius-chip);
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 14px;
    cursor: pointer;
    white-space: nowrap;
}

.search form button:hover {
    filter: brightness(1.05);
}


/* =========================
   Карусель
   ========================= */
   
.carousel{ overflow: hidden; }
  .carousel-track{
    display:flex; gap:12px; 
    will-change: transform;
    transition: transform .4s ease;
  }
  .c-item{ flex:0 0 auto; } /* карточка фиксированной ширины */


/* =========================
   Глобальные элементы UI
   ========================= */

/* Карточка по умолчанию */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 16px;
}

.card:hover {
    box-shadow: var(--shadow-card-hover);
}

.card .acc-name a, .account-card .acc-name a {
    color: #000;
    text-decoration: none;
}

.card .acc-handle a, .account-card .acc-handle a {
    color: #666;
    text-decoration: none;
}

/* Мелкая карточка аккаунта / канала / vk-группы */
.account-card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 16px;
    margin-bottom: 12px;
}

.account-card a {
    color: var(--accent);
    font-weight: 500;
    text-decoration: none;
}

.account-card a:hover {
    text-decoration: underline;
}

.account-card .handle {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 2px;
}

.account-card .metric-row {
    font-size: 13px;
    color: var(--text-main);
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* Карточка проекта (бренд) */
.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-card a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
}

.project-card a:hover {
    text-decoration: underline;
}

.project-followers {
    font-size: 13px;
    color: var(--text-dim);
}

.project-accounts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 13px;
}

.project-accounts .acc-mini {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    min-width: max-content;
}

.project-accounts .acc-mini .platform {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .03em;
}

.project-accounts .acc-mini a {
    color: var(--text-main);
    font-weight: 500;
    text-decoration: none;
}

.project-accounts .acc-mini a:hover {
    color: var(--accent);
}

/* Сетка категорий */
.categories-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.cat-item {
    display: inline-block;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-chip);
    box-shadow: var(--shadow-card);
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-main);
    text-decoration: none;
    line-height: 1.3;
    font-weight: 500;
    white-space: nowrap;
}

.cat-item:hover {
    box-shadow: var(--shadow-card-hover);
    color: var(--accent);
}

/* Сетки блоков */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 600px) {
    .projects-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1000px) {
    .projects-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* =========================
   Таблицы (channel.php, project.php)
   ========================= */

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius-card);
    overflow: hidden;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-card);
    font-size: 13px;
    margin-bottom: 24px;
}

table thead th {
    background: var(--bg-card-alt);
    text-align: left;
    font-weight: 500;
    font-size: 12px;
    color: var(--text-dim);
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-soft);
    white-space: nowrap;
}

table tbody td {
    color: var(--text-main);
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: top;
    background: var(--bg-card);
}

table tbody tr:last-child td {
    border-bottom: 0;
}

/* =========================
   Текстовые блоки карточек (channel.php / project.php)
   ========================= */

.details-block {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 16px;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 16px;
}

.details-block a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.details-block a:hover {
    text-decoration: underline;
}

.details-block .label {
    color: var(--text-dim);
    font-size: 12px;
    margin-bottom: 4px;
}

.details-block .value {
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.metrics-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    line-height: 1.4;
    margin-top: 8px;
}

.metrics-inline .metric-item {
    min-width: max-content;
}

.metrics-inline .metric-label {
    color: var(--text-dim);
    font-size: 12px;
}

.metrics-inline .metric-value {
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

/* =========================
   Формы (admin/enrich.php)
   ========================= */

form {
    font-size: 14px;
    line-height: 1.4;
}

form input[type="text"],
form select,
form input[type="search"],
form input[type="number"] {
    width: 100%;
    max-width: none;
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-chip);
    font-size: 14px;
    padding: 8px 10px;
    outline: none;
    color: var(--text-main);
}

.search-box form input[type="text"] {
    max-width: none;
}

form input[type="text"]:focus,
form select:focus {
    border-color: var(--accent);
}

form .row-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

form button[type="submit"],
.btn-primary {
    appearance: none;
    border: 0;
    border-radius: var(--radius-chip);
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    padding: 9px 14px;
    cursor: pointer;
    white-space: nowrap;
}

form button[type="submit"]:hover,
.btn-primary:hover {
    filter: brightness(1.05);
}

/* Блок аккаунта в admin/enrich.php */
.admin-account-block {
    background: var(--bg-card);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 16px;
    margin-bottom: 16px;
}

.admin-account-block .acc-head {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-main);
}

.admin-account-block .acc-sub {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.4;
    margin-bottom: 8px;
}

.admin-account-block .acc-metrics {
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-main);
    margin-bottom: 12px;
}

.admin-account-block .acc-metrics div {
    margin-bottom: 4px;
}

.admin-account-block hr {
    border: 0;
    border-top: 1px solid var(--border-soft);
    margin: 12px 0;
}

/* =========================
   Footer
   ========================= */

footer {
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 24px 0 10px;
    border-top: 1px solid var(--border-soft);
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.4;
    text-align: left;
}