/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --light: #f8fafc;
    --dark: #1e293b;
    --gray: #94a3b8;
    --border: #e2e8f0;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --modal-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    --sidebar-bg: white;
    --header-bg: white;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --background: #f1f5f9;
    --purple: #8b5cf6;
    --orange: #f97316;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Text Utilities */
.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

.text-info {
    color: var(--info);
}

.text-success {
    color: var(--success);
}

/* Navigation */
.navbar {
    background: var(--header-bg);
    padding: 0 2rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--card-shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

/* Updated CSS */
.project-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.overview-card {
    background: var(--light);
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.overview-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.overview-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timeline-item,
.stats-item {
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timeline-item .label,
.stats-item .label {
    font-size: 0.85rem;
    color: var(--secondary);
    flex: 1;
}

.timeline-item .value,
.stats-item .value {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--dark);
    flex: 1;
    text-align: right;
}

.status-active {
    background-color: #d1fae5;
    color: #10b981;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.progress-bar-container {
    margin-top: 1rem;
}

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease-in-out;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
}

.progress-info .label {
    color: var(--secondary);
    flex: 1;
}

.progress-info .value {
    font-weight: 600;
    color: var(--dark);
    flex: 1;
    text-align: right;
}

/* css/styles.css */

/* Bulk Actions Bar */
.bulk-actions-bar {
    display: none;
    /* Hidden by default, controlled by JS */
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: var(--light);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
}

.bulk-actions-bar.show {
    display: block;
}

/* End Bulk Actions Bar */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

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

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
}

.nav-link.active {
    background: transparent;
    /* Remove or lighten background */
    color: var(--primary);
    /* Use primary color */
    border-bottom: 2px solid var(--primary);
    /* Add bottom border */
    border-radius: 0;
    /* Remove border-radius if using border */
}

.nav-link:hover,
.nav-link.active {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
}

.nav-link i {
    font-size: 1.1rem;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-user img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

/* Theme Toggle */
.theme-toggle {
    position: relative;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--light);
    transform: rotate(15deg);
}

.theme-toggle i {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* Notification Bell */
.notification-bell {
    position: relative;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.notification-bell:hover {
    background: var(--light);
    border-radius: 50%;
}

.notification-bell i {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.notification-badge.has-unread {
    /* Add a class when unread count > 0 */
    animation: pulse 2s infinite;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    /* Add animation */
    transition: transform 0.2s ease;
}

/* Notification Dropdown */
.notification-dropdown {
    opacity: 0;
    transform: translateY(-10px);
    /* Start slightly above */
    transition: opacity 0.2s ease, transform 0.2s ease;
    position: absolute;
    top: 64px;
    right: 200px;
    background: var(--header-bg);
    border-radius: 0.75rem;
    box-shadow: var(--modal-shadow);
    width: 350px;
    z-index: 1000;
    display: none;
}

.notification-dropdown.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.notification-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.notification-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: var(--light);
    transform: translateX(2px);
}

.notification-item.unread {
    background: #f0f9ff;
}

.notification-content {
    display: flex;
    gap: 0.75rem;
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.notification-item:hover .notification-icon {
    transform: scale(1.1);
}

.icon-task-due {
    background: var(--warning);
    color: white;
}

.icon-task-completed {
    background: var(--success);
    color: white;
}

.icon-task-assigned {
    background: var(--primary);
    color: white;
}

.icon-project {
    background: var(--info);
    color: white;
}

.notification-text h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.notification-text p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.notification-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--gray);
}

.notification-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.notification-footer a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
}

.notification-footer a:hover {
    text-decoration: underline;
}

