/* ==========================================================================
   Simple Todo List - Modern Flat UI & Responsive Stylesheet
   ========================================================================== */

:root {
    --app-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --sidebar-width: 260px;
    --sidebar-bg-light: #ffffff;
    --sidebar-border-light: #e9ecef;
    --body-bg-light: #f8fafc;
    --text-muted-light: #64748b;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
    --card-hover-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --transition-speed: 0.2s;
}

[data-bs-theme="dark"] {
    --sidebar-bg-light: #1e293b;
    --sidebar-border-light: #334155;
    --body-bg-light: #0f172a;
    --text-muted-light: #94a3b8;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
    --card-hover-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.4);
}

body {
    font-family: var(--app-font);
    background-color: var(--body-bg-light);
    color: var(--bs-body-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --------------------------------------------------------------------------
   Layout & Sidebar Structure
   -------------------------------------------------------------------------- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.app-sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg-light);
    border-right: 1px solid var(--sidebar-border-light);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: all var(--transition-speed) ease-in-out;
    z-index: 1040;
}

.sidebar-header {
    height: 65px;
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--sidebar-border-light);
}

.sidebar-nav {
    padding: 1rem 0.75rem;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.65rem 1rem;
    font-size: 0.925rem;
    font-weight: 500;
    color: var(--text-muted-light);
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    transition: all var(--transition-speed) ease;
}

.sidebar-nav .nav-link i {
    font-size: 1.15rem;
    margin-right: 0.75rem;
    width: 24px;
    text-align: center;
}

.sidebar-nav .nav-link:hover {
    color: var(--bs-primary);
    background-color: rgba(13, 110, 253, 0.08);
}

.sidebar-nav .nav-link.active {
    color: #ffffff;
    background-color: var(--bs-primary);
}

.sidebar-nav .nav-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-muted-light);
    padding: 0.75rem 1rem 0.25rem;
}

.app-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* --------------------------------------------------------------------------
   Top Navbar
   -------------------------------------------------------------------------- */
.app-navbar {
    height: 65px;
    background-color: var(--sidebar-bg-light);
    border-bottom: 1px solid var(--sidebar-border-light);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* --------------------------------------------------------------------------
   Cards & UI Components
   -------------------------------------------------------------------------- */
.card {
    border: 1px solid var(--sidebar-border-light);
    box-shadow: var(--card-shadow);
    border-radius: 0.75rem;
    transition: box-shadow var(--transition-speed) ease;
}

.card:hover {
    box-shadow: var(--card-hover-shadow);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--sidebar-border-light);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.stat-card {
    border-radius: 0.75rem;
    border: none;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    overflow: hidden;
    position: relative;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-hover-shadow);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* --------------------------------------------------------------------------
   Badges and Priorities
   -------------------------------------------------------------------------- */
.badge-priority-high {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

[data-bs-theme="dark"] .badge-priority-high {
    background-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

.badge-priority-medium {
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

[data-bs-theme="dark"] .badge-priority-medium {
    background-color: rgba(14, 165, 233, 0.2);
    color: #7dd3fc;
    border-color: rgba(14, 165, 233, 0.3);
}

.badge-priority-low {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

[data-bs-theme="dark"] .badge-priority-low {
    background-color: rgba(100, 116, 139, 0.2);
    color: #cbd5e1;
    border-color: rgba(100, 116, 139, 0.3);
}

.task-title.completed {
    text-decoration: line-through;
    opacity: 0.65;
}

/* --------------------------------------------------------------------------
   Toast Container Positioning
   -------------------------------------------------------------------------- */
.toast-container-custom {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1090;
}

/* --------------------------------------------------------------------------
   Responsive Layout Overrides
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: -260px;
    }

    .app-sidebar.show {
        left: 0;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    }

    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.4);
        z-index: 1030;
        display: none;
    }

    .sidebar-backdrop.show {
        display: block;
    }
}

