/* ==========================================================================
   Modern To-Do App Stylesheet
   ========================================================================== */

/* * Table of Contents:
 * 1. Global Styles & Variables
 * 2. Main Layout (Wrapper, Content Area)
 * 3. Sidebar Navigation
 * 4. Top Header / Navbar
 * 5. Footer
 * 6. General Component Overrides (Cards, Buttons)
 * 7. Responsive Design
*/


/* --------------------------------------------------------------------------
 * 1. Global Styles & Variables
 * -------------------------------------------------------------------------- */

/* Import a modern, clean font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Define CSS variables for a consistent and easily customizable color scheme */
:root {
    --primary-color: #4f46e5; /* A modern indigo */
    --primary-hover: #4338ca;
    --secondary-color: #64748b; /* Cool gray for text */
    --light-gray: #f1f5f9;      /* Background color */
    --border-color: #e2e8f0;
    --white: #ffffff;
    --sidebar-bg: #111827;      /* A dark gray for the sidebar */
    --sidebar-text: #d1d5db;
    --sidebar-active: var(--primary-color);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--light-gray);
    color: var(--secondary-color);
    font-size: 16px;
    line-height: 1.6;
}


/* --------------------------------------------------------------------------
 * 2. Main Layout (Wrapper, Content Area)
 * -------------------------------------------------------------------------- */

.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    height: 100vh;
    overflow: hidden;
}

#content {
    width: calc(100% - 260px); /* Adjust width to account for sidebar */
    margin-left: 260px; /* Push content to the right of the sidebar */
    padding: 20px;
    overflow-y: auto;
    transition: all 0.3s;
}

#content.active {
    width: 100%;
    margin-left: 0;
}


/* --------------------------------------------------------------------------
 * 3. Sidebar Navigation
 * -------------------------------------------------------------------------- */

#sidebar {
    position: fixed; /* Make the sidebar fixed */
    top: 0;
    left: 0;
    height: 100vh; /* Full height */
    z-index: 1000; /* Ensure it stays on top */
    min-width: 260px;
    max-width: 260px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    transition: all 0.3s;
    overflow-y: auto; /* Allow sidebar to scroll if its content overflows */
}

#sidebar.active {
    margin-left: -260px;
}

.sidebar-header {
    padding: 20px;
    background: var(--sidebar-bg);
    border-bottom: 1px solid #374151;
    text-align: center;
}

.sidebar-header h3 {
    color: var(--white);
    font-weight: 700;
}

#sidebar ul.components {
    padding: 20px 0;
}

#sidebar ul p {
    color: var(--white);
    padding: 10px 20px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8em;
}

#sidebar ul li a {
    padding: 15px 20px;
    font-size: 1.1em;
    display: block;
    color: var(--sidebar-text);
    border-left: 3px solid transparent;
    transition: all 0.2s ease-in-out;
}

#sidebar ul li a:hover {
    color: var(--white);
    background: #1f2937;
}

#sidebar ul li.active>a,
#sidebar ul li a[aria-expanded="true"] {
    color: var(--white);
    background: var(--sidebar-active);
    border-left: 3px solid var(--primary-hover);
}

#sidebar ul li a i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
}


/* --------------------------------------------------------------------------
 * 4. Top Header / Navbar
 * -------------------------------------------------------------------------- */

.navbar {
    padding: 1rem;
    background-color: var(--white);
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

#sidebarCollapse {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--secondary-color);
}


/* --------------------------------------------------------------------------
 * 5. Footer
 * -------------------------------------------------------------------------- */

.site-footer {
    padding-top: 2rem;
    margin-top: auto;
    text-align: center;
}

.site-footer p {
    color: #94a3b8; /* A muted, modern gray for the text */
    font-size: 0.9em;
}


/* --------------------------------------------------------------------------
 * 6. General Component Overrides
 * -------------------------------------------------------------------------- */

.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}


/* --------------------------------------------------------------------------
 * 7. Responsive Design
 * -------------------------------------------------------------------------- */

@media (max-width: 768px) {
    #sidebar {
        margin-left: -260px;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 999;
    }
    #sidebar.active {
        margin-left: 0;
    }
    #sidebarCollapse {
        display: block;
    }
}

/* --- Styles for Authentication Pages --- */

.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background-color: var(--light-gray); /* Uses the light gray from your main theme */
}

.auth-card {
    width: 100%;
    max-width: 450px;
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.auth-card .card-body {
    padding: 2rem;
}

.auth-card .card-title {
    font-weight: 700;
}


/* --- Add these styles to the end of style.css --- */

/* Styles for the Dashboard Page */
.dashboard-header h1 {
    font-weight: 700;
    color: #111827; /* Darker text for headings */
}

.stat-card .card-body {
    display: flex;
    flex-direction: column;
}

.stat-card .card-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--secondary-color);
}

.stat-card .card-text {
    font-size: 2.5rem;
    font-weight: 700;
    color: #111827;
    margin-top: auto; /* Pushes the number to the bottom */
}

/* --- Styles for Projects Page --- */

.project-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: 1px solid var(--border-color);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.project-card .card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
}

