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

:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #121826;
    --bg-tertiary: #1b2336;
    --border-color: rgba(255, 255, 255, 0.08);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    --accent-gold: #fbbf24;
    --accent-gold-rgb: 251, 191, 36;
    --accent-cyan: #06b6d4;
    --accent-cyan-rgb: 6, 182, 212;
    --accent-green: #10b981;
    --accent-green-rgb: 16, 185, 129;
    --accent-purple: #a855f7;
    --accent-purple-rgb: 168, 85, 247;
    --accent-red: #ef4444;

    --glass-bg: rgba(18, 24, 38, 0.75);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-glow: rgba(6, 182, 212, 0.15);

    --shadow-sm: 0 2px 8px -1px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.7);

    --font-sans: 'Outfit', sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Background Gradients */
.bg-decor {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(150px);
    z-index: -1;
    opacity: 0.12;
    pointer-events: none;
}

.decor-1 {
    top: -100px;
    left: -100px;
    background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 80%);
}

.decor-2 {
    bottom: -150px;
    right: -100px;
    background: radial-gradient(circle, var(--accent-purple) 0%, transparent 80%);
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-cyan));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
}

.logo-icon svg {
    width: 24px;
    height: 24px;
    fill: var(--bg-primary);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #ffffff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text span {
    color: var(--accent-cyan);
    -webkit-text-fill-color: var(--accent-cyan);
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.nav-item a svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    transition: var(--transition-smooth);
}

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

.nav-item.active a {
    background: rgba(6, 182, 212, 0.08);
    border-color: rgba(6, 182, 212, 0.2);
    color: var(--accent-cyan);
}

.nav-item.active a svg {
    stroke: var(--accent-cyan);
}

/* Sidebar Footer Info */
.sidebar-footer {
    margin-top: auto;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem 1rem;
}

.author-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: white;
}

.author-info {
    text-align: left;
}

.author-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.author-status {
    font-size: 0.75rem;
    color: var(--accent-green);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.author-status::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: var(--accent-green);
    border-radius: 50%;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2.5rem 3rem;
    max-width: 1400px;
    width: calc(100% - 280px);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.header-title h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    background: linear-gradient(to right, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-title p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.header-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.header-stat-tag {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    padding: 0.6rem 1.25rem;
    border-radius: 30px;
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.header-stat-tag.tag-cyan {
    color: var(--accent-cyan);
    border-color: rgba(6, 182, 212, 0.2);
}

.header-stat-tag.tag-gold {
    color: var(--accent-gold);
    border-color: rgba(251, 191, 36, 0.2);
}

/* Content Sections */
.content-section {
    display: none;
    animation: fadeIn 0.4s ease;
}

.content-section.active {
    display: block;
}

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

/* Dashboard Cards (Overview) */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.stat-card.stat-gold::after { background: var(--accent-gold); }
.stat-card.stat-cyan::after { background: var(--accent-cyan); }
.stat-card.stat-green::after { background: var(--accent-green); }
.stat-card.stat-purple::after { background: var(--accent-purple); }

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-md);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-title {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-gold .stat-icon { background: rgba(251, 191, 36, 0.1); color: var(--accent-gold); }
.stat-cyan .stat-icon { background: rgba(6, 182, 212, 0.1); color: var(--accent-cyan); }
.stat-green .stat-icon { background: rgba(16, 185, 129, 0.1); color: var(--accent-green); }
.stat-purple .stat-icon { background: rgba(168, 85, 247, 0.1); color: var(--accent-purple); }

.stat-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
}

.stat-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Two Column Layout */
.dashboard-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

/* Tracker Box / Progress History */
.tracker-box {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
}

#latest-entry-box {
    cursor: pointer;
    transition: var(--transition-smooth);
}

#latest-entry-box:hover {
    border-color: rgba(6, 182, 212, 0.3);
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.15);
    transform: translateY(-4px);
}

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

.section-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.25px;
}

