:root {
    --bg-main: #f8fafc;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --border-glass: rgba(0, 0, 0, 0.05);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent-blue: #2563eb;
    --accent-purple: #7c3aed;
    --accent-green: #10b981;
    --shadow-color: rgba(148, 163, 184, 0.15);

    /* Calendar Colors - GitHub Light Theme vibe */
    --cal-level-0: #ebedf0;
    --cal-level-1: #9be9a8;
    --cal-level-2: #40c463;
    --cal-level-3: #30a14e;
    --cal-level-4: #216e39;
}

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

body {
    font-family: "Pixelify Sans", sans-serif;
    font-optical-sizing: auto;
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(124, 58, 237, 0.04), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(37, 99, 235, 0.04), transparent 25%);
}

h1,
h2,
h3,
h4 {
    font-family: "Pixelify Sans", sans-serif;
    font-optical-sizing: auto;
    color: var(--text-primary);
}

.app-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    min-height: 100vh;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow-color);
}

/* Sidebar */
.sidebar {
    margin: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    position: sticky;
    top: 20px;
    height: calc(100vh - 40px);
    z-index: 50;
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0px;
}

.logo-img {
    height: 57px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
}

.logo-text {
    font-family: "Nabla", system-ui;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-variation-settings:
        "EDPT" 100,
        "EHLT" 12;
    font-size: 1.7rem;
    letter-spacing: 0.5px;
}

.logo h2 {
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.profile-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.stat-value {
    font-size: 1.8rem;
    font-family: "Pixelify Sans", sans-serif;
    font-optical-sizing: auto;
    font-weight: 700;
}

.stat-value.highlight {
    background: linear-gradient(to right, #f59e0b, #ef4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-value.text-blue {
    color: var(--accent-blue);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 12px;
    transition: all 0.2s;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.nav-link:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--accent-blue);
}

.nav-link.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent-blue);
}

.sidebar-divider {
    height: 1px;
    background: var(--border-glass);
    margin: 10px 0;
}

