:root {
    --bg-color: #f5f7fb;
    --sidebar-bg: #ffffff; /* White sidebar */
    --card-bg: #ffffff;
    --primary-color: #3b82f6; /* Blue accent */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --active-item-bg: rgba(59, 130, 246, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: var(--bg-color);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

.dashboard-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 90px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 0;
    justify-content: space-between;
    transition: all 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.02);
}

.logo {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 3rem;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    align-items: center;
}

.nav-item {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    font-size: 1.2rem;
}

.nav-item:hover, .nav-item.active {
    background: rgba(59, 130, 246, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: white;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-item:hover::after, .nav-item.active::after {
    content: '';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 4px 0 0 4px;
    opacity: 0;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 3rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome-text h1 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.welcome-text p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

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

.search-box {
    background: var(--card-bg);
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    width: 300px;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.action-btn {
    width: 45px;
    height: 45px;
    background: var(--card-bg);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    position: relative;
    transition: all 0.3s ease;
}

.action-btn:hover {
    transform: translateY(-2px);
    color: var(--primary-color);
}

.dot {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid var(--card-bg);
}

.user-profile-initials {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), #2563eb);
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.25);
    transition: all 0.3s ease;
}

.user-profile-initials:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35);
}

/* --- Fixed & Restored Section (Discussions & Filters) --- */

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

.section-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

.see-all {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: gap 0.2s;
}

.see-all:hover {
    gap: 12px;
}

/* Topic Filters (Corrected) */
.topic-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
}

.topic-tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.tab.active, .tab:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

/* Discussion Cards Grid (Corrected) */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.discussion-card {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    cursor: pointer;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}

.discussion-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border-color: rgba(59, 130, 246, 0.2);
}

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

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

.user-avatar img {
    object-fit: contain;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-details h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

.card-tag {
    font-size: 0.75rem;
    padding: 6px 12px;
    border-radius: 8px;
    background: #f1f5f9;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.discussion-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    margin-top: 0.5rem;
}

.discussion-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #f8fafc;
}

.card-stats {
    display: flex;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.card-stats span i {
    margin-right: 6px;
}

.rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

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

.modal-overlay.active {
    opacity: 1;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: 24px;
    padding: 2rem;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

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

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

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.close-modal-btn, .close-modal, .close-modal-event, .close-event-modal-btn {
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.close-modal-btn:hover, .close-modal:hover {
    background: #e2e8f0;
    color: #ef4444;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: #f8fafc;
    transition: all 0.2s;
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-cancel {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.8rem 1.5rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.btn-submit {
    background: var(--primary-color);
    border: none;
    color: white;
    padding: 0.8rem 2rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-submit:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Button Styles */
.btn-primary {
    background: var(--primary-color);
    color: white;
    padding: 0.6rem 1.5rem;
    border-radius: 12px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

.btn-primary-outline {
    background: transparent;
    color: var(--primary-color);
    padding: 0.6rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--primary-color);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary-outline:hover {
    background: rgba(59, 130, 246, 0.05);
}

/* Right Panel Styles */
.right-panel {
    width: 320px;
    background: var(--sidebar-bg);
    border-left: 1px solid var(--border-color);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    overflow-y: auto;
}

/* Calendar Section */
.calendar-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calendar-nav {
    display: flex;
    gap: 1rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.calendar-nav i:hover {
    color: var(--primary-color);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    text-align: center;
    margin-top: 1rem;
}

.day-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.day {
    font-size: 0.9rem;
    height: 32px;
    width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
}

.day:not(.empty):hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

.day.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.day.empty {
    pointer-events: none;
}

/* Schedule Section */
.schedule-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.schedule-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 16px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.schedule-item:hover {
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border-color: var(--border-color);
    transform: translateX(-5px);
}

.schedule-item.active {
    background: white;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.date-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    padding: 0.5rem 0.8rem;
    border-radius: 12px;
    min-width: 60px;
}

.d-day {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
}

.d-month {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 2px;
}

.schedule-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.schedule-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.schedule-info .time,
.schedule-info .type {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: block;
}

/* Stats Section */
.stats-section {
    background: var(--primary-color);
    border-radius: 20px;
    padding: 1.5rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.stats-section h3 {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    opacity: 0.9;
}

.chart-placeholder {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 100px;
    margin-bottom: 1rem;
}

.bar {
    width: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    transition: height 0.3s ease;
}

.bar.active {
    background: white;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.stats-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.stats-info span {
    font-size: 0.9rem;
    font-weight: 600;
}

.stats-info .trend {
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

/* Active Project Card (Bonus) */
.active-project-card {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-radius: 20px;
    padding: 1.5rem;
    color: white;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.5rem;
    align-items: center;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.2);
    margin-top: 1rem;
}

.project-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #60a5fa;
}

.project-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.project-info p {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 1rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar .fill {
    height: 100%;
    background: #60a5fa;
    border-radius: 3px;
}

.project-meta {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.avatars {
    display: flex;
}

.avatars img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #1e293b;
    margin-left: -10px;
}

.avatars .more {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #334155;
    border: 2px solid #1e293b;
    margin-left: -10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
}

.percentage {
    font-weight: 700;
    color: #60a5fa;
}

/* Scrollbar styling for panels */
.right-panel::-webkit-scrollbar,
.main-content::-webkit-scrollbar {
    width: 6px;
}

.right-panel::-webkit-scrollbar-thumb,
.main-content::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 3px;
}

.right-panel::-webkit-scrollbar-track,
.main-content::-webkit-scrollbar-track {
    background: transparent;
}

/* Helper Classes */
.btn-text-icon {
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-text-icon:hover {
    background: rgba(59, 130, 246, 0.1);
}

.loading-state-small {
    text-align: center;
    padding: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* --- Mobile Navigation & Responsive Styles --- */

/* Initially hide mobile nav on desktop */
.mobile-bottom-nav {
    display: none;
}

/* Mobile Responsive Styles */
@media (max-width: 1024px) {
    .right-panel {
        display: none;
    }
    
    .search-box {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .right-panel {
        display: none;
    }

    .dashboard-container {
        flex-direction: column;
    }

    .main-content {
        padding: 1.5rem;
        padding-bottom: 90px; /* Space for bottom nav */
    }

    .top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .search-box {
        width: 100%;
    }

    /* Mobile Bottom Nav */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 70px;
        background: white;
        border-top: 1px solid var(--border-color);
        justify-content: space-around;
        align-items: center;
        z-index: 1000;
        padding-bottom: env(safe-area-inset-bottom);
        box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
    }

    .mobile-bottom-nav .nav-item {
        flex-direction: column;
        height: auto;
        gap: 4px;
        font-size: 0.75rem;
        color: var(--text-secondary);
        background: none;
        border: none;
        width: auto;
    }

    .mobile-bottom-nav .nav-item i {
        font-size: 1.4rem;
    }

    .mobile-bottom-nav .nav-item.active {
        color: var(--primary-color);
        background: none;
        box-shadow: none;
        border: none;
    }
    
    .mobile-bottom-nav .nav-item.active::after {
        display: none;
    }

    .mobile-add-btn {
        position: relative;
        top: -25px;
    }

    .plus-btn-circle {
        width: 56px;
        height: 56px;
        background: var(--primary-color);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 1.5rem;
        box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
        border: 4px solid var(--bg-color);
    }
}
