:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    
    --light-color: #f8f9fa;
    --dark-color: #343a40; 
    --border-color: #dee2e6;
    --body-bg: #f8f9fa;
    --container-bg: #ffffff;
}

html.dark-mode {
    --primary-color: #3391ff;
    --secondary-color: #555555;
    
    --light-color: #2c2c2e;
    --dark-color: #f0f0f0;
    --border-color: #484848;
    --body-bg: #1c1c1e;
    --container-bg: #2c2c2e;
}

body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;background-color:var(--body-bg);color:var(--dark-color);margin:0;padding:20px}
body.modal-open, body.modal-open html { overflow: hidden; }
.container{max-width:800px;margin:0 auto;background-color:var(--container-bg);padding:20px;border-radius:8px;box-shadow:0 2px 10px rgba(0,0,0,.1); transition: max-width 0.4s ease-in-out;}
.container.container-fluid { max-width: 1600px; }
h1,h2{color:var(--primary-color);text-align:center}
.form-group{margin-bottom:15px}
label{display:block;margin-bottom:5px;font-weight:700}
input[type=text],input[type=password],input[type=datetime-local], input[type=date], textarea,select{width:100%;padding:8px;border:1px solid var(--border-color);border-radius:4px;box-sizing:border-box; background-color: var(--container-bg); color: var(--dark-color);}
button{padding:10px 15px;border:none;border-radius:4px;color:#fff;cursor:pointer;font-size:14px}
.btn-primary{background-color:var(--primary-color)}
.btn-success{background-color:var(--success-color)}
.btn-warning{background-color:var(--warning-color)}
.btn-danger{background-color:var(--danger-color)}
.btn-secondary{background-color:var(--secondary-color);color:#fff}
.task-list,.project-list{list-style:none;padding:0}
.task-item{background-color:var(--light-color);border:1px solid var(--border-color);padding:15px;margin-bottom:10px;border-radius:5px}
.project-item{display:flex;justify-content:space-between;align-items:center;padding:8px;border-bottom:1px solid var(--border-color)}

.task-item h3 { margin: 0 0 10px; }
.task-description { flex-grow: 1; margin: 0 15px 0 0; color: #555; }
html.dark-mode .task-description { color: #b0b0b0; }
.task-description p { margin: 0; } 

.status-badge,.priority-badge{padding:3px 8px;border-radius:12px;font-size:.8em;color:#fff;display:inline-block;vertical-align:middle; margin-left: 8px;}
.status-pending{background-color:var(--secondary-color)}
.status-in-progress{background-color:var(--success-color)}
.status-paused{background-color:var(--warning-color);color:var(--dark-color)}
.status-completed{background-color:var(--success-color);padding:5px 12px;font-size:.9em}
.priority-high{background-color:var(--danger-color)}
.priority-medium{background-color:var(--warning-color);color:var(--dark-color)}
.priority-low { background-color: var(--secondary-color); }
#login-container{max-width:400px}

.app-header h1 {
    margin-bottom: 2px;
    text-align: left;
}
#welcome-message {
    color: var(--secondary-color);
    font-size: 0.9em;
}

.task-body-content { display: flex; justify-content: space-between; align-items: center; }
.app-header,.add-task-header,.modal-header{display:flex;justify-content:space-between;align-items:center}

.app-header{margin-bottom:20px}
.modal-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.5);display:none;justify-content:center;align-items:center;z-index:1000;padding:20px 0;}
.modal-content{background-color:var(--container-bg);padding:20px;border-radius:8px;width:90%;max-width:600px;box-shadow:0 5px 15px rgba(0,0,0,.3); margin: auto; display: flex; flex-direction: column; max-height: 88vh;}
.modal-header{border-bottom:1px solid var(--border-color);padding-bottom:10px;margin-bottom:20px}
.modal-header h2{margin:0;text-align:left}
.close-button{background:none;border:none;font-size:1.5rem;cursor:pointer;color:var(--secondary-color)}
.task-right-panel{display:flex;align-items:center;flex-shrink:0}
.task-timer{font-size:1.2em;font-weight:700;color:var(--dark-color);margin-right:20px}
.task-actions{display:flex;gap:5px;justify-content:flex-end;min-width:370px}
.task-meta{font-size:.8em;color:var(--secondary-color);margin-top:10px;padding-top:10px;border-top:1px solid var(--border-color);display:flex;flex-wrap:wrap;gap:0 10px; align-items: center;}
.view-details-link, .insights-link {cursor:pointer;color:var(--primary-color);text-decoration:none;}
        .view-details-link:hover, .insights-link:hover {text-decoration:underline;}

.modal-body, .details-modal-body { overflow-y: auto; padding-bottom: 20px; }

#edit-task-modal .modal-content {
    padding-right: 5px;
}
#edit-task-modal .modal-body {
    padding-right: 15px;
}

