/* ===== Base ===== */
* { box-sizing: border-box; }

html, body {
  overflow-x: hidden;
  width: 100%;
}

body {
    background-color: #121212;
    color: #e0e0e0;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

/* No default blue links */
a { color: inherit; text-decoration: none; }
a:visited { color: inherit; }

/* ===== Header ===== */
.site-header {
    background-color: #1e1e1e;
    padding: 18px 14px;
    text-align: center;
}

.site-header .logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.site-header .logo img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: block;
}

.site-header .site-name {
    font-size: 34px;
    font-weight: 800;
    color: #f5f5f5;
    line-height: 1.1;
}

.nav-main {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.nav-main a {
    color: #ccc;
    font-size: 14px;
    padding: 6px 8px;
    border-radius: 6px;
}

.nav-main a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.site-header h2 {
    color: #f5f5f5;
    margin: 12px 0 0;
    font-size: 30px;
    line-height: 1.2;
}

/* ===== Cards ===== */
.channel-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 20px;
}

.channel-card-link,
.channel-card-link:link,
.channel-card-link:visited,
.channel-card-link:hover,
.channel-card-link:active {
    display: block;
    text-decoration: none !important;
    color: inherit !important;
}

.channel-card-link * { text-decoration: none !important; }

.channel-card {
    background-color: #1e1e1e;
    border-radius: 12px;
    padding: 15px;
    margin: 10px;
    width: 260px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    cursor: pointer;
}

.channel-card-link:hover .channel-card {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

.channel-card img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
}

.channel-card .title {
    font-size: 18px;
    font-weight: bold;
    margin-top: 10px;
    color: #ffffff;
}

.channel-card .description {
    font-size: 14px;
    margin-top: 6px;
    color: #bbbbbb;
    line-height: 1.4;
}

.channel-card .subscribers,
.channel-card .clicks {
    font-size: 12px;
    color: #888888;
    margin-top: 6px;
}

.link-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 14px;
    background-color: #2a2a2a;
    color: #ffffff;
    border-radius: 8px;
    font-size: 14px;
}

.link-btn:hover { background-color: #444444; }

/* ===== Footer ===== */
footer {
    background-color: #1e1e1e;
    padding: 20px;
    text-align: center;
    color: #666666;
    font-size: 12px;
}

.footer-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 15px;
}

.footer-about {
    margin: 0 0 10px;
    color: #9a9a9a;
    line-height: 1.5;
    font-size: 13px;
}

.footer-links { margin: 0 0 10px; font-size: 13px; }

.footer-links a,
.footer-links a:visited {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #333;
    background: #151515;
    color: #e0e0e0;
    font-weight: 700;
}

.footer-links a:hover {
    background: #222;
    border-color: #444;
}

