@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@600;800&family=Poppins:wght@400;600&family=Roboto:wght@400;500;700&display=swap');

:root {
    --bg-dark: #1e1f22;
    --bg-primary: #313338;
    --bg-secondary: #2b2d31;
    --bg-tertiary: #232428;
    --bg-hover: #35373c;
    --bg-active: #404249;
    --text-primary: #f2f3f5;
    --text-secondary: #b5bac1;
    --text-muted: #949ba4;
    --brand-purple: #5865f2;
    --brand-purple-hover: #4752c4;
    --brand-green: #23a55a;
    --brand-green-hover: #1a7d44;
    --brand-orange: #f0b232;
    --divider: #3f4147;
    --card-bg: #2b2d31;
    --danger: #da373c;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* === NAV === */
.landing-nav, .dash-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    border-bottom: 1px solid var(--divider);
    background: rgba(30, 31, 34, 0.9);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 20px;
    font-family: 'Outfit', sans-serif;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-support-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    border: 1px solid var(--divider);
    transition: all 0.2s;
}
.nav-support-btn:hover {
    background: rgba(88, 101, 242, 0.2);
    border-color: var(--brand-purple);
    color: #fff;
}

.header-support-link {
    margin-right: 8px;
}

.nav-login-btn {
    background: var(--brand-purple);
    color: white;
    padding: 8px 22px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s, transform 0.2s;
}
.nav-login-btn:hover {
    background: var(--brand-purple-hover);
    transform: translateY(-1px);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.logout-btn {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}
.logout-btn:hover {
    color: var(--danger);
    background: rgba(218, 55, 60, 0.12);
}

/* === HERO === */
.hero {
    text-align: center;
    padding: 90px 24px 60px;
    max-width: 840px;
    margin: 0 auto;
}

.hero-badge-glow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    color: #000000;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 24px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.6), 0 0 40px rgba(88, 101, 242, 0.4);
    animation: pulse-glow 2s infinite alternate;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background: #23a55a;
    border-radius: 50%;
    box-shadow: 0 0 8px #23a55a;
}

@keyframes pulse-glow {
    0% { transform: scale(1); box-shadow: 0 0 15px rgba(255, 255, 255, 0.5); }
    100% { transform: scale(1.04); box-shadow: 0 0 30px rgba(255, 255, 255, 0.9), 0 0 50px rgba(88, 101, 242, 0.6); }
}

.hero h1 {
    font-size: clamp(38px, 6vw, 64px);
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #b5bac1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 19px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 36px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--brand-purple);
    color: white;
    padding: 16px 36px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 700;
    font-size: 17px;
    transition: all 0.3s;
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.4);
}
.hero-btn:hover {
    background: var(--brand-purple-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(88, 101, 242, 0.6);
}

/* === FEATURES === */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    max-width: 1040px;
    margin: 0 auto;
    padding: 40px 24px 60px;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--divider);
    border-radius: 16px;
    padding: 32px 24px;
    text-align: left;
    transition: all 0.3s;
}
.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--brand-purple);
    box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}

.feature-icon {
    font-size: 38px;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 20px;
    font-family: 'Outfit', sans-serif;
    margin-bottom: 10px;
}

.feature-card p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* === SUPPORT THE PROJECT SECTION === */
.support-section {
    max-width: 900px;
    margin: 40px auto 80px;
    padding: 0 24px;
}

.support-container {
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.12) 0%, rgba(35, 165, 90, 0.08) 100%);
    border: 1px solid rgba(88, 101, 242, 0.3);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
}

.support-container h2 {
    font-size: 28px;
    font-family: 'Outfit', sans-serif;
    margin-bottom: 16px;
}

