:root {
    --bg-color: #fdfbf7;
    --text-primary: #111;
    --text-secondary: #555;
    --text-tertiary: #999;
    --accent-color: #d4a373;

    --font-sans: 'Inter', -apple-system, sans-serif;
    --font-serif: 'Playfair Display', serif;

    --container-width: 900px;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* --- Navigation --- */
header {
    width: 100%;
    padding: 3rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--container-width);
    margin: 0 auto;
}

.logo a {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

nav {
    display: flex;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--text-primary);
}

nav a.btn-login {
    color: var(--text-primary);
    border-bottom: 1px solid transparent;
}

nav a.btn-login:hover {
    border-bottom: 1px solid var(--text-primary);
}


/* --- Main Container --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 5%;
    min-height: 80vh;
}

/* --- Hero Section --- */
.hero {
    margin-top: 4rem;
    margin-bottom: 5rem;
    text-align: center;
}

.hero h2 {
    font-family: var(--font-serif);
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

/* --- Blog Feed --- */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 5rem;
    max-width: 650px;
    margin: 0 auto 5rem;
}

.blog-post-item {
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.blog-post-item:last-child {
    border-bottom: none;
}

.post-date {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.post-title a {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    line-height: 1.2;
    display: block;
    margin-bottom: 1rem;
    transition: opacity 0.2s;
}

.post-title a:hover {
    opacity: 0.7;
}

.post-excerpt {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* --- Single Page Content (About, Post Detail) --- */
.page-content {
    max-width: 650px;
    margin: 0 auto 5rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
    text-align: left;
}

.page-content p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.page-content h3 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-top: 3rem;
    margin-bottom: 1rem;
}

.page-content ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.page-content li {
    margin-bottom: 0.5rem;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    margin-top: 4rem;
    padding: 3rem;
    border: 1px dashed rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    color: var(--text-tertiary);
    font-family: var(--font-serif);
    font-style: italic;
}

/* --- Auth Pages --- */
.auth-wrapper {
    display: flex;
    justify-content: center;
    padding-top: 5rem;
}

.auth-card {
    width: 100%;
    max-width: 320px;
}

.auth-card h2 {
    font-family: var(--font-serif);
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    background: transparent;
    transition: border 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--text-primary);
}

.btn {
    width: 100%;
    padding: 1rem;
    background: var(--text-primary);
    color: #fff;
    border: none;
    font-size: 0.9rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn:hover {
    background: #333;
}


/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
        padding: 2rem 5%;
    }

    .hero h2 {
        font-size: 2.5rem;
    }

    .post-title a {
        font-size: 1.6rem;
    }

    nav {
        gap: 1.5rem;
    }
}

/* --- Admin / Dashboard Overrides NEW THEME --- */
:root {
    /* Dark Theme Variables */
    --bg-dark: #13131f;
    --bg-sidebar: #0f0f18;
    /* Slightly darker than main bg */
    --bg-card: #1e1e2d;
    --bg-hover: #2b2b40;

    --primary: #3699ff;
    --primary-hover: #2b7ce9;
    --success: #1bc5bd;
    --info: #8950fc;
    --warning: #ffa800;
    --danger: #f64e60;

    --text-main: #ffffff;
    --text-muted: #7e8299;
    --text-dark: #3f4254;

    --border-color: #2b2b40;
    --radius: 12px;
    --header-height: 80px;
}

body.layout-dashboard {
    background-color: var(--bg-dark) !important;
    color: var(--text-main);
    display: flex;
    flex-direction: row;
    height: 100vh;
    overflow: hidden;
    font-family: 'Inter', system-ui, sans-serif;
}

/* --- Sidebar --- */
.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
    z-index: 10;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    border-bottom: 1px solid var(--border-color);
}

.logo-text {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 1.4rem;
    color: #fff;
    letter-spacing: 1px;
}

.logo-text span {
    color: var(--primary);
}

.sidebar-content {
    flex: 1;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
    padding-left: 10px;
}

.nav-label:first-child {
    margin-top: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-item:hover,
.nav-item.active {
    background: var(--bg-hover);
    color: var(--primary);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    opacity: 0.8;
}

.sidebar-footer {
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
}

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

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid var(--primary);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-details h4 {
    margin: 0;
    font-size: 0.9rem;
    color: #fff;
}

.user-details span {
    font-size: 0.75rem;
    color: var(--primary);
}

/* --- Main Content --- */
.dashboard-main {
    flex: 1;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    padding: 0;
    /* Reset default padding */
}

/* Header */
.top-header {
    height: var(--header-height);
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    flex-shrink: 0;
}

.page-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
}

.search-bar {
    position: relative;
    width: 300px;
}

.search-bar input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 10px 15px 10px 40px;
    border-radius: 8px;
    color: #fff;
    font-family: inherit;
}

.search-bar svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    fill: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

/* Content Scrollable Area */
.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

/* --- Widgets Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
}

.stat-info h3 {
    margin: 0 0 5px 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
}

.stat-meta {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.text-success {
    color: var(--success);
}

.text-info {
    color: var(--info);
}

.text-muted {
    color: var(--text-muted);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    /* Center icon */
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
}

/* Level Progress */
.level-progress-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 30px;
}

.level-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.level-badge {
    background: var(--primary);
    color: #fff;
    padding: 5px 12px;
    border-radius: 6px;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
}

.progress-track {
    background: #151521;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, var(--primary), var(--info));
    height: 100%;
    border-radius: 6px;
    transition: width 1s ease;
}

/* Dashboard Split Layout */
.dashboard-split {
    display: grid;
    grid-template-columns: 1fr 380px;
    /* Kanban takes remaining space, Charts fixed width */
    gap: 20px;
    height: 600px;
    /* Min height for dashboard feel */
}

/* Kanban */
.kanban-section {
    display: flex;
    flex-direction: column;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.kanban-container {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
    height: 100%;
}

.kanban-col {
    background: var(--bg-card);
    min-width: 280px;
    border-radius: var(--radius);
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.col-title {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.col-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.task-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

.task-card {
    background: #232333;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 3px solid transparent;
    transition: transform 0.2s;
}

.task-card:hover {
    transform: translateY(-2px);
    background: #2a2a3d;
}

.task-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.task-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.task-check:hover {
    border-color: var(--primary);
}

.task-title {
    font-size: 0.9rem;
    color: #fff;
    line-height: 1.4;
    flex: 1;
}

.task-tags {
    display: flex;
    gap: 5px;
    margin-top: 8px;
    margin-left: 28px;
}

.tag {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(54, 153, 255, 0.15);
    color: var(--primary);
}

/* Charts Section */
.charts-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chart-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    height: 100%;
    /* Fill available space */
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

@media (max-width: 1200px) {
    .dashboard-split {
        grid-template-columns: 1fr;
        height: auto;
    }
}

/* --- Generic Admin Dashboard (Missing Styles) --- */
.dashboard-header {
    padding: 2rem 2rem 1rem 2rem;
}

.dashboard-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    /* Larger for impact */
    color: #fff;
    margin-bottom: 0.5rem;
}

.dashboard-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 0 2rem 2rem 2rem;
}

.dash-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.dash-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.dash-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.dash-card-header h3 {
    margin: 0;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 600;
}

.dash-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 20px;
    flex: 1;
}

.btn-card {
    display: inline-block;
    padding: 12px 20px;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
}

.btn-card:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}