.footer-copy { margin: 0; color: #666; font-size: 12px; }

/* ===== Admin ===== */
.admin-container { max-width: 1100px; margin: 20px auto; padding: 0 14px; }
.admin-form-row { margin: 10px 0; }
.admin-input, textarea.admin-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #2d2d2d;
    background: #141414;
    color: #e0e0e0;
    outline: none;
}
.admin-button {
    margin-top: 10px;
    padding: 10px 14px;
    border: 0;
    border-radius: 8px;
    background: #2a2a2a;
    color: #fff;
    cursor: pointer;
}
.admin-button:hover { background: #444; }
.admin-table { width: 100%; border-collapse: collapse; margin-top: 12px; overflow: hidden; border-radius: 10px; }
.admin-table th, .admin-table td { border-bottom: 1px solid #2a2a2a; padding: 10px; text-align: left; font-size: 14px; }
.admin-table th { background: #171717; color: #ddd; }

.message { padding: 10px 12px; border-radius: 8px; margin: 12px 0; }
.message.success { background: rgba(0, 255, 0, 0.08); color: #b6ffb6; }
.message.error { background: rgba(255, 0, 0, 0.10); color: #ffb6b6; }

/* ===== Roliki (compact cards) ===== */
.reels-wrap{
    max-width: 900px;
    margin: 16px auto 28px;
    padding: 0 14px;
}

.reel{
    position: relative;
    background: #161616;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 14px;
    margin: 0 0 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}

.reel-video{
    width: 320px;
    max-width: 100%;
    height: 560px;
    border-radius: 12px;
    background: #000;
    display: block;
    margin: 0 auto;
    object-fit: cover;
    pointer-events: none; /* prevent native player open */
}

.reel-ui{
    margin-top: 12px;
    width: 100%;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
    pointer-events: none;
}

.reel-title{ font-size: 16px; font-weight: 800; color: #fff; }
.reel-desc{ margin-top: 6px; font-size: 13px; color: #cfcfcf; line-height: 1.35; }

.reel-meta{
    margin-top: 10px;
    font-size: 12px;
    color: #a8a8a8;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.reels-empty{ padding: 30px; text-align: center; color: #bbb; }

@media (max-width: 520px) {
    .site-header .site-name { font-size: 28px; }
    .site-header h2 { font-size: 24px; }
    .channel-list { padding: 12px; }
    .channel-card { width: 84vw; max-width: 320px; padding: 12px; margin: 8px 0; }
    .reel-video{ width: 92vw; max-width: 360px; height: 520px; }
}
.post-slider{
  margin-top: 10px;
  padding: 10px;
  border-radius: 10px;
  background: #151515;
  border: 1px solid #2a2a2a;
}

.post-slider-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:8px;
  color:#bbb;
  font-size:16px;
}

.slider-btn{
  padding:2px 10px;
  border-radius:8px;
  background:#222;
  border:1px solid #333;
  user-select:none;
}

.slider-btn:hover{ background:#2c2c2c; }

.post-slider-body{ display:grid; gap:8px; }

.post-img{ width:100%; border-radius:10px; display:block; }

.post-text{ font-size:13px; color:#cfcfcf; line-height:1.35; }

.post-open{
  display:inline-block;
  font-size:13px;
  color:#ccc;
  text-decoration:underline;
}
.post-slider-body {
  border-radius: 10px;
  padding: 6px;
}

.post-slider-body:hover {
  background: rgba(255,255,255,0.05);
}
/* ===== Post page (Telegram widget wrapper) ===== */
.post-wrap{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:12px;
}

.post-card{
  width: 100%;
  max-width: 560px;
  padding: 14px;
  border-radius: 14px;
  background: #151515;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
}

/* Телеграм-виджет сам по себе белый, но мы даём ему рамку/отступ,
   чтобы он выглядел как “встроенный блок”, а не белая простыня */
.post-card iframe,
.post-card .tgme_widget_message,
.post-card .tgme_widget_message_wrap{
  border-radius: 12px !important;
}

.post-actions{
  width: 100%;
  max-width: 560px;
  display:flex;
  justify-content:center;
}
/* ===== Posts feed on channel page ===== */
.posts-feed {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: #151515;
  border: 1px solid rgba(255,255,255,0.08);
}

.posts-feed h3{
  margin: 0 0 10px;
  color: #f5f5f5;
  font-size: 16px;
}

.posts-status{
  color:#aaa;
  font-size: 13px;
  margin: 6px 0 0;
}

.posts-feed-list{
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.post-item{
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  background: #171717;
}

.post-item:hover{
  background: #1c1c1c;
}

.post-media{
  width: 110px;
  height: 110px;
  border-radius: 10px;
  overflow: hidden;
  background: #0f0f0f;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#777;
  font-size: 12px;
}

.post-media img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}

.post-body{
  display:flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.post-text{
  color:#ddd;
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
}

.post-meta{
  color:#aaa;
  font-size: 12px;
}

.posts-more{
  margin-top: 10px;
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #333;
  background: #151515;
  color: #e0e0e0;
  font-weight: 700;
}

.posts-more:hover{
  background:#222;
  border-color:#444;
}
.channel-list {
  max-width: 100%;
}

.channel-card {
  max-width: 100%;
}

.channel-card img,
.post-img {
  max-width: 100%;
  height: auto;
}

.post-slider, .post-slider * {
  max-width: 100%;
}
/* Центрирование текста в блоке */
.centered-text {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 12px;
}
.ad-badge{
  display:inline-block;
  margin-left:8px;
  padding:2px 8px;
  font-size:12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.18);
  background:rgba(255,255,255,0.06);
  color:#cfcfcf;
  vertical-align:middle;
}

/* ===== Channel detail layout ===== */
/* Wrapper uses existing channel-card styles; additional layout tweaks below */
.channel-card.channel-detail {
    display: flex;
    flex-direction: column;
    max-width: 100%;
}

/* Horizontal section containing avatar and basic info */
.channel-card.channel-detail .channel-main {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

/* Avatar container; restricts size and makes image round */
.channel-card.channel-detail .channel-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.channel-card.channel-detail .channel-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Text container next to avatar */
.channel-card.channel-detail .channel-info {
    flex: 1;
    min-width: 0;
}

/* Channel name styling */
.channel-card.channel-detail .channel-name {
    font-size: 20px;
    font-weight: 700;
    color: #f5f5f5;
    margin: 0;
    line-height: 1.2;
}

/* Channel description styling */
.channel-card.channel-detail .channel-description {
    margin-top: 12px;
    font-size: 14px;
    color: #bbbbbb;
    line-height: 1.4;
    white-space: pre-line;
}

/* Stats row (subscribers, clicks) */
.channel-card.channel-detail .channel-stats {
    margin-top: 8px;
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #888888;
}

/* Ensure the button has some top margin when used in this card */
.channel-card.channel-detail .link-btn {
    margin-top: 10px;
    padding: 12px 20px;
    font-size: 16px;
    display: inline-block;
}
/* ===== ?????? ?????? ===== */
.post-list {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ???????? ?????? ? ????-????? */
.post-list .post-card {
  background: #171717;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

/* ?????? ??? ?????????: ?????? ?????? ? ????????? */
.post-list .post-card:hover {
  background: #1c1c1c;
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.45);
}

/* ????????? ?????? */
.post-list .post-card h3 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
  color: #f5f5f5;
}

/* ??????????? ?????? */
.post-list .post-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin-bottom: 12px;
}

/* ??????? ????? */
.post-list .post-card .excerpt {
  color: #ccc;
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 12px;
}

/* ?????? ?????? ????? */
.post-list .post-card a {
  color: #4da3ff;
  font-size: 14px;
  text-decoration: underline;
}

.post-list .post-card a:hover {
  color: #80c5ff;
}
/* ===== ?????? ?????? ===== */
.post-list {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ???????? ?????? */
.post-card {
  background: #171717;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.post-card:hover {
  background: #1c1c1c;
  box-shadow: 0 10px 24px rgba(0,0,0,0.45);
}

/* ????????? ?????? */
.post-card h3 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
  color: #f5f5f5;
}

/* ??????????? ? ???????? */
.post-card img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin-bottom: 12px;
}

/* ??????? ????? (excerpt) */
.post-card .excerpt {
  color: #ccc;
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 12px;
}

/* ?????? ?????? ????? */
.post-card a {
  color: #4da3ff;
  font-size: 14px;
  text-decoration: underline;
}

.post-card a:hover {
  color: #80c5ff;
}
/* --- ?????? ????????? ? ????? --- */
.nav-main a {
  display: inline-block;
  padding: 8px 14px;
  margin: 4px 6px;
  font-size: 15px;
  font-weight: 600;
  color: #f5f5f5;
  background: #2a2a2a;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.nav-main a:hover {
  background: #3a3a3a;
  box-shadow: 0 4px 12px rgba(0,0,0,0.45);
  color: #fff;
}

/* --- ????????? ??? ????????? ?????? --- */
@media (max-width: 520px) {
  .nav-main {
    gap: 6px;
  }
  .nav-main a {
    font-size: 12px;
    padding: 6px 8px;
    margin: 0;
  }
}
