/* =============================================================
   IPTV Platform — Global Design System
   ============================================================= */
:root {
    --bg-primary: #0b0e14;
    --bg-secondary: #131722;
    --bg-card: #1a1f2e;
    --bg-card-hover: #212739;
    --accent: #6c5ce7;
    --accent-2: #00d9c0;
    --accent-gradient: linear-gradient(135deg, #6c5ce7 0%, #00d9c0 100%);
    --text-primary: #f2f3f7;
    --text-secondary: #9aa0b4;
    --text-muted: #5f6579;
    --border: #262c3d;
    --success: #2ecc71;
    --danger: #ff5c72;
    --warning: #ffb648;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 8px 24px rgba(0,0,0,0.35);
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

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

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

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

/* ---------- Navbar ---------- */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: rgba(19, 23, 34, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar .logo {
    font-size: 22px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}
.navbar nav a {
    margin-left: 28px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 15px;
    transition: color .2s;
}
.navbar nav a:hover { color: var(--text-primary); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 26px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, opacity .15s;
}
.btn-primary { background: var(--accent-gradient); color: #fff; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(108,92,231,0.4); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-primary); }
.btn-outline:hover { border-color: var(--accent); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #0b0e14; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Hero ---------- */
.hero {
    text-align: center;
    padding: 110px 24px 90px;
    background: radial-gradient(ellipse at top, rgba(108,92,231,0.15), transparent 60%);
}
.hero h1 {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 18px;
}
.hero h1 span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero p {
    color: var(--text-secondary);
    font-size: 18px;
    max-width: 560px;
    margin: 0 auto 36px;
}

/* ---------- Cards / Pricing ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    padding: 40px 0 80px;
}
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 26px;
    transition: transform .2s, border-color .2s;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.card h3 { font-size: 20px; margin-bottom: 8px; }
.card .price { font-size: 36px; font-weight: 800; margin: 18px 0 6px; }
.card .price small { font-size: 15px; color: var(--text-secondary); font-weight: 400; }
.card ul { list-style: none; margin: 20px 0; color: var(--text-secondary); font-size: 14px; }
.card ul li { padding: 6px 0; }
.card ul li::before { content: "✓ "; color: var(--accent-2); font-weight: 700; }

/* ---------- Forms ---------- */
.form-wrap {
    max-width: 420px;
    margin: 70px auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 34px;
}
.form-wrap h2 { margin-bottom: 26px; font-size: 24px; }
.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 7px; font-size: 14px; color: var(--text-secondary); }
.field input, .field select, .field textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: border-color .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.form-footer { margin-top: 20px; text-align: center; font-size: 14px; color: var(--text-secondary); }

.alert {
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 14px;
}
.alert-error { background: rgba(255,92,114,0.12); color: var(--danger); border: 1px solid rgba(255,92,114,0.3); }
.alert-success { background: rgba(46,204,113,0.12); color: var(--success); border: 1px solid rgba(46,204,113,0.3); }

/* ---------- Dashboard / Admin layout ---------- */
.dash-wrap { display: flex; min-height: 100vh; }
.sidebar {
    width: 240px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 24px 0;
    flex-shrink: 0;
}
.sidebar .logo { padding: 0 24px 24px; font-size: 20px; font-weight: 800; }
.sidebar a {
    display: block;
    padding: 13px 24px;
    color: var(--text-secondary);
    font-size: 14.5px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all .15s;
}
.sidebar a:hover, .sidebar a.active {
    color: var(--text-primary);
    background: var(--bg-card);
    border-left-color: var(--accent);
}
.main-content { flex: 1; padding: 32px 40px; overflow-x: auto; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.page-header h1 { font-size: 26px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 32px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.stat-card .label { color: var(--text-secondary); font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }
.stat-card .value { font-size: 30px; font-weight: 800; margin-top: 8px; }

table { width: 100%; border-collapse: collapse; background: var(--bg-card); border-radius: var(--radius); overflow: hidden; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
th { background: var(--bg-secondary); color: var(--text-secondary); font-weight: 600; text-transform: uppercase; font-size: 12px; letter-spacing: .4px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-card-hover); }

.badge { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-active, .badge-enabled, .badge-paid { background: rgba(46,204,113,0.15); color: var(--success); }
.badge-disabled, .badge-expired, .badge-failed { background: rgba(255,92,114,0.15); color: var(--danger); }
.badge-pending { background: rgba(255,182,72,0.15); color: var(--warning); }

.toolbar { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }

.playlist-link-box {
    background: var(--bg-secondary);
    border: 1px dashed var(--accent);
    border-radius: var(--radius-sm);
    padding: 16px;
    font-family: monospace;
    font-size: 13px;
    word-break: break-all;
    color: var(--accent-2);
}

.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    align-items: center; justify-content: center;
    z-index: 200;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    width: 420px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
}

footer { text-align: center; padding: 30px; color: var(--text-muted); font-size: 13px; border-top: 1px solid var(--border); }

@media (max-width: 768px) {
    .dash-wrap { flex-direction: column; }
    .sidebar { width: 100%; display: flex; overflow-x: auto; padding: 12px; }
    .sidebar .logo { display: none; }
    .sidebar a { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; }
    .main-content { padding: 20px; }
    .hero h1 { font-size: 32px; }
}


/* =============================================================
   v5 — განლაგება, ამინდი/კურსი, არხების ჩამოსაშლელი
   ============================================================= */

/* ---------- ტექსტების დაშორება / გადაბმის თავიდან აცილება ---------- */
body { overflow-wrap: anywhere; word-break: normal; }
h1, h2, h3, h4 { line-height: 1.3; }
p { line-height: 1.7; }
.muted { color: var(--text-secondary); }
.section-title { text-align: center; font-size: 30px; margin: 0 0 10px; }
.section-sub { text-align: center; color: var(--text-secondary); margin: 0 auto 8px; max-width: 560px; }
.hero { padding: 90px 20px 70px; }
.hero h1 { line-height: 1.2; }
.hero p { line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.btn-block { width: 100%; }
.pkg-desc { color: var(--text-secondary); font-size: 14px; margin: 6px 0 4px; }
.card ul li { line-height: 1.5; padding: 7px 0; }
.card .price { line-height: 1.2; }
.card .price small { display: inline-block; margin-left: 4px; }

.navbar { gap: 14px; flex-wrap: wrap; }
.navbar nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 22px; }
.navbar nav a { margin-left: 0; white-space: nowrap; }
.navbar nav span { margin-right: 0 !important; }

/* ---------- ამინდი / ვალუტა ---------- */
.info-section { padding-top: 40px; padding-bottom: 20px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; align-items: stretch; }
.info-card { padding: 24px; }
.info-card:hover { transform: none; }
.info-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 18px; }
.info-head h3 { margin: 0; font-size: 19px; }
.info-sub { font-size: 12px; color: var(--text-muted); }
.info-head select {
    background: var(--bg-secondary); color: var(--text-primary); border: 1px solid var(--border);
    border-radius: 8px; padding: 8px 12px; font-size: 14px; max-width: 100%;
}
.info-loading { color: var(--text-secondary); font-size: 14px; padding: 18px 0; text-align: center; }

.w-now { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.w-icon { font-size: 54px; line-height: 1; }
.w-temp { font-size: 40px; font-weight: 800; line-height: 1.1; }
.w-desc { color: var(--text-secondary); font-size: 14px; margin-top: 2px; }
.w-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--text-secondary); font-size: 13px; margin-bottom: 18px; }
.w-days { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.w-day { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 10px; padding: 10px 4px; text-align: center; min-width: 0; }
.w-day-name { font-size: 12px; color: var(--text-secondary); }
.w-day-ic { font-size: 22px; margin: 4px 0; }
.w-day-t { font-size: 13px; }
.w-day-t span { color: var(--text-muted); }

.r-list { display: flex; flex-direction: column; }
.r-list.scroll { max-height: 340px; overflow-y: auto; padding-right: 4px; }
.r-row {
    display: grid; grid-template-columns: 78px 1fr auto auto; align-items: center; gap: 8px 12px;
    padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px;
}
.r-row:last-child { border-bottom: none; }
.r-code { font-weight: 700; white-space: nowrap; }
.r-name { color: var(--text-secondary); font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-val { font-weight: 700; white-space: nowrap; }
.r-diff { font-size: 12px; white-space: nowrap; color: var(--text-muted); min-width: 70px; text-align: right; }
.r-diff.up { color: var(--success); }
.r-diff.down { color: var(--danger); }
.link-btn { background: none; border: none; color: var(--accent-2); font-size: 14px; cursor: pointer; margin-top: 12px; padding: 4px 0; }

/* ---------- პაკეტის არხების ჩამოსაშლელი ---------- */
.card ul li.ch-li::before { content: "▸ "; }
.ch-link {
    background: none; border: none; padding: 0; cursor: pointer; font: inherit;
    color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px;
}
.ch-overlay {
    position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.65);
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.ch-overlay[hidden] { display: none; }
.ch-modal {
    width: 100%; max-width: 520px; max-height: 86vh; display: flex; flex-direction: column;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow);
}
.ch-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 24px 14px; }
.ch-modal-head h3 { margin: 0; font-size: 22px; }
.ch-close { background: none; border: none; color: var(--text-secondary); font-size: 22px; cursor: pointer; padding: 6px 10px; line-height: 1; }
.ch-close:hover { color: var(--text-primary); }
.ch-list { overflow-y: auto; padding: 0 20px 20px; display: flex; flex-direction: column; gap: 10px; -webkit-overflow-scrolling: touch; }
.ch-item {
    display: flex; align-items: center; gap: 14px; padding: 10px 12px;
    background: var(--bg-primary); border: 1px solid var(--border); border-radius: 14px; flex-shrink: 0;
}
.ch-logo {
    width: 44px; height: 44px; flex-shrink: 0; border-radius: 10px; background: #fff;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.ch-logo img { width: 100%; height: 100%; object-fit: contain; }
.ch-ph { font-size: 20px; }
.ch-name { font-size: 15px; font-weight: 500; line-height: 1.4; min-width: 0; }
body.no-scroll { overflow: hidden; }

@media (max-width: 640px) {
    .navbar { padding: 12px 16px; }
    .navbar .logo { font-size: 19px; }
    .navbar nav { gap: 6px 16px; }
    .navbar nav a { font-size: 14px; }
    .hero { padding: 56px 18px 44px; }
    .hero h1 { font-size: 30px; }
    .hero p { font-size: 16px; }
    .section-title { font-size: 25px; }
    .container { padding: 0 16px; }
    .grid { padding: 28px 0 50px; gap: 18px; }
    .card { padding: 24px 20px; }
    .info-card { padding: 20px 16px; }
    .r-row { grid-template-columns: 64px 1fr auto; }
    .r-name { display: none; }
    .w-temp { font-size: 34px; }
    .form-wrap { margin: 30px 16px; padding: 28px 20px; }
}
