/* ====== Reset پایه ====== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    width: 100%;
}

/* ====== بدنه و بک‌گراند کلی ====== */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
        "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top, #0f172a 0%, #020617 40%, #000000 100%);
    color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* ====== لایه اصلی ====== */
main {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* p5.js canvas پس‌زمینه */
main canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
    z-index: 1;
}

/* ====== پنل گلس‌مورفیک ====== */
.content.home {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 420px;
    max-height: 100%;
    padding: 16px 18px 18px;
    border-radius: 18px;
    background:
        linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.82));
    border: 1px solid rgba(148, 163, 184, 0.6);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.9),
        0 0 0 1px rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(18px);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: none;
    scrollbar-color: rgba(148, 163, 184, 0.7) transparent;
}

/* اسکرول‌بار برای وب‌کیت */
.content.home::-webkit-scrollbar {
    width: 6px;
}
.content.home::-webkit-scrollbar-track {
    background: transparent;
}
.content.home::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.8);
    border-radius: 999px;
}

/* ====== تیتر و جداکننده ====== */
.content.home h1 {
    font-size: 20px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

.content.home hr {
    width: 90%;
    margin: 8px auto;
    border: none;
    border-top: 1px solid rgba(51, 65, 85, 0.9);
}

/* ====== نوار اکشن بالایی ====== */
.action_bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
}

/* ====== دکمه‌ها ====== */
.btn,
.logout,
.setup,
#clear-site-cache {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition:
        background 0.16s ease,
        border-color 0.16s ease,
        color 0.16s ease,
        transform 0.08s ease,
        box-shadow 0.16s ease;
    white-space: nowrap;
}

.btn:active,
.logout:active,
.setup:active,
#clear-site-cache:active {
    transform: translateY(1px) scale(0.99);
}

/* Logout / Setup */
.logout,
.setup {
    background: linear-gradient(135deg, #0ea5e9, #0369a1);
    border-color: rgba(56, 189, 248, 0.85);
    color: #e0f2fe;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.7);
}
.logout:hover,
.setup:hover {
    background: linear-gradient(135deg, #0369a1, #0f766e);
}

/* دکمه‌های فرم وبهوک */
.btn-primary {
    background: linear-gradient(135deg, #22c55e, #15803d);
    border-color: rgba(34, 197, 94, 0.9);
    color: #ecfdf5;
    box-shadow: 0 10px 24px rgba(22, 163, 74, 0.4);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #16a34a, #166534);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    border-color: rgba(248, 113, 113, 0.95);
    color: #fef2f2;
    box-shadow: 0 10px 24px rgba(248, 113, 113, 0.4);
}
.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #991b1b);
}

.btn-ghost,
#clear-site-cache {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.7);
    color: #e5e7eb;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.7);
    margin: 8px auto 0;
}
.btn-ghost:hover,
#clear-site-cache:hover {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 64, 175, 0.7));
}

/* ====== نوتیفیکیشن‌ها ====== */
.notice {
    width: 90%;
    margin: 10px auto 0;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
    border: 1px solid rgba(148, 163, 184, 0.5);
    text-align: left;
}

.notice-success {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.3), rgba(21, 128, 61, 0.25));
    border-color: rgba(34, 197, 94, 0.9);
    color: #bbf7d0;
}

.notice-error {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.3), rgba(127, 29, 29, 0.3));
    border-color: rgba(248, 113, 113, 0.9);
    color: #fecaca;
}

.notice-info {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.3), rgba(30, 64, 175, 0.25));
    border-color: rgba(96, 165, 250, 0.9);
    color: #bfdbfe;
}

/* ====== سکشن‌ها (Bot info / Webhook / Form / Debug) ====== */
.content.home section {
    width: 90%;
    margin: 14px auto 0;
    padding: 10px 12px;
    border-radius: 14px;
    background: radial-gradient(circle at top left,
        rgba(15, 23, 42, 0.96) 0%,
        rgba(15, 23, 42, 0.88) 45%,
        rgba(15, 23, 42, 0.9) 100%);
    border: 1px solid rgba(30, 64, 175, 0.7);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.7);
    text-align: left;
}

/* تیتر هر سکشن */
.content.home section h2 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #e5e7eb;
}

/* لیست‌های داخلی */
.content.home section ul {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 13px;
}
.content.home section li {
    margin-bottom: 4px;
    line-height: 1.6;
}

/* متن خنثی */
.muted {
    font-size: 13px;
    color: #9ca3af;
}

/* کد / URL */
.content.home code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
    background: rgba(15, 23, 42, 0.95);
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid rgba(30, 64, 175, 0.9);
    color: #e0f2fe;
}

/* ====== فرم ست‌وبهوک ====== */
#webhook-form {
    margin-top: 4px;
    font-size: 13px;
}

.field {
    margin-bottom: 10px;
}

.field label {
    display: block;
    margin-bottom: 4px;
    color: #cbd5f5;
}

/* اینپوت‌ها */
#webhook-form input[type="text"],
#webhook-form input[type="number"] {
    width: 100%;
    padding: 6px 8px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.8);
    background: rgba(15, 23, 42, 0.96);
    color: #e5e7eb;
    font-size: 13px;
    outline: none;
    transition:
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        background 0.16s ease;
}

#webhook-form input[type="text"]:focus,
#webhook-form input[type="number"]:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.45);
    background: rgba(15, 23, 42, 0.99);
}

/* allowed_updates */
#webhook-form fieldset {
    border: none;
    margin: 8px 0 10px;
    padding: 0;
}

#webhook-form legend {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #e5e7eb;
}

#webhook-form label {
    cursor: pointer;
}

#webhook-form input[type="checkbox"] {
    margin-right: 6px;
    accent-color: #22c55e;
    cursor: pointer;
}

/* ====== Raw Debug (details / pre) ====== */
.content.home section details {
    margin-top: 4px;
}

.content.home section summary {
    cursor: pointer;
    font-size: 13px;
    color: #cbd5f5;
    list-style: none;
}

.content.home section summary::-webkit-details-marker {
    display: none;
}

.content.home section pre {
    margin-top: 6px;
    padding: 8px 10px;
    border-radius: 12px;
    background:
        radial-gradient(circle at top,
            #020617ff 0%,
            #020617f0 40%,
            #020617eb 100%);
    border: 1px solid rgba(30, 64, 175, 0.9);
    color: #e5e7eb;
    font-size: 11px;
    line-height: 1.5;
    max-height: 220px;
    overflow: auto;
}

/* ====== Client Info (پایین پنل) ====== */
.client-info {
    width: 90%;
    margin: 12px auto 4px;
    padding: 8px 10px;
    border-radius: 12px;
    background: linear-gradient(135deg,
        rgba(15, 23, 42, 0.96),
        rgba(15, 23, 42, 0.9));
    border: 1px solid rgba(148, 163, 184, 0.7);
    font-size: 12px;
    line-height: 1.6;
}

.client-info h2 {
    font-size: 13px;
    margin-bottom: 4px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.client-info ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.client-info li {
    margin-bottom: 3px;
}

/* ====== ریسپانسیو ====== */
@media (min-width: 640px) {
    .content.home {
        max-width: 440px;
        padding: 18px 20px 20px;
    }
}

@media (min-width: 1024px) {
    .content.home {
        max-width: 480px;
    }
}
