:root {
    --bg: #0b0e1a;
    --bg-dark: #060812;
    --accent: #00ff9d;
    --accent2: #00d4ff;
    --accent3: #7c9eff;
    --text: #e0f0ff;
    --text-dim: #a3bffa;
    --card: rgba(20, 25, 45, 0.65);
    --glow: 0 0 20px;
    --glow-intense: 0 0 40px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --header-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(145deg, var(--bg-dark) 0%, var(--bg) 100%);
    color: var(--text);
    min-height: 100dvh;
    overflow-x: hidden;
    width: 100%;
    position: relative;
    line-height: 1.6;
}

/* Desktop Layout (≥1025px) */
@media (min-width: 1025px) {
    body {
        padding: 0;
    }
}

/* Mobile Layout (≤1024px) */
@media (max-width: 1024px) {
    body {
        padding: 0.75rem;
    }
}

/* Custom Scrollbar */
@media (min-width: 768px) {
    ::-webkit-scrollbar {
        width: 8px;
    }

    ::-webkit-scrollbar-track {
        background: var(--bg-dark);
    }

    ::-webkit-scrollbar-thumb {
        background: linear-gradient(var(--accent), var(--accent2));
        border-radius: 4px;
    }
}

/* Desktop Navbar - Only visible on large screens */
.navbar-desktop {
    position: fixed;
    inset: 0 0 auto 0;
    padding: 0.9rem 5vw;
    background: rgba(8, 12, 30, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 255, 157, 0.16);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

@media (max-width: 1024px) {
    .navbar-desktop {
        display: none;
    }
}

.logo {
    font-family: 'Orbitron', monospace;
    font-size: clamp(1.4rem, 5vw, 1.8rem);
    font-weight: 800;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-decoration: none;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: clamp(1rem, 3vw, 1.8rem);
    align-items: center;
}

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 500;
    font-size: clamp(0.8rem, 3vw, 0.95rem);
    transition: all 0.22s;
    padding: 0.3rem 0.5rem;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent);
    text-shadow: 0 0 12px var(--accent);
}

.btn-small {
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    color: #0b1121 !important;
    padding: 0.4rem 1rem;
    border-radius: 50vmax;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: var(--glow) rgba(0, 255, 157, 0.45);
}

/* Sidebar Toggle Button - Only visible on mobile (≤1024px) */
.sidebar-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1100;
    background: var(--card);
    border: 1px solid var(--accent2);
    color: var(--accent2);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    box-shadow: var(--glow) var(--accent2);
}

@media (max-width: 1024px) {
    .sidebar-toggle {
        display: flex;
    }
}

/* Sidebar Navigation - Only visible on mobile (≤1024px) */
.admin-sidebar {
    display: none;
}

@media (max-width: 1024px) {
    .admin-sidebar {
        display: block;
        position: fixed;
        top: 1rem;
        left: 1rem;
        transform: translateX(-120%);
        opacity: 0;
        width: 260px;
        background: rgba(8, 12, 24, 0.98);
        backdrop-filter: blur(16px);
        border: 1px solid var(--accent2);
        border-radius: 2rem;
        padding: 1.5rem 0.8rem;
        transition: transform 0.3s, opacity 0.2s;
        z-index: 2000;
        box-shadow: var(--glow-intense) var(--accent2);
    }

    .admin-sidebar.open {
        transform: translateX(0);
        opacity: 1;
    }
}

.admin-sidebar .sidebar-logo {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(90deg, var(--accent2), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0 0.5rem 1.2rem 0.5rem;
    border-bottom: 1px solid var(--accent2);
    margin-bottom: 1.2rem;
}

.admin-sidebar .sidebar-logo i {
    color: var(--accent2);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 1rem;
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 500;
    border-radius: 2rem;
    transition: 0.2s;
    font-size: 0.95rem;
}

.sidebar-nav a i {
    width: 1.5rem;
    font-size: 1.2rem;
    color: var(--accent2);
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(0, 212, 255, 0.15);
    color: var(--accent2);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 255, 157, 0.1);
    margin-top: 1.5rem;
}

.sidebar-footer .signup-link {
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    color: #0b1121;
    padding: 0.7rem 1rem;
    border-radius: 2rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 700;
    text-decoration: none;
}

.sidebar-footer .logout-link {
    background: linear-gradient(90deg,rgba(225, 62, 62, 0.81), red);
    color: #0b1121;
    padding: 0.7rem 1rem;
    border-radius: 2rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 700;
    text-decoration: none;
}

/* Main Content Container */
.main-container {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

/* Desktop padding for navbar */
@media (min-width: 1025px) {
    .main-container {
        padding-top: 80px;
    }
}

/* Mobile adjustments */
@media (max-width: 1024px) {
    .main-container {
        padding-top: 0.5rem;
    }
}

/* Back to Home */
.back-home {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-dim);
    text-decoration: none;
    margin: 1rem 0 0.5rem;
    font-size: 0.9rem;
    transition: all 0.3s;
    padding: 0.5rem 0;
}

@media (max-width: 1024px) {
    .back-home {
        margin-left: 3.5rem;
        margin-top: 0.5rem;
    }
}

@media (min-width: 1025px) {
    .back-home {
        margin-left: 0;
    }
}

.back-home:hover {
    color: var(--accent);
    transform: translateX(-5px);
}

/* Terms Container */
.terms-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 5vw 40px;
    width: 100%;
}

/* Header */
.terms-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.terms-header h1 {
    font-family: 'Orbitron', monospace;
    font-size: clamp(2rem, 8vw, 3rem);
    font-weight: 900;
    margin-bottom: 0.5rem;
}

