/* ═══════════════════════════════════════════════════════════
   KOUROSH VIP — Imperial Crimson & Gold Luxury Theme
   ═══════════════════════════════════════════════════════════ */

:root {
    --gold-primary: #d4af37;
    --gold-light: #f9e79f;
    --gold-dark: #aa771c;
    --gold-glow: rgba(212, 175, 55, 0.45);
    --gold-border: rgba(212, 175, 55, 0.28);
    --gold-gradient: linear-gradient(135deg, #bf953f 0%, #fcf6ba 25%, #b38728 50%, #fbf5b7 75%, #aa771c 100%);
    --gold-gradient-soft: linear-gradient(135deg, #d4af37, #f39c12);

    --crimson-dark: #220104;
    --crimson-primary: #380307;
    --crimson-rich: #52060c;
    --crimson-glow: rgba(139, 14, 25, 0.35);

    --accent: var(--gold-primary);
    --accent-rgb: 212, 175, 55;
    --accent-hover: #e5c158;
    --accent-glow: var(--gold-glow);
    --gradient-1: var(--gold-gradient);
    --gradient-2: linear-gradient(135deg, #aa771c, #d4af37);
}

/* ─── Dark Theme (Primary Imperial Theme) ─── */
[data-bs-theme="dark"] {
    --bg-primary: #240205;
    --bg-secondary: #320307;
    --bg-card: rgba(45, 4, 8, 0.78);
    --bg-card-hover: rgba(65, 7, 13, 0.9);
    --glass-bg: rgba(36, 3, 6, 0.85);
    --glass-border: rgba(212, 175, 55, 0.28);
    --text-primary: #fff8f0;
    --text-secondary: #d6b8b8;
    --shadow-card: 0 12px 35px rgba(0, 0, 0, 0.65);
    --shadow-glow: 0 0 25px rgba(212, 175, 55, 0.2);
}

/* ─── Light Theme (Royal Amber & Cream) ─── */
[data-bs-theme="light"] {
    --bg-primary: #faf5eb;
    --bg-secondary: #f3ebd9;
    --bg-card: rgba(255, 253, 248, 0.9);
    --bg-card-hover: rgba(255, 255, 255, 0.98);
    --glass-bg: rgba(250, 245, 235, 0.88);
    --glass-border: rgba(170, 119, 28, 0.3);
    --text-primary: #2d0407;
    --text-secondary: #632328;
    --shadow-card: 0 10px 30px rgba(77, 5, 10, 0.08);
    --shadow-glow: 0 0 20px rgba(212, 175, 55, 0.15);
}

/* ─── Base ─── */
* {
    font-family: 'Vazirmatn', sans-serif;
    box-sizing: border-box;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.4s ease, color 0.4s ease;
}

[data-bs-theme="dark"] body {
    background-color: #200103;
    background-image:
        radial-gradient(ellipse at 50% 12%, rgba(139, 14, 25, 0.5) 0%, transparent 60%),
        radial-gradient(circle at 15% 75%, rgba(197, 155, 39, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(92, 6, 13, 0.4) 0%, transparent 45%);
    background-attachment: fixed;
}

[data-bs-theme="light"] body {
    background-color: #faf5eb;
    background-image:
        radial-gradient(ellipse at 50% 10%, rgba(212, 175, 55, 0.15) 0%, transparent 60%),
        radial-gradient(circle at 85% 80%, rgba(92, 6, 13, 0.05) 0%, transparent 40%);
    background-attachment: fixed;
}

.text-accent, .text-gold {
    color: var(--gold-primary) !important;
}

.gold-gradient-text {
    background: linear-gradient(135deg, #d4af37 0%, #fdfc47 30%, #e5c158 50%, #d4af37 80%, #aa771c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 25px rgba(212, 175, 55, 0.35);
}

/* ─── Glass Navbar ─── */
.glass-navbar {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    padding: 0.75rem 0;
}

.brand-icon-img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--gold-primary);
    box-shadow: 0 0 15px var(--gold-glow);
    object-fit: cover;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.brand-icon-img:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 22px rgba(212, 175, 55, 0.7);
}

.brand-text {
    font-family: 'Cinzel', 'Vazirmatn', serif;
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 2px;
    color: var(--text-primary);
}

.brand-text .text-accent {
    color: var(--gold-primary) !important;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

/* ─── Hero Section ─── */
.hero-section {
    padding: 2rem 0 1rem;
}

.kourosh-hero-badge {
    width: 125px;
    height: 125px;
    border-radius: 50%;
    border: 3px solid var(--gold-primary);
    box-shadow: 0 0 35px rgba(212, 175, 55, 0.5), inset 0 0 20px rgba(212, 175, 55, 0.2);
    padding: 5px;
    background: radial-gradient(circle, #5e0811 0%, #200103 100%);
    object-fit: cover;
    margin-bottom: 1.25rem;
    animation: goldPulse 4s infinite ease-in-out;
}

@keyframes goldPulse {
    0%, 100% {
        box-shadow: 0 0 25px rgba(212, 175, 55, 0.4), inset 0 0 15px rgba(212, 175, 55, 0.2);
        border-color: #d4af37;
    }
    50% {
        box-shadow: 0 0 45px rgba(212, 175, 55, 0.75), inset 0 0 25px rgba(212, 175, 55, 0.35);
        border-color: #fdfc47;
    }
}

.kourosh-title {
    font-family: 'Cinzel', 'Vazirmatn', serif;
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 6px;
    margin-bottom: 0.5rem;
}

/* ─── Gold Divider ─── */
.gold-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 0.75rem auto 1.5rem;
    max-width: 480px;
}

.gold-divider::before,
.gold-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #d4af37, #fdfc47, #d4af37, transparent);
}

.gold-divider span {
    color: #d4af37;
    font-size: 1.2rem;
    text-shadow: 0 0 12px rgba(212, 175, 55, 0.8);
    transform: scale(1.1);
}

/* ─── Glass Cards ─── */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    box-shadow: var(--shadow-card);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(212, 175, 55, 0.55);
    box-shadow: var(--shadow-card), 0 0 25px rgba(212, 175, 55, 0.2);
    transform: translateY(-3px);
}

/* ─── Config Cards ─── */
.config-card {
    position: relative;
    overflow: hidden;
}

.config-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gold-gradient);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.config-card:hover::before {
    opacity: 1;
}

.config-card.online {
    border-color: rgba(46, 204, 113, 0.4);
}

.config-card.offline {
    border-color: rgba(214, 48, 49, 0.4);
}

/* ─── Server Info ─── */
.server-info {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(212, 175, 55, 0.12);
    border-radius: 12px;
    padding: 0.85rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.08);
}

