:root {
            --bg-dark: #1A182E; /* Primary Background */
            --bg-sidebar: #222046; /* Sidebar/Card Background (Slightly lighter than primary) */
            --text-light: #E0E0FF; /* Primary Light Text */
            --text-secondary: #9CA3AF; /* Gray Text */
            --color-primary: #A78BFA; /* Indigo/Purple Accent */
            --color-active: #4C4B7D; /* Active menu background */
        }

        body {
            font-family: 'Inter', sans-serif;
            background-color: var(--bg-dark); 
            color: var(--text-light); 
        }

        /* Sidebar Styling */
        .sidebar {
            width: 280px;
            min-height: 100vh;
            background-color: var(--bg-sidebar); 
            box-shadow: 4px 0 15px rgba(0, 0, 0, 0.4);
            transition: all 0.3s ease-in-out;
            z-index: 20; 
        }
        
        /* Navigation Items */
        .nav-item {
            display: flex;
            align-items: center;
            padding: 0.8rem 1.5rem;
            margin: 0.2rem 0.5rem;
            cursor: pointer;
            border-radius: 0.5rem;
            transition: background-color 0.2s, color 0.2s;
        }
        .nav-item:hover {
            background-color: var(--color-active); 
        }
        .nav-item.active {
            background-color: var(--color-active); 
            color: var(--text-light);
            font-weight: 600;
        }
        .nav-item-icon {
            margin-right: 1rem;
        }

        /* Journal Card Styling */
        .journal-card {
            background-color: var(--bg-sidebar); 
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
            border: 1px solid #3A386D; 
            max-width: 350px; 
        }
        
        /* Responsive Fixes (for mobile) */
       @media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: -280px; /* start hidden off-screen */
    width: 250px;
    height: 100vh;
    background-color: var(--bg-sidebar);
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.4);
    transition: left 0.3s ease-in-out;
    z-index: 50;
  }

  .sidebar.open {
    left: 0; /* slide in */
  }

  .sidebar {
  transform: translateX(-100%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.sidebar.open {
  transform: translateX(0);
  opacity: 1;
}

  .main-content-area {
    padding-top: 5rem;
  }
}

            .fixed-header {
                display: flex;
                background-color: var(--bg-dark);
                border-bottom: 1px solid #3A386D;
            }
            /* Adjust grid for smaller screens */
            #timeline-content {
                grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
                justify-items: center;
            }

        
        /* Desktop/Tablet Grid adjustments */
        @media (min-width: 769px) {
             #timeline-content {
                grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
                gap: 1.5rem;
            }
        }
        #loading-screen {
  opacity: 1;
  transition: opacity 0.4s ease;
}
#loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