/* Custom mini graphic bar */
.progress-chart-container {
    margin-top: 1rem;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.chart-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 140px;
    gap: 8px;
    padding-top: 10px;
}

.chart-bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    height: 100%;
    justify-content: flex-end;
}

.chart-bar-fill {
    width: 100%;
    max-width: 32px;
    background: linear-gradient(to top, rgba(6, 182, 212, 0.2), var(--accent-cyan));
    border-radius: 6px 6px 0 0;
    transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
}

.chart-bar-fill:hover {
    background: linear-gradient(to top, rgba(251, 191, 36, 0.4), var(--accent-gold));
}

.chart-bar-tooltip {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
    color: var(--accent-gold);
}

.chart-bar-fill:hover .chart-bar-tooltip {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

.chart-bar-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-weight: 550;
}

/* Feed & Filter Controls */
.feed-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 1.25rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    transition: var(--transition-smooth);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
}

.filter-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 1.25rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    outline: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.filter-select:focus {
    border-color: var(--accent-cyan);
}

/* Timeline/Blog Feed Layout */
.timeline {
    position: relative;
    padding: 1rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 30px;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, var(--accent-cyan), var(--accent-purple), transparent);
}

.timeline-item {
    position: relative;
    padding-left: 70px;
    margin-bottom: 3rem;
}

.timeline-badge {
    position: absolute;
    top: 5px;
    left: 15px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 3px solid var(--accent-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-primary);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

.timeline-item:nth-child(even) .timeline-badge {
    border-color: var(--accent-purple);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

.post-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.post-card:hover {
    transform: translateX(5px);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-lg);
}

.post-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.post-date {
    font-size: 0.8rem;
    color: var(--accent-cyan);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.post-badges {
    display: flex;
    gap: 0.5rem;
}

.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    text-transform: uppercase;
}

.badge-type {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent-cyan);
}

.badge-diff {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.badge-diff.easy { color: var(--accent-green); background: rgba(16, 185, 129, 0.1); }
.badge-diff.medium { color: var(--accent-gold); background: rgba(251, 191, 36, 0.1); }
.badge-diff.hard { color: var(--accent-purple); background: rgba(168, 85, 247, 0.1); }

.post-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.post-desc {
    color: var(--text-secondary);
    font-size: 0.975rem;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.author-note {
    background: rgba(168, 85, 247, 0.05);
    border-left: 3px solid var(--accent-purple);
    padding: 0.85rem 1.25rem;
    border-radius: 0 8px 8px 0;
    font-size: 0.9rem;
    color: #e9d5ff;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.post-steps-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-steps {
    list-style: none;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.post-steps li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.post-steps li::before {
    content: '➔';
    color: var(--accent-cyan);
    font-weight: bold;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.post-reward-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reward-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.reward-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent-gold);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    color: var(--bg-primary);
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

/* Admin / Simulator Form */
.admin-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
}

.admin-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.admin-form .input-group.full-width {
    grid-column: span 2;
}

.text-input, .textarea-input {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    outline: none;
    transition: var(--transition-smooth);
}

.text-input:focus, .textarea-input:focus {
    border-color: var(--accent-cyan);
}

.textarea-input {
    height: 120px;
    resize: none;
}

.form-actions {
    grid-column: span 2;
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* Toast alert styling */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent-green);
    box-shadow: var(--shadow-lg);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Responsive Rules */
@media (max-width: 1024px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1.5rem;
    }
    
    .logo-container {
        margin-bottom: 1.5rem;
    }
    
    .nav-links {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-around;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1.5rem;
        width: 100%;
    }
    
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        padding-left: 50px;
    }
    
    .timeline-badge {
        left: 5px;
    }
    
    .admin-form {
        grid-template-columns: 1fr;
    }
    
    .admin-form .input-group.full-width {
        grid-column: span 1;
    }
    
    .form-actions {
        grid-column: span 1;
    }
}