/* Main Content */
.main-content {
    margin-top: 64px;
    padding: 2rem;
    min-height: calc(100vh - 64px);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

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

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Section Header */
.section-header {
    margin: 2rem 0 1rem 0;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Stats Cards */
.stat-card {
    background: var(--header-bg);
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.bg-blue {
    background: var(--primary);
}

.bg-green {
    background: var(--success);
}

.bg-orange {
    background: var(--warning);
}

.bg-purple {
    background: var(--info);
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.stat-info p {
    color: var(--text-secondary);
    margin: 0;
}

/* Grid Layouts */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
    background: var(--header-bg);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

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

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

/* css/styles.css */

/* Form Validation Styles */
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
    /* var(--danger) with low opacity */
}

.form-group.has-error input:focus,
.form-group.has-error select:focus,
.form-group.has-error textarea:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
}

.error-message {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 0.25rem;
    display: block;
    /* Ensure it behaves like a block element */
}

/* End Form Validation Styles */
.modal-content {
    background-color: var(--header-bg);
    margin: 5% auto;
    padding: 0;
    border-radius: 0.75rem;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--modal-shadow);
    animation: modalSlideIn 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.close {
    font-size: 1.8rem;
    font-weight: 300;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close:hover {
    color: var(--text-primary);
    background: var(--light);
}

/* css/styles.css - Add these styles */

/* Sortable Table Styles */
th.sortable {
    user-select: none;
    /* Prevent text selection on double click */
}

.sort-indicator {
    font-size: 0.8em;
    color: var(--secondary);
    transition: color 0.2s;
}

th.sortable:hover .sort-indicator {
    color: var(--primary);
    /* Highlight on hover */
}

/* End Sortable Table Styles */
.modal-body {
    padding: 1.5rem;
    max-height: calc(90vh - 150px);
    overflow-y: auto;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Dropdown Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    background: none;
    border: 1px solid var(--border);
    padding: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
}


.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--header-bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: var(--modal-shadow);
    min-width: 200px;
    z-index: 1000;
    display: none;
    margin-top: 0.5rem;
    transform-origin: top right;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background-color: var(--light);
}

.dropdown-menu a.danger:hover {
    background-color: #fee2e2;
    color: var(--danger);
}

.dropdown-menu a i {
    width: 16px;
    text-align: center;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

/* Specific styles for task dropdowns */
.task-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--header-bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: var(--modal-shadow);
    min-width: 200px;
    z-index: 1000;
    display: none;
    margin-top: 0.5rem;
    transform-origin: top right;
}

.task-dropdown-menu.show {
    display: block;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--gray);
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* Loading Spinner */
.loading-spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    display: none;
    /* Hidden by default */
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Progress Bars */
.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Notifications */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    background: var(--success);
    color: white;
    box-shadow: var(--modal-shadow);
    z-index: 2000;
    display: none;
}

.notification.show {
    display: block;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 0 1rem;
    }

    .nav-menu {
        gap: 1rem;
    }

    .nav-link span {
        display: none;
    }

    .nav-link i {
        font-size: 1.25rem;
    }

    .main-content {
        padding: 1rem;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .notification-dropdown {
        right: 10px;
        left: 10px;
        width: auto;
    }

    .theme-toggle {
        cursor: pointer;
        padding: 0.5rem;
        margin-right: 1rem;
        border-radius: 50%;
        transition: all 0.3s ease;
    }

    .notification-bell {
        margin-right: 0.5rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* --- Custom Form Elements --- */
/* Custom Checkbox Container */
.custom-checkbox-container {
    display: block;
    position: relative;
    padding-left: 35px; /* Make space for the checkmark */
    min-height: 22px;   /* Ensure it has height for clicking */
    cursor: pointer;
    font-size: 1rem;
    user-select: none;
}

/* Hide the browser's default checkbox */
.custom-checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Create a custom checkbox */
.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 22px; /* Larger size */
    width: 22px;  /* Larger size */
    background-color: var(--light);
    border: 2px solid var(--border);
    border-radius: 4px;
    transition: all 0.2s;
}

/* On mouse-over, add a grey background color */
.custom-checkbox-container:hover input ~ .checkmark {
    background-color: #ccc;
}

/* When the checkbox is checked, add a green background */
.custom-checkbox-container input:checked ~ .checkmark {
    background-color: var(--success);
    border-color: var(--success);
}

/* Create the checkmark/indicator (hidden when not checked) */
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

/* Show the checkmark when checked */
.custom-checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

/* Style the checkmark/indicator */
.custom-checkbox-container .checkmark:after {
    left: 7px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}