.info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-row:first-child {
    padding-top: 0;
}

.info-label {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.info-value {
    font-size: 0.88rem;
    font-weight: 500;
    direction: ltr;
}

/* ─── Protocol Badges (Gold/Metallic) ─── */
.bg-protocol-vless {
    background: linear-gradient(135deg, #aa771c, #f39c12) !important;
    color: #000 !important;
    font-weight: 700;
}
.bg-protocol-vmess {
    background: var(--gold-gradient) !important;
    color: #220104 !important;
    font-weight: 700;
}
.bg-protocol-trojan {
    background: linear-gradient(135deg, #8b101e, #d4af37) !important;
    color: #fff !important;
    font-weight: 700;
}
.bg-protocol-shadowsocks {
    background: linear-gradient(135deg, #700a12, #aa771c) !important;
    color: #fff !important;
    font-weight: 700;
}

/* ─── Status Badges ─── */
.status-online .badge {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.status-offline .badge {
    background: linear-gradient(135deg, #b91c1c, #7f1d1d) !important;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 0 12px rgba(185, 28, 28, 0.4);
}

.status-testing .badge {
    background: linear-gradient(135deg, #d4af37, #f39c12) !important;
    color: #000;
    font-weight: 700;
}

/* ─── Buttons ─── */
.btn-primary-custom {
    background: var(--gold-gradient);
    border: none;
    color: #220104;
    font-weight: 700;
    box-shadow: 0 4px 18px var(--gold-glow);
    transition: all 0.3s ease;
}

.btn-primary-custom:hover {
    background: linear-gradient(135deg, #fcf6ba 0%, #bf953f 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(212, 175, 55, 0.6);
    color: #000;
}

.btn-outline-accent {
    border-color: var(--gold-primary);
    color: var(--gold-primary);
}

.btn-outline-accent:hover {
    background: var(--gold-primary);
    color: #220104;
    font-weight: 700;
    box-shadow: 0 4px 15px var(--gold-glow);
}

/* ─── Telegram & Community Buttons ─── */
.btn-telegram-bot {
    background: var(--gold-gradient);
    color: #220104 !important;
    font-weight: 800;
    border: 1px solid var(--gold-primary);
    box-shadow: 0 4px 18px var(--gold-glow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    font-size: 1.05rem;
}

.btn-telegram-bot:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 28px rgba(212, 175, 55, 0.7);
    color: #000 !important;
    background: linear-gradient(135deg, #fcf6ba 0%, #bf953f 100%);
}

.btn-telegram-channel {
    background: rgba(34, 1, 4, 0.65);
    color: var(--gold-primary) !important;
    font-weight: 800;
    border: 1.5px solid var(--gold-primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    font-size: 1.05rem;
}

.btn-telegram-channel:hover {
    background: var(--gold-primary);
    color: #220104 !important;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 24px var(--gold-glow);
}

.btn-gold {
    background: var(--gold-gradient);
    color: #220104 !important;
    font-weight: 700;
    border: none;
    transition: all 0.3s ease;
}

.btn-gold:hover {
    box-shadow: 0 0 15px var(--gold-glow);
    transform: translateY(-1px);
    color: #000 !important;
}

.btn-outline-gold {
    border: 1px solid var(--gold-primary);
    color: var(--gold-primary) !important;
    background: transparent;
    transition: all 0.3s ease;
}

.btn-outline-gold:hover {
    background: var(--gold-primary);
    color: #220104 !important;
    box-shadow: 0 0 15px var(--gold-glow);
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--gold-primary);
}

/* ─── Glass Input ─── */
.glass-input {
    background: rgba(0, 0, 0, 0.35) !important;
    border: 1px solid var(--gold-border) !important;
    color: var(--text-primary) !important;
    border-radius: 12px !important;
    padding: 0.75rem 1rem !important;
    transition: all 0.3s ease;
}

.glass-input:focus {
    border-color: var(--gold-primary) !important;
    box-shadow: 0 0 0 3px var(--gold-glow) !important;
}

.glass-input::placeholder {
    color: var(--text-secondary) !important;
    opacity: 0.6;
}

/* ─── Stats Cards ─── */
.stat-card {
    border-radius: 16px;
    border: 1px solid var(--gold-border);
}

.stat-card h3, .stat-card h2 {
    font-weight: 800;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ─── Theme Toggle Button ─── */
#themeToggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50% !important;
    border: 1px solid var(--gold-border) !important;
    background: var(--bg-card);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

#themeToggle:hover {
    background: var(--bg-card-hover);
    transform: scale(1.08);
    box-shadow: 0 0 16px var(--gold-glow);
    border-color: var(--gold-primary) !important;
}

#themeIcon svg {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#themeToggle:hover #themeIcon svg {
    transform: rotate(25deg);
}

/* ─── Spinner for Testing ─── */
.spinner-test {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border .75s linear infinite;
    vertical-align: middle;
}

/* ─── Footer ─── */
.glass-footer {
    background: var(--glass-bg);
    border-top: 1px solid var(--gold-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ─── Tables ─── */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    border-color: rgba(212, 175, 55, 0.15);
}

.table th {
    font-weight: 700;
    color: var(--gold-primary);
    border-bottom-width: 2px;
}

.table tr:hover td {
    background: rgba(212, 175, 55, 0.05);
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #180103;
}
::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.6);
}