.gradient-text {
    background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent3));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.last-updated {
    color: var(--text-dim);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.last-updated i {
    color: var(--accent);
}

/* Progress Bar */
.progress-container {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 999;
}

@media (max-width: 1024px) {
    .progress-container {
        display: none;
    }
}

.progress-bar {
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    width: 0%;
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 10px var(--accent);
}

/* Table of Contents */
.toc-card {
    background: var(--card);
    border-radius: 1.2rem;
    padding: 1.5rem;
    border: 1px solid rgba(0, 255, 157, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin-bottom: 2rem;
}

.toc-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.8rem;
}

.toc-item {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toc-item:hover {
    color: var(--accent);
    background: rgba(0, 255, 157, 0.05);
    transform: translateX(5px);
}

.toc-item i {
    font-size: 0.8rem;
    color: var(--accent2);
}

/* Terms Cards */
.terms-section {
    margin-bottom: 2rem;
    scroll-margin-top: 100px;
}

.terms-card {
    background: var(--card);
    border-radius: 1.2rem;
    padding: 1.8rem;
    border: 1px solid rgba(0, 255, 157, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s;
}

.terms-card:hover {
    border-color: rgba(0, 255, 157, 0.3);
    box-shadow: 0 0 30px rgba(0, 255, 157, 0.1);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 255, 157, 0.15);
}

.section-icon {
    width: 48px;
    height: 48px;
    background: rgba(0, 255, 157, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--accent);
    flex-shrink: 0;
}

.section-header h2 {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    color: var(--text);
}

.section-content {
    color: var(--text-dim);
    font-size: 1rem;
}

.section-content p {
    margin-bottom: 1rem;
}

.section-content p:last-child {
    margin-bottom: 0;
}

.section-content h3 {
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    margin: 1.5rem 0 1rem;
    color: var(--text);
}

.section-content h3:first-of-type {
    margin-top: 0;
}

.section-content ul,
.section-content ol {
    margin: 1rem 0 1.5rem 1.5rem;
}

.section-content li {
    margin-bottom: 0.5rem;
}

.section-content li::marker {
    color: var(--accent);
}

/* Highlight Box */
.highlight-box {
    background: rgba(0, 255, 157, 0.08);
    border-left: 4px solid var(--accent);
    padding: 1.2rem;
    border-radius: 0.8rem;
    margin: 1.5rem 0;
}

.highlight-box i {
    color: var(--accent);
    margin-right: 0.5rem;
}

.highlight-box strong {
    color: var(--text);
}

/* Table */
.terms-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.terms-table th {
    text-align: left;
    padding: 0.8rem;
    background: rgba(0, 255, 157, 0.1);
    color: var(--accent2);
    font-family: 'Orbitron', monospace;
    font-weight: 600;
    border-bottom: 2px solid var(--accent);
}

.terms-table td {
    padding: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.terms-table tr:hover td {
    background: rgba(0, 255, 157, 0.02);
}

/* Badge */
.badge {
    display: inline-block;
    background: rgba(0, 255, 157, 0.1);
    color: var(--accent);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
    border: 1px solid rgba(0, 255, 157, 0.3);
}

/* Divider */
.divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    margin: 2rem 0;
}

/* Action Buttons */
.terms-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 3rem 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 2rem;
    border-radius: 50vmax;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.28s ease;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    color: #0b1121;
    box-shadow: var(--glow) rgba(0, 255, 157, 0.45);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 255, 157, 0.35);
}

.btn-outline {
    border: 1.5px solid var(--accent);
    color: var(--accent);
    background: transparent;
}

.btn-outline:hover {
    background: rgba(0, 255, 157, 0.08);
}

/* Acceptance Card */
.acceptance-card {
    background: linear-gradient(135deg, rgba(0, 255, 157, 0.15), rgba(0, 212, 255, 0.15));
    border-radius: 1.2rem;
    padding: 1.5rem;
    margin: 2rem 0;
    border: 1px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.acceptance-text {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.acceptance-text i {
    font-size: 2rem;
    color: var(--accent);
}

.acceptance-text h3 {
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
}

.acceptance-text p {
    color: var(--text-dim);
    font-size: 0.9rem;
}

.acceptance-checkbox {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.8rem 1.5rem;
    border-radius: 2rem;
    cursor: pointer;
}

.acceptance-checkbox input {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent);
}

/* Footer */
footer {
    padding: 2rem 5vw 1.5rem;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    color: var(--text-dim);
    border-top: 1px solid rgba(0, 255, 157, 0.1);
    font-size: 0.8rem;
    margin-top: 2rem;
    width: 100%;
    padding-bottom: calc(1.5rem + var(--safe-bottom));
}

.footer-developer {
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    color: #8ab4ff;
}

footer a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.8rem;
}

footer a:hover {
    color: var(--accent);
}

@media (max-width: 930px) {
    footer {
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    footer p {
        margin-top: 0.8rem;
    }

    .footer-developer {
        margin-top: 0.5rem;
        text-align: center;
    }
}

/* Responsive */
@media (max-width: 640px) {
    .section-header {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .section-header h2 {
        font-size: 1.3rem;
    }

    .terms-card {
        padding: 1.2rem;
    }

    .acceptance-card {
        flex-direction: column;
        text-align: center;
    }

    .acceptance-text {
        flex-direction: column;
        text-align: center;
    }

    .terms-table {
        font-size: 0.8rem;
    }

    .terms-table th,
    .terms-table td {
        padding: 0.5rem;
    }
}

@media (max-width: 400px) {
    .toc-grid {
        grid-template-columns: 1fr;
    }

    .terms-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Disable body scroll when sidebar open on mobile */
body.sidebar-open {
    overflow: hidden;
}