.project-card .card-footer {
    background-color: transparent;
    border-top: 1px solid var(--border-color);
}

.project-card .task-list {
    font-size: 0.9em;
}

.project-card .task-list li {
    padding: 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Styles for Modern Task Board --- */

.kanban-column .card-header {
    border-bottom: 3px solid;
    padding: 1rem 1.25rem;
}

.kanban-column .card-header h5 {
    font-weight: 600;
    margin-bottom: 0;
}

/* Specific header colors for each column */
#kanban-todo .card-header { border-color: #ffc107; } /* Warning Yellow */
#kanban-inprogress .card-header { border-color: #0d6efd; } /* Primary Blue */
#kanban-completed .card-header { border-color: #198754; } /* Success Green */

.kanban-column .card-body {
    padding: 10px;
    background-color: #f8f9fa; /* A slightly off-white for the column background */
    min-height: 240px;
    border-radius: 0 0 0.5rem 0.5rem;
    transition: background-color 0.2s ease-in-out;
}

/* Style for when a task is being dragged over a column */
.kanban-column.drag-over {
    background-color: #e9ecef;
}

.task-card {
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--secondary-color);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: grab;
}

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

.task-card.dragging {
    opacity: 0.5;
    transform: rotate(3deg);
}

/* Color-code the left border based on priority */
.task-card[data-priority="Low"] { border-left-color: #198754; } /* Success Green */
.task-card[data-priority="Medium"] { border-left-color: #ffc107; } /* Warning Yellow */
.task-card[data-priority="High"] { border-left-color: #dc3545; } /* Danger Red */

.task-card .card-body {
    padding: 0.75rem;
    background-color: var(--white);
}

.task-card .card-title {
    font-weight: 600;
    color: #344054; /* A darker text color for titles */
}

.task-card .task-actions {
    opacity: 0; /* Hide actions by default */
    transition: opacity 0.2s;
}

.task-card:hover .task-actions {
    opacity: 1; /* Show actions on hover */
}


/* --- NEW Styles for Elegant Task Cards --- */

.task-card .card-body {
    padding: 0.8rem;
    font-size: 1.1em;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.task-card .card-title {
    font-weight: 600;
    color: #344054;
    line-height: 1.3;
}

/* Scrollable Description Area */
.task-description-wrapper {
    margin: 0.5rem 0;
    font-size: 0.9em;
    color: #6c757d;
    max-height: 180px; /* Approx. 2 lines of text */
    overflow-y: auto; /* Enable vertical scrolling if content overflows */
    padding-right: 5px; /* Add some space for the scrollbar */
}

/* Subtle scrollbar styling for modern browsers */
.task-description-wrapper::-webkit-scrollbar {
    width: 6px;
}
.task-description-wrapper::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 3px;
}

/* Footer section inside the card */
.task-card-footer {
    margin-top: auto; /* Pushes the footer to the bottom */
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.task-meta-item {
    display: flex;
    align-items: center;
    color: #6c757d;
}

.task-meta-item i {
    margin-right: 6px;
    width: 12px;
}

/* Priority badge styling */
.priority-badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
}

.priority-badge-Low { background-color: #d1fae5; color: #065f46; }
.priority-badge-Medium { background-color: #fef3c7; color: #92400e; }
.priority-badge-High { background-color: #fee2e2; color: #991b1b; }


/* --------------------------------------------------------------------------
 * 8. Tag Styles
 * -------------------------------------------------------------------------- */

/* Tagify input container customization */
.tagify {
    --tags-border-color: var(--border-color);
    --tags-focus-border-color: var(--primary-color);
    border-radius: 0.375rem; /* Match form-control */
}
.tagify:hover {
    border-color: var(--tags-focus-border-color);
}

/* Individual tags within the Tagify input */
.tagify__tag {
    background-color: var(--primary-color);
    color: white;
    border-radius: 0.25rem;
    padding: 0.3em 0.6em;
    margin: 3px;
}
.tagify__tag__removeBtn {
    color: white;
    opacity: 0.7;
}
.tagify__tag__removeBtn:hover {
    background-color: var(--primary-hover);
    opacity: 1;
}

/* Dropdown suggestions to match our theme */
.tagify__dropdown__wrapper {
    border-radius: 0.375rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}
.tagify__dropdown__item {
    padding: 0.5rem 0.75rem;
}
.tagify__dropdown__item--active {
    background: var(--primary-color);
    color: white;
}

/* Tags on Kanban cards */
.task-tags-wrapper {
    margin-bottom: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 6px; /* Spacing between tags */
}
.tag-badge {
    background-color: #e5e7eb; /* Light gray */
    color: #4b5563;           /* Darker gray text */
    font-weight: 500;
    padding: 0.3em 0.7em;
    border-radius: 9999px;     /* Pill shape */
    font-size: 0.8em;
}

/* Sidebar tag styles removed */

/* --- Attachment UI Styles --- */
.border-dashed {
    border: 2px dashed var(--border-color);
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

#attachment-dropzone.drag-over {
    background-color: #eef2ff; /* A light, modern indigo tint */
    border-color: var(--primary-color);
}

.attachment-item .attachment-name {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}