:root {
    --bg-color: #0b0f19;
    --surface-color: rgba(20, 25, 35, 0.6);
    --surface-border: rgba(255, 255, 255, 0.08);
    --primary-color: #1d9bf0;
    --primary-hover: #1a8cd8;
    --text-primary: #f7f9f9;
    --text-secondary: #8b98a5;
    --accent-color: #00ba7c;
    --danger-color: #f4212e;
    --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glass-blur: blur(12px);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body.dark-theme {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Subtle background gradient */
    background: radial-gradient(circle at top right, rgba(29, 155, 240, 0.1), transparent 40%),
                radial-gradient(circle at bottom left, rgba(0, 186, 124, 0.1), transparent 40%),
                var(--bg-color);
    background-attachment: fixed;
}

.glassmorphism {
    background: var(--surface-color);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow-soft);
}

/* Top Navbar */
.top-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-name {
    font-weight: 500;
}

.btn-login, .btn-logout {
    text-decoration: none;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition);
}

.btn-login {
    background-color: var(--primary-color);
    color: #fff;
}
.btn-login:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-logout {
    background-color: transparent;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}
.btn-logout:hover {
    background-color: rgba(244, 33, 46, 0.1);
}

/* Layout */
.layout-wrapper {
    display: flex;
    flex: 1;
}

/* Sidebar */
.left-sidebar {
    width: 260px;
    padding: 2rem 0;
    border-top: none;
    border-bottom: none;
    border-left: none;
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
}

.nav-menu {
    list-style: none;
}

.nav-item {
    margin: 0.25rem 1rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    text-decoration: none;
    color: var(--text-primary);
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover, .nav-item.active .nav-link {
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active .nav-link {
    font-weight: 700;
    color: var(--primary-color);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 3rem;
    max-width: 1200px;
}

/* Toasts */
.flash-container {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.toast-success {
    background-color: rgba(0, 186, 124, 0.15);
    color: var(--accent-color);
    border: 1px solid rgba(0, 186, 124, 0.3);
}

.toast-error {
    background-color: rgba(244, 33, 46, 0.15);
    color: var(--danger-color);
    border: 1px solid rgba(244, 33, 46, 0.3);
}

.api-guard-alert {
    background: var(--danger-color);
    color: #fff;
    padding: 0.75rem;
    text-align: center;
    font-weight: bold;
    width: 100%;
    z-index: 9999;
    position: relative;
}

/* Cards */
.card {
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

/* About Page Utilities */
.about-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 2rem;
}

.about-card {
    max-width: 500px;
    text-align: center;
    padding: 3rem 2rem;
}

.about-title {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.about-desc {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.about-version-wrapper {
    margin-bottom: 2rem;
}

.about-version {
    display: inline-block;
    background: rgba(255,255,255,0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--accent-color);
}

.about-credits {
    margin-bottom: 2.5rem;
    font-size: 0.9rem;
}

.about-credits-name {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.about-credits-email {
    color: var(--accent-color);
    text-decoration: none;
}

.about-repo {
    margin-bottom: 3rem;
}

.about-repo-link {
    color: var(--text-secondary);
    text-decoration: underline;
    font-size: 0.9rem;
}

.about-btn-return {
    display: inline-block;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    padding: 0.75rem 1.5rem;
}
