/* CSS Variables for theming */
:root {
    --bg-color: #f4f7fc;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-color: #333;
    --text-muted-color: #777;
    --accent-color: #4f46e5; /* Indigo */
    --accent-color-light: #e0e7ff;
    --border-color: #e0e0e0;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --sidebar-width: 260px;
}

[data-theme="dark"] {
    --bg-color: #1a1a2e;
    --sidebar-bg: #2a2a45;
    --card-bg: #2a2a45;
    --text-color: #e0e0e0;
    --text-muted-color: #a0a0b5;
    --accent-color: #818cf8; /* Light Indigo */
    --accent-color-light: #3730a3;
    --border-color: #3a3a5a;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    animation: fadeInModal 0.3s ease-out;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--card-bg);
    margin: 15% auto;
    padding: 2.5rem;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 400px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    position: relative;
    animation: slideInModal 0.4s ease-out;
}

@keyframes slideInModal {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-btn {
    color: var(--text-muted-color);
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-content h2 {
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 600;
}

#loginForm {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#loginForm input {
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
}

.login-submit-btn {
    padding: 1rem;
    border-radius: 8px;
    border: none;
    background-color: var(--accent-color);
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 1rem;
    transition: background-color 0.2s;
}

/* --- NEW LANDING PAGE STYLES --- */
#landing-page {
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    opacity: 1;
    transform: scale(1);
}

#landing-page.hidden {
    opacity: 0;
    transform: scale(1.1);
    pointer-events: none;
    position: absolute;
    width: 100%;
}

.hero-bg-wrapper {
    background-color: #111827;
    background-image: radial-gradient(circle at 1px 1px, #4b5563 1px, transparent 0);
    background-size: 20px 20px;
    color: #d1d5db; /* gray-300 */
}

.landing-header {
    position: absolute;
    inset: 0;
    height: fit-content;
    z-index: 50;
}

.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.5rem;
    max-width: 1280px;
    margin: auto;
}