.details-modal-body p{margin: 15px 0 5px;}
.details-modal-body strong{color:var(--dark-color)}
.details-content-box{background-color:var(--body-bg);border:1px solid var(--border-color);border-radius:4px;padding:10px;min-height:50px;white-space:pre-wrap;margin-top:0}
#details-time-logs { max-height: 200px; overflow-y: auto; }
.time-log-table{width:100%;border-collapse:collapse;margin-top:0}
.time-log-table th,.time-log-table td{text-align:left;padding:8px;border-bottom:1px solid var(--border-color)}
.time-log-table th{background-color:var(--light-color); position: sticky; top: 0;}
.filter-bar { display: flex; gap: 15px; margin-bottom: 20px; align-items: center; flex-wrap: wrap; }
.filter-bar .form-group { flex-grow: 1; margin-bottom: 0; }
.day-group-header { margin-top: 25px; margin-bottom: 10px; color: var(--secondary-color); font-weight: bold; border-bottom: 2px solid var(--border-color); padding-bottom: 5px; }
.add-task-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

.add-task-actions-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap; 
    justify-content: space-between;
}
.quick-actions-group {
    display: flex;
    align-items: center;
    gap: 10px;
}
.quick-actions-group span {
    font-weight: 700;
    color: var(--dark-color);
}

.tasks-header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    scroll-margin-top: 20px; 
}
.tasks-header h2 {
    margin: 0;
    display: inline-block;
}

.export-status-options {
    display: flex; flex-wrap: wrap; gap: 10px 20px; margin-bottom: 20px;
}
.export-status-options label {
    display: flex; align-items: center; gap: 5px; font-weight: normal;
}
.export-modal-actions, .remarks-modal-actions, .modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.dashboard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}
.stat-card {
    background-color: var(--light-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.stat-card .stat-number {
    font-size: 2em;
    font-weight: 700;
    display: block;
    margin-bottom: 5px;
}
.stat-card .stat-label {
    font-size: 0.9em;
    color: var(--secondary-color);
}
.stat-number.overdue { color: var(--danger-color); }
.stat-number.pending { color: var(--secondary-color); }
.stat-number.paused { color: var(--warning-color); }
.stat-number.completed { color: var(--success-color); }

.header-actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}
.settings-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--container-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
    list-style: none;
    padding: 5px 0;
    margin: 5px 0 0 0;
    min-width: 220px;
}
.settings-dropdown.show {
    display: block;
}
.settings-dropdown li a {
    display: block;
    padding: 8px 15px;
    color: var(--dark-color);
    text-decoration: none;
    white-space: nowrap;
}
.settings-dropdown li a:hover {
    background-color: var(--light-color);
}
.dropdown-divider {
    border-top: 1px solid var(--border-color);
    margin: 5px 0;
}