.support-text {
    font-size: 16px;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.support-subtext {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 28px;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.support-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-patreon, .btn-paypal {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 26px;
    border-radius: 24px;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.2s;
}

.btn-patreon {
    background: #FF424D;
    color: white;
}
.btn-patreon:hover {
    background: #e0303b;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 66, 77, 0.4);
}

.btn-paypal {
    background: #0070BA;
    color: white;
}
.btn-paypal:hover {
    background: #005ea6;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 112, 186, 0.4);
}

/* === FOOTER === */
.landing-footer {
    text-align: center;
    padding: 32px 24px;
    border-top: 1px solid var(--divider);
    color: var(--text-muted);
    font-size: 14px;
}
.landing-footer a {
    color: var(--brand-purple);
    text-decoration: none;
    font-weight: 600;
}

/* === DASHBOARD === */
.dash-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 36px 28px;
}

.dashboard-grid-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 520px;
    gap: 32px;
    margin-top: 24px;
    align-items: start;
}

@media (max-width: 1100px) {
    .dash-main { max-width: 100%; }
    .dashboard-grid-layout { grid-template-columns: 1fr; }
}

.config-section {
    background: var(--card-bg);
    border: 1px solid var(--divider);
    border-radius: 16px;
    padding: 24px 28px;
    margin-bottom: 28px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.config-section h2 {
    font-size: 20px;
    font-family: 'Outfit', sans-serif;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.section-desc {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

.theme-controls-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 640px) {
    .theme-controls-grid { grid-template-columns: 1fr; }
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-group select, .control-group input[type="text"], .control-group input[type="range"] {
    background: var(--bg-tertiary);
    border: 1px solid var(--divider);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.control-group select:focus, .control-group input[type="text"]:focus {
    border-color: var(--brand-purple);
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.25);
}

.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-picker-wrapper input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    cursor: pointer;
    background: none;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-picker-wrapper input[type="color"]::-webkit-color-swatch { border: 1px solid var(--divider); border-radius: 10px; }

.dash-preview-sticky {
    position: sticky;
    top: 90px;
    background: #111214;
    border: 1px solid var(--divider);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.6);
}

.preview-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.preview-header-bar h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.preview-frame-wrapper {
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    background: #000;
    box-shadow: inset 0 0 12px rgba(0,0,0,0.8);
}

.preview-frame-wrapper iframe {
    width: 100%;
    height: 560px;
    border: none;
    display: block;
}


.dash-header {
    margin-bottom: 32px;
}
.dash-header h1 {
    font-size: 32px;
    font-family: 'Outfit', sans-serif;
    margin-bottom: 6px;
}
.dash-header p {
    color: var(--text-muted);
    font-size: 15px;
}

.back-btn {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
    display: inline-block;
    transition: color 0.2s;
}
.back-btn:hover { color: var(--text-primary); }

.server-header-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
}
.server-config-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
}

/* === SERVER GRID & BADGE FIX === */
.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.server-card {
    background: var(--card-bg);
    border: 1px solid var(--divider);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s;
}
.server-card:hover {
    border-color: rgba(88, 101, 242, 0.5);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

.server-card-icon img {
    width: 52px;
    height: 52px;
    border-radius: 14px;
}
.server-card-initial {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--bg-active);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
}

.server-card-info {
    flex: 1;
    min-width: 0;
}
.server-card-info h3 {
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}

.badge-wrapper {
    display: inline-block;
}

.badge {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
    display: inline-block;
}
.badge-green { background: rgba(35, 165, 90, 0.2); color: var(--brand-green); border: 1px solid rgba(35, 165, 90, 0.3); }
.badge-orange { background: rgba(240, 178, 50, 0.2); color: var(--brand-orange); border: 1px solid rgba(240, 178, 50, 0.3); }

.btn {
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-primary { background: var(--brand-purple); color: white; }
.btn-primary:hover { background: var(--brand-purple-hover); }
.btn-green { background: var(--brand-green); color: white; }
.btn-green:hover { background: var(--brand-green-hover); }

/* === THEME CONTROLS GRID === */
.theme-controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.control-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.control-group select, .control-group input[type="text"] {
    background: var(--bg-dark);
    border: 1px solid var(--divider);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border 0.2s;
}
.control-group select:focus, .control-group input[type="text"]:focus {
    border-color: var(--brand-purple);
}

.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}
.color-picker-wrapper input[type="color"] {
    width: 44px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
}
.color-picker-wrapper input[type="text"] {
    flex: 1;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}