/* Timetable Engine in Sidebar */
.timetable-engine {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.timetable-header h4 {
    font-size: 1rem;
    font-weight: 700;
}

.timetable-badge {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
}

.timetable-toggle {
    display: flex;
    gap: 8px;
}

.toggle-btn {
    flex: 1;
    background: #f1f5f9;
    border: none;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.toggle-btn.active {
    background: rgba(124, 58, 237, 0.1);
    color: var(--accent-purple);
}

.interactive-timeline {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.timeline-item-btn {
    display: block;
    width: 100%;
    text-align: left;
    background: white;
    border: 1px solid var(--border-glass);
    padding: 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.timeline-item-btn:hover {
    transform: translateY(-2px);
    border-color: var(--accent-purple);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.1);
}

.time {
    font-size: 0.8rem;
    color: var(--accent-purple);
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}

.timeline-desc {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.3;
}


/* Main Content */
.main-content {
    padding: 40px 40px 40px 0;
    overflow-y: auto;
}

.header {
    margin-bottom: 40px;
}

.page-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -1px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    font-weight: 500;
}

/* Page Views */
.page-view {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.page-view.active {
    display: block;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
}

.card {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.card-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Calendar GitHub Style */
.calendar-container {
    overflow-x: auto;
    padding-bottom: 10px;
}

.calendar-grid-wrapper {
    display: flex;
    gap: 8px;
}

.months {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    list-style: none;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    padding-left: 32px;
    font-weight: 600;
}

.days {
    display: grid;
    grid-template-rows: repeat(7, 1fr);
    gap: 4px;
    list-style: none;
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding-right: 8px;
    font-weight: 500;
}

.days li:nth-child(even) {
    visibility: hidden;
}

.squares {
    display: grid;
    grid-template-rows: repeat(7, 1fr);
    grid-auto-flow: column;
    grid-auto-columns: 14px;
    gap: 4px;
}

.squares li {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    list-style: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.squares li:hover {
    transform: scale(1.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.squares li[data-level="0"] {
    background-color: var(--cal-level-0);
}

.squares li[data-level="1"] {
    background-color: var(--cal-level-1);
}

.squares li[data-level="2"] {
    background-color: var(--cal-level-2);
}

.squares li[data-level="3"] {
    background-color: var(--cal-level-3);
}

.squares li[data-level="4"] {
    background-color: var(--cal-level-4);
}

.calendar-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    justify-content: flex-end;
    margin-top: 10px;
    font-weight: 500;
}

.legend-squares {
    display: flex;
    gap: 4px;
    list-style: none;
}

.legend-squares li {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-squares .level-0 {
    background-color: var(--cal-level-0);
}

.legend-squares .level-1 {
    background-color: var(--cal-level-1);
}

.legend-squares .level-2 {
    background-color: var(--cal-level-2);
}

.legend-squares .level-3 {
    background-color: var(--cal-level-3);
}

.legend-squares .level-4 {
    background-color: var(--cal-level-4);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 12px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.tab-btn.active {
    background: white;
    color: var(--accent-blue);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* Sprints List */
.sprint-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sprint-item {
    background: white;
    border: 1px solid var(--border-glass);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.sprint-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.sprint-title {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-primary);
}

.sprint-focus {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 6px;
    font-weight: 500;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 500;
}

.task-progress {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.task-fill {
    height: 100%;
    background: var(--accent-green);
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Interactive Checkmark visually changed to match status */
.status-badge {
    background: #f1f5f9;
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

.status-badge.complete {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    transform: translateY(20px);
    transition: transform 0.3s;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-content h3 {
    margin-bottom: 10px;
    font-size: 1.4rem;
    text-align: center;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 0.95rem;
    text-align: center;
}

.task-selector-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.task-selector-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 14px 16px;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.task-selector-btn:hover {
    background: #f1f5f9;
    border-color: var(--accent-blue);
}

.task-selector-btn.complete {
    opacity: 0.5;
    pointer-events: none;
}

.task-selector-name {
    font-weight: 600;
    color: var(--text-primary);
}

.task-selector-cat {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.modal-btns {
    display: flex;
    gap: 10px;
}

.btn {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: #e2e8f0;
    color: var(--text-primary);
}

/* Diet Grid */
.diet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.diet-card {
    background: white;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--border-glass);
}

.diet-card h4 {
    color: var(--accent-green);
    margin-bottom: 10px;
}

.diet-card ul {
    list-style: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.diet-card ul li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 6px;
}

.diet-card ul li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent-green);
    font-weight: bold;
}

/* Tooltip */
.tooltip {
    position: absolute;
    pointer-events: none;
    z-index: 100;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    color: white;
    transform: translate(-50%, -100%);
    margin-top: -12px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    font-weight: 500;
}

.tooltip.visible {
    opacity: 1;
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: rgba(15, 23, 42, 0.95) transparent transparent transparent;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 280px 1fr;
    }
}

@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        height: auto;
        position: relative;
        margin: 0;
        border-radius: 0 0 20px 20px;
        padding: 20px;
        top: 0;
        gap: 20px;
    }

    .nav-menu {
        flex-direction: row;
        justify-content: space-around;
        margin-top: 10px;
    }

    .main-content {
        padding: 20px;
    }

    .page-title {
        font-size: 2rem;
    }
}

/* Authentication UI */
.auth-wrapper {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(124, 58, 237, 0.04), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(37, 99, 235, 0.04), transparent 25%);
}

.auth-wrapper.hidden {
    display: none !important;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    display: flex;
    flex-direction: column;
}

.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input {
    padding: 12px;
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    font-family: 'Pixelify Sans', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}

.form-group input:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary {
    background: #e2e8f0;
    color: var(--text-primary);
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

.auth-error {
    color: #ef4444;
    font-size: 0.85rem;
    margin-bottom: 10px;
    text-align: center;
    font-weight: 600;
}

.app-container.hidden {
    display: none !important;
}