.landing-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.landing-logo span {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.landing-login-btn {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5;
    color: white;
    background-color: #4f46e5; /* indigo-600 */
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s;
}
.landing-login-btn:hover {
        background-color: #4338ca; /* indigo-700 */
}

.hero-section {
    position: relative;
    padding: 3.5rem 1.5rem;
}

.hero-content {
    max-width: 64rem;
    margin: auto;
    padding-top: 8rem;
    padding-bottom: 8rem;
    text-align: center;
}

.hero-content h1 {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: white;
}

.hero-content p {
    margin-top: 1.5rem;
    font-size: 1.125rem;
    line-height: 1.75;
    color: #d1d5db; /* gray-300 */
}

.hero-buttons {
    margin-top: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.hero-buttons a {
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.375rem;
    padding: 0.625rem 0.875rem;
}

.btn-primary {
    background-color: #4f46e5; /* indigo-600 */
    color: white;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
    transition: background-color 0.2s;
}
.btn-primary:hover {
    background-color: #4338ca; /* indigo-700 */
}
.btn-secondary {
    color: #d1d5db; /* gray-300 */
}

.philosophy-section {
    background-color: #1f2937;
    padding: 6rem 1.5rem;
}
[data-theme="dark"] .philosophy-section {
    background-color: #1f2937; /* gray-800 */
}

.section-intro {
    max-width: 42rem;
    margin: auto;
    text-align: center;
}

.section-intro h2 {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.75;
    color: #4f46e5; /* indigo-600 */
}

.section-intro p.title {
    margin-top: 0.5rem;
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #111827; /* gray-900 */
}
[data-theme="dark"] .section-intro p.title, .philosophy-section .section-intro p.title {
    color: white;
}
.section-intro p.subtitle {
    margin-top: 1.5rem;
    font-size: 1.125rem;
    line-height: 1.75;
    color: #4b5563; /* gray-600 */
}
[data-theme="dark"] .section-intro p.subtitle, .philosophy-section .section-intro p.subtitle {
        color: #d1d5db; /* gray-300 */
}

.features-grid {
    margin: 4rem auto 0;
    max-width: 64rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem 2rem;
}

.feature-item {
    position: relative;
    padding-left: 4rem;
}

.feature-item dt {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.75;
    color: #111827; /* gray-900 */
}
    [data-theme="dark"] .feature-item dt, .philosophy-section .feature-item dt {
    color: white;
    }

.feature-icon {
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    height: 2.5rem;
    width: 2.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    background-color: #4f46e5;
}

.feature-item dd {
    margin-top: 0.5rem;
    font-size: 1rem;
    line-height: 1.75;
    color: #4b5563;
}
[data-theme="dark"] .feature-item dd, .philosophy-section .feature-item dd {
    color: #d1d5db;
}

.community-section {
    padding: 6rem 1.5rem;
}

.landing-footer {
    background-color: #1f2937;
    color: white;
    padding: 2rem;
    text-align: center;
}

@media (min-width: 768px) {
        .hero-content h1 {
        font-size: 3.75rem;
        }
        .section-intro p.title {
        font-size: 2.25rem;
        }
}

@media (min-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- END NEW LANDING PAGE STYLES --- */

/* Dashboard Styles */
#dashboard-container {
    display: none;
    transition: opacity 0.5s ease-in;
    opacity: 0;
}

#dashboard-container.visible {
    display: flex;
    opacity: 1;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s, border-color 0.3s, transform 0.3s ease-in-out;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 600;
    color: #4f46e5;
}

.sidebar-menu {
    list-style: none;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-menu-item a {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: var(--text-muted-color);
    text-decoration: none;
    font-weight: 500;
    gap: 15px;
    position: relative;
    transition: color 0.2s, background-color 0.2s;
}

.sidebar-menu-item a:hover {
    color: var(--accent-color);
    background-color: var(--accent-color-light);
}

.sidebar-menu-item.active a {
    color: var(--accent-color);
    background-color: var(--accent-color-light);
}

.sidebar-menu-item.active a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background-color: var(--accent-color);
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    margin-top: auto; /* Pushes to the bottom */
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 15px;
}
.profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.user-name {
    font-weight: 500;
    flex-grow: 1;
}
.logout-icon {
    color: var(--text-muted-color);
    cursor: pointer;
    transition: color 0.2s;
}
.logout-icon:hover {
    color: var(--accent-color);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    padding: 2rem;
    transition: margin-left 0.3s ease-in-out;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header-title {
    font-size: 1.8rem;
    font-weight: 600;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.theme-switch-wrapper { display: flex; align-items: center; }
.theme-switch { display: inline-block; height: 24px; position: relative; width: 50px; }
.theme-switch input { display:none; }
.slider { background-color: #ccc; bottom: 0; cursor: pointer; left: 0; position: absolute; right: 0; top: 0; transition: .4s; border-radius: 34px; }
.slider:before { background-color: #fff; bottom: 4px; content: ""; height: 16px; left: 4px; position: absolute; transition: .4s; width: 16px; border-radius: 50%; }
input:checked + .slider { background-color: #4f46e5; }
input:checked + .slider:before { transform: translateX(26px); }

.dashboard-section { display: none; }
.dashboard-section.active { display: block; animation: fadeIn 0.5s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.card { background-color: var(--card-bg); padding: 1.5rem; border-radius: 12px; box-shadow: var(--shadow); border: 1px solid var(--border-color); transition: transform 0.2s, box-shadow 0.2s; }
.card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08); }
.card-header { font-size: 1.1rem; font-weight: 600; color: var(--text-muted-color); margin-bottom: 1rem; }
.card-content h2 { font-size: 2.5rem; font-weight: 600; }
.card-content p { color: var(--text-muted-color); }
.chart-container { margin-top: 2rem; height: 400px; }
.placeholder-content { display: flex; justify-content: center; align-items: center; height: 300px; color: var(--text-muted-color); font-size: 1.2rem; border: 2px dashed var(--border-color); border-radius: 12px; }

/* Responsive Design */
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); z-index: 1000; }
    .main-content { margin-left: 0; width: 100%; }
    .menu-toggle { display: none; position: fixed; top: 20px; left: 20px; z-index: 1001; cursor: pointer; background: var(--sidebar-bg); border-radius: 50%; padding: 10px; box-shadow: var(--shadow); }
    .sidebar.open { transform: translateX(0); }
}