#bulk-add-modal .modal-content { max-width: 90vw; }
.bulk-add-table-container { overflow-x: auto; margin-bottom: 15px; }
.bulk-add-table { width: 100%; min-width: 750px; border-collapse: collapse; }
.bulk-add-table th, .bulk-add-table td { padding: 8px; border: 1px solid var(--border-color); vertical-align: top; }
.bulk-add-table th { background-color: var(--light-color); text-align: left; }
.bulk-add-table input, .bulk-add-table textarea, .bulk-add-table select { width: 100%; padding: 4px; font-size: 14px; }
.bulk-add-table td:nth-child(1) { width: 30%; }
.bulk-add-table td:nth-child(2) { width: 30%; }
.bulk-add-table td:nth-child(3) { width: 15%; }
.bulk-add-table td:nth-child(4) { width: 15%; }
.bulk-add-table td:nth-child(5) { width: 10%; }

.bulk-add-actions { display: flex; justify-content: space-between; align-items: center; }
.bulk-add-actions > div { display: flex; gap: 10px; }

.manual-actions-view {
    display: flex;
    gap: 10px;
}

#import-controls-container {
    padding-top: 10px;
    padding-bottom: 10px;
    margin-bottom: 20px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s ease-in-out;
    border: 0px dashed var(--border-color);
}
#import-controls-container.visible {
    max-height: 100px;
    opacity: 1;
    border-width: 1px;
}
.import-instructions { font-size: 0.9em; color: var(--secondary-color); margin-bottom: 10px; text-align: center; }
.import-actions { display: flex; justify-content: center; gap: 10px; align-items: center; }
.bulk-add-manual-actions { transition: opacity 0.3s ease; }
.bulk-add-manual-actions.hidden { opacity: 0; pointer-events: none; }
input[type="file"] { display: none; }
.custom-file-upload { padding: 8px 12px; border: 1px solid var(--secondary-color); border-radius: 4px; display: inline-block; cursor: pointer; background-color: #fff; color: var(--dark-color); font-size: 14px; }

.subtask-section {
    margin-top: 15px;
    margin-bottom: 15px;
}
#add-subtask-link {
    cursor: pointer;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9em;
}
#add-subtask-link:hover { text-decoration: underline; }
#subtask-input-container { display: none; margin-top: 10px; }
#subtask-list { list-style: none; padding: 0; margin-bottom: 10px; }
.subtask-list-item {
    display: flex;
    align-items: center;
    background-color: var(--light-color);
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 5px;
}
.subtask-list-item span { flex-grow: 1; }
.subtask-adder { display: flex; gap: 10px; }
.subtask-adder input { flex-grow: 1; }
.subtask-adder button, .subtask-list-item button {
    padding: 8px 12px;
    font-size: 14px;
}

.task-subtasks-container {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}
.subtask-summary { cursor: pointer; color: var(--secondary-color); font-size: 0.9em; }
.subtask-summary-icon { display: inline-block; font-style: normal; margin-right: 5px; }
.subtask-checklist {
    list-style: none;
    padding-left: 10px;
    margin: 10px 0 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, margin-top 0.4s ease-out;
}
.subtask-checklist.expanded {
     max-height: 250px;
     overflow-y: auto;
     transition: max-height 0.5s ease-in;
}
.subtask-checklist li {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}
.subtask-checklist input[type="checkbox"] { margin-right: 10px; width: auto; }
.subtask-checklist label { margin-bottom: 0; flex-grow: 1; transition: color 0.3s; }
.subtask-checklist input[type="checkbox"]:checked + label {
    text-decoration: line-through;
    color: var(--secondary-color);
}
.subtask-checklist input[type="checkbox"]:disabled + label {
    color: #bbb;
    cursor: not-allowed;
}
.subtask-completion-date {
    font-size: 0.8em;
    color: var(--secondary-color);
    margin-left: auto;
    padding-left: 10px;
}

#edit-task-modal .modal-body {
    overflow-y: auto;
}
#edit-subtask-list {
    list-style: none;
    padding: 10px;
    margin-top: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--light-color);
}
.edit-subtask-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.edit-subtask-item input {
    flex-grow: 1;
}

.recycle-bin-info {
    font-size: 0.9em;
    color: var(--secondary-color);
    text-align: center;
    margin-bottom: 15px;
}
.recycle-bin-table-container, .recurring-tasks-table-container {
    overflow-y: auto;
    max-height: 50vh;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}
.recycle-bin-table, .recurring-tasks-table {
    width: 100%;
    border-collapse: collapse;
}
.recycle-bin-table th, .recycle-bin-table td,
.recurring-tasks-table th, .recurring-tasks-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.recycle-bin-table th, .recurring-tasks-table th {
    background-color: var(--light-color);
    position: sticky;
    top: 0;
}
.recycle-bin-table td:last-child, .recurring-tasks-table td:last-child {
    text-align: right;
}
.recycle-bin-actions, .recurring-task-actions {
    display: flex;
    gap: 5px;
    justify-content: flex-end;
}
.recycle-bin-subtask-count {
    font-size: 0.9em;
    color: var(--secondary-color);
    margin-left: 8px;
}

#details-comments-container {
    background-color: var(--body-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px;
}
#details-comments-list {
    margin: 0;
    padding: 0;
}
.comment-item {
    background-color: var(--container-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px 12px;
    margin-bottom: 10px;
}
.comment-item:last-child {
    margin-bottom: 0;
}
.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.comment-author {
    font-weight: bold;
    color: var(--dark-color);
}
.comment-date {
    color: var(--secondary-color);
    font-size: 0.8em;
    display: flex;
    align-items: center;
    gap: 5px;
}
.comment-date .edited-marker {
    font-style: italic;
}
.comment-body p {
    margin: 0;
    font-size: 0.95em;
    word-wrap: break-word;
    white-space: pre-wrap;
}
.comment-form {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}
.comment-form textarea {
    min-height: 60px;
    margin-bottom: 10px;
}
.comment-form-actions {
    display: flex;
    justify-content: flex-end;
}
.comment-form-actions button {
    padding: 8px 20px;
}
#details-comments-list em {
    display: block;
    text-align: center;
    padding: 20px;
    color: var(--secondary-color);
}

.comment-actions {
    font-size: 0.8em;
}
.comment-actions a {
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: none;
    margin-left: 10px;
}
.comment-actions a:hover {
    text-decoration: underline;
}
.comment-edit-view {
    margin-top: 8px;
}
.comment-edit-view textarea {
    width: 100%;
    min-height: 60px;
}
.comment-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 5px;
}
.comment-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--dark-color);
}
.comment-indicator .icon {
    font-size: 1.2em;
}

.comment-reply-section {
    padding-left: 30px;
    margin-top: 10px;
    border-left: 2px solid var(--border-color);
}
.comment-reply-form {
    display: none;
    margin-top: 10px;
}
.comment-reply-form textarea {
    min-height: 50px;
    font-size: 0.9em;
}
.comment-reply-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 5px;
}

.theme-switcher {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
}
.theme-switcher span {
    color: var(--dark-color);
}
.theme-switcher .buttons {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}
.theme-switcher button {
    background-color: transparent;
    color: var(--dark-color);
    border: none;
    border-left: 1px solid var(--border-color);
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
}
.theme-switcher button:first-child {
    border-left: none;
}
.theme-switcher button.active {
    background-color: var(--primary-color);
    color: #fff;
}

.shortcuts-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
.shortcuts-table td { padding: 10px; border-bottom: 1px solid var(--border-color); }
.shortcuts-table td:first-child { font-weight: bold; color: var(--primary-color); padding-right: 20px; }
.shortcuts-table tr:last-child td { border-bottom: none; }
.shortcuts-table code {
    background-color: var(--light-color);
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

.task-meta .assignee-info {
    font-style: italic;
}

.stats-toggle-container {
    text-align: center;
    margin-bottom: 20px;
}
.stats-toggle, .recurring-frequency-switcher {
    display: inline-flex;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}
.stats-toggle button, .recurring-frequency-switcher button {
    background-color: transparent;
    color: var(--dark-color);
    border: none;
    border-left: 1px solid var(--border-color);
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px;
}
.stats-toggle button:first-child, .recurring-frequency-switcher button:first-child {
    border-left: none;
}
.stats-toggle button.active, .recurring-frequency-switcher button.active {
    background-color: var(--primary-color);
    color: #fff;
}

.invite-code-container {
    display: flex;
    gap: 10px;
    align-items: center;
}
#invite-code {
    font-family: monospace;
    font-size: 1.2em;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--light-color);
    flex-grow: 1;
}
.team-members-list {
    list-style: none;
    padding: 0;
    margin-top: 10px;
    max-height: 150px;
    overflow-y: auto;
}
.team-members-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
}
.team-members-list li:last-child {
    border-bottom: none;
}
#join-team-message, #team-management-message {
    margin-top: 10px;
}
#leave-team-section p {
    margin-bottom: 15px;
}

.recurring-options-container {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--body-bg);
    min-height: 24px;
    display: none;
}
.recurring-options-container.visible {
    display: block;
}
.recurring-options-container .daily-options,
.recurring-options-container .weekly-options,
.recurring-options-container .monthly-options {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.recurring-options-container .daily-options label {
    font-weight: normal; margin-bottom: 0; display: flex; align-items: center; gap: 4px; font-size: 0.9em;
}
.recurring-options-container input[type="checkbox"] { width: auto; }
.recurring-options-container input[type="number"] { width: 80px; padding: 4px; font-size: 14px; }
.recurring-options-container select { padding: 4px; font-size: 14px; }

#activity-log-modal .modal-content {
    max-width: 800px;
}
.activity-log-table-container {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    max-height: 260px;
    overflow-y: auto;
    margin-top: 15px;
}
.activity-log-table {
    width: 100%;
    border-collapse: collapse;
}
.activity-log-table th, .activity-log-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.activity-log-table th {
    background-color: var(--light-color);
    position: sticky;
    top: 0;
}
.activity-log-table td:last-child {
    font-family: monospace;
    font-size: 0.9em;
}

/* START: New Styles for Insights Feature */
textarea[readonly] {
    background-color: var(--body-bg);
    color: var(--secondary-color);
    border-style: dashed;
    cursor: default;
}
html.dark-mode textarea[readonly] {
    color: #a9a9a9;
}
.manager-feedback-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}
.manager-feedback-readonly {
    background-color: var(--body-bg);
    border: 1px dashed var(--border-color);
    border-radius: 4px;
    padding: 10px;
    min-height: 50px;
    white-space: pre-wrap;
}
/* END: New Styles for Insights Feature */

html.dark-mode hr {
    border-color: var(--border-color);
    border-top-style: solid;
}

html.dark-mode .custom-file-upload {
    background-color: var(--light-color);
    color: var(--dark-color);
    border-color: var(--secondary-color);
}
html.dark-mode .task-meta,
html.dark-mode .subtask-summary,
html.dark-mode .comment-date,
html.dark-mode .notification-item .timestamp {
    color: #a9a9a9;
}
html.dark-mode .stat-label,
html.dark-mode #welcome-message,
html.dark-mode .recycle-bin-info,
html.dark-mode #details-comments-list em,
html.dark-mode #no-notifications-msg {
    color: #cccccc;
}
html.dark-mode .day-group-header {
    color: var(--dark-color);
}
html.dark-mode .status-paused,
html.dark-mode .priority-medium {
    color: #343a40;
}
html.dark-mode input[type=datetime-local],
html.dark-mode input[type=date],
html.dark-mode input[type=number] {
    color-scheme: dark;
}

@media (max-width: 768px){
    .dashboard { grid-template-columns: repeat(2, 1fr); }
    .task-body-content{flex-direction:column;align-items:flex-start}
    .task-description{margin-right:0;width:100%; margin-bottom: 15px;}
    .task-right-panel{width:100%;justify-content:space-between}
    
    .task-actions{
        min-width:auto;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .delete-button-wrapper {
        width: 100%;
        text-align: right; 
        margin-top: 10px;
    }

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

    select {
        font-size: 16px; 
        -webkit-appearance: none;
        appearance: none;
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 0.75rem center;
        background-size: 16px 12px;
        padding-right: 2.5rem;
    }
}

@media (max-width: 480px) {

}