.toggle-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* === CONFIG SECTIONS === */
.config-section {
    background: var(--card-bg);
    border: 1px solid var(--divider);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 24px;
}

.border-danger-glow {
    border: 1px solid rgba(218, 55, 60, 0.4);
    background: linear-gradient(135deg, rgba(218, 55, 60, 0.05) 0%, rgba(43, 45, 49, 1) 100%);
}

.backup-actions-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.backup-status-box {
    background: var(--bg-dark);
    border: 1px solid var(--divider);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.config-section h2 {
    font-size: 20px;
    font-family: 'Outfit', sans-serif;
    margin-bottom: 6px;
}
.section-desc {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

/* === CHANNEL TOGGLES === */
.channels-list {
    max-height: 380px;
    overflow-y: auto;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.channel-toggle-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    background: rgba(0,0,0,0.15);
    transition: background 0.15s;
}
.channel-toggle-item:hover { background: var(--bg-hover); }

.channel-toggle-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
}
.channel-toggle-cat {
    font-size: 12px;
    color: var(--text-muted);
    margin-right: 16px;
}

/* Toggle Switch */
.toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #4e5058;
    border-radius: 12px;
    transition: 0.3s;
}
.toggle-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}
.toggle input:checked + .toggle-slider { background: var(--brand-green); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

.save-btn {
    display: block;
    margin-left: auto;
    padding: 12px 28px;
    font-size: 15px;
}

/* === CODE BLOCK === */
.code-block {
    background: var(--bg-dark);
    border: 1px solid var(--divider);
    border-radius: 10px;
    padding: 20px;
    position: relative;
    overflow-x: auto;
}
.code-block code {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #00d26a;
    word-break: break-all;
}
.copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--brand-purple);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}
.copy-btn:hover { background: var(--brand-purple-hover); }

/* === PREVIEW === */
.preview-container {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--divider);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

/* === TOAST === */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-primary);
    border: 1px solid var(--divider);
    color: var(--text-primary);
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 9999;
}
.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1a1b1e; border-radius: 3px; }

/* === RESPONSIVE === */
@media (max-width: 680px) {
    .landing-nav, .dash-nav { padding: 12px 16px; }
    .hero { padding: 60px 16px 40px; }
    .server-grid { grid-template-columns: 1fr; }
    .server-card { flex-wrap: wrap; }
    .theme-controls-grid { grid-template-columns: 1fr; }
}


/* === CENTERED SERVER SELECTION GRID === */
.dash-header {
    text-align: center;
    margin-bottom: 40px;
}
.dash-header h1 {
    font-size: 34px;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--text-primary);
}
.dash-header p {
    color: var(--text-muted);
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto;
}

.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 360px));
    gap: 24px;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 40px;
}

.server-card {
    background: var(--card-bg);
    border: 1px solid var(--divider);
    border-radius: 16px;
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.25s ease;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.server-card:hover {
    border-color: var(--brand-purple);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(88, 101, 242, 0.25);
}

.server-card-icon img, .server-card-initial {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    flex-shrink: 0;
}

.server-card-info {
    flex: 1;
    min-width: 0;
}

.server-card-info h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.server-card-actions .btn {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    white-space: nowrap;
}


/* === VERTICAL SERVER CARD DESIGN (NO COLLISION) === */
.server-grid-centered {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 320px));
    gap: 28px;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 50px;
}

.server-card {
    background: #2b2d31;
    border: 1px solid #3f4147;
    border-radius: 18px;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    transition: all 0.25s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.server-card:hover {
    border-color: #5865f2;
    transform: translateY(-5px);
    box-shadow: 0 16px 40px rgba(88, 101, 242, 0.35);
}

.server-card-icon img, .server-card-initial {
    width: 68px;
    height: 68px;
    border-radius: 20px;
    object-fit: cover;
    margin: 0 auto;
}

.server-card-initial {
    background: #404249;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
}

.server-card-info {
    width: 100%;
}

.server-card-info h3 {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #f2f3f5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.server-card-actions {
    width: 100%;
    margin-top: 6px;
}

.server-card-actions .btn {
    width: 100%;
    display: block;
    text-align: center;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
