/* --- Modal Styles --- */
.modal-overlay {
    position: fixed; /* Sit on top of everything */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Semi-transparent black background */
    display: flex; /* Use flexbox to center content */
    justify-content: center;
    align-items: center;
    z-index: 2000; /* Higher than the header */
	overflow: scroll;
}

.modal-content {
    background-color: #fff;
    padding: 30px 40px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    min-width: 500px; /* Or adjust as needed */
    max-width: 90%;
    position: relative; /* For positioning the close button */
    overflow: scroll;
  	margin:auto;
}

@media (400px <= width <= 650px) {
  .media-content {
    margin-top:100px;
  }
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 25px;
    text-align: center;
    color: #333;
}

/* Header Area */
#taskDetailModal .view-mode h2 { /* Target specific modal title */
    font-size: 1.8rem; /* Larger title */
    font-weight: 600;
    color: #212529;
    margin-top: 0;
    margin-bottom: 15px; /* Space below title */
}

.task-meta-header {
    display: flex;
    align-items: center;
    gap: 10px; /* Space between pills/avatar */
    margin-bottom: 25px; /* Space below meta row */
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 12px; /* Rounded pill shape */
    background-color: #f1f3f5; /* Default light grey */
    color: #495057; /* Darker grey text */
    border: 1px solid #dee2e6;
}
.meta-pill i {
    font-size: 0.8em; /* Smaller icon */
    color: #6c757d; /* Muted icon color */
}
/* Specific pill colors */
.priority-pill-low { background-color: #d4edda; border-color: #c3e6cb; color: #155724; }
.priority-pill-medium { background-color: #fff3cd; border-color: #ffeeba; color: #856404; }
.priority-pill-high { background-color: #f8d7da; border-color: #f5c6cb; color: #721c24; }
.date-pill.overdue { background-color: #f8d7da; border-color: #f5c6cb; color: #721c24; font-weight: 600;}

.meta-assignee-group {
    margin-left: auto; /* Push assignee to the right */
    display: flex;
    align-items: center;
}
.meta-avatar.avatar.small { /* Style the avatar in the meta header */
   width: 28px;
   height: 28px;
   font-size: 0.8em; /* Adjust if using initials */
   border: 1px solid #dee2e6;
}

/* Close button styling */
.modal-close-btn {
    position: absolute;
    top: 18px; /* Adjust position */
    right: 20px;
    font-size: 1.8rem; /* Slightly smaller? */
    color: #aaa;
    /* Remove default button styles */
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}
 .modal-close-btn:hover {
    color: #333;
 }


/* Basic Form Styling */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit; /* Use the body's font */
}

.form-actions {
    margin-top: 25px;
    display: flex;
    justify-content: flex-end; /* Align buttons to the right */
    gap: 10px;
}

/* Use button styles we already have, maybe add a secondary style */
.btn-secondary { /* Example style for Cancel button */
    background-color: #eee;
    color: #333;
    border: 1px solid #ccc;
}
 .btn-secondary:hover {
    background-color: #ddd;
 }
/* Tweak primary button if needed */
 .modal-content .btn-primary {
    background-color: #007bff; /* Example primary color */
    color: white;
    border: none;
 }
 .modal-content .btn-primary:hover {
     background-color: #0056b3;
 }

 /* --- Additions/Refinements for Detail Modal --- */

/* Content Sections */
.detail-section {
    margin-bottom: 25px;
    padding-bottom: 0; /* Remove bottom padding */
    border-bottom: none; /* Remove bottom border */
}
.detail-section:last-of-type {
     border-bottom: none; /* No border for the last section */
     margin-bottom: 0; /* Adjust spacing before actions */
}

.detail-section strong { /* Section labels */
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 8px;
    text-transform: uppercase; /* Optional: Uppercase labels */
}

.description-content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #495057;
    white-space: pre-wrap;
    word-wrap: break-word;
    background-color: #f8f9fa; /* Subtle background */
    border: 1px solid #e9ecef;
    padding: 10px 12px;
    border-radius: 4px;
    min-height: 40px;
}
.description-content em { /* Style "No description" text */
    color: #888;
}

/* Ensure assignee avatars in modal look okay */
#detailTaskAssignees {
    margin-top: 5px;
    /* avatar-group and avatar.small styles already exist */
}
#detailTaskAssignees .avatar.small {
    width: 28px; /* Slightly larger maybe */
    height: 28px;
    margin-left: -8px;
}


/* Style for the status badge (optional for now) */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 10px;
    margin-left: 10px;
    vertical-align: middle;
    /* Define specific status colors later */
    background-color: #e4e6ea; /* Default */
    color: #555;
}
.status-badge.upcoming { background-color: #e0eaff; color: #0052cc; }
.status-badge.in-progress { background-color: #fff3c4; color: #a05b00; }
.status-badge.done { background-color: #d4f7dc; color: #1d7f45; }

/* Comments Area */
.comments-area {
    border: 1px solid #e9ecef;
    background-color: #f8f9fa;
    border-radius: 4px;
    padding: 10px;
    max-height: 200px; /* Keep max-height */
    overflow-y: auto;
    margin-bottom: 15px;
}
.comments-area .loading-comments,
.comments-area .no-comments { color: #888; text-align: center; padding: 15px 0; }

.comment-item {
    background: none; /* Remove individual item background if list has one */
    border: none;
    border-bottom: 1px solid #e9ecef; /* Separator line */
    padding: 10px 5px;
    margin-bottom: 0;
}
.comment-item:last-child { border-bottom: none; }

.comment-header { font-size: 0.8rem; color: #6c757d; margin-bottom: 5px; }
.comment-author { font-weight: 600; color: #495057; }
.comment-timestamp { font-style: normal; margin-left: 5px; }
.comment-body { font-size: 0.95rem; color: #343a40; }
.comment-author .avatar.tiny { /* Ensure tiny avatar style exists */
     width: 20px; height: 20px; font-size: 0.7em; margin-right: 6px; display: inline-flex; vertical-align: middle;
     border-radius: 50%; align-items: center; justify-content: center; font-weight: bold; color: white;
}

/* Add Comment Form */
#addCommentForm label {
     font-size: 0.9rem; font-weight: 500; color: #495057; margin-bottom: 5px; display: block;
}
#addCommentForm textarea {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 8px 10px;
    width: 100%;
    box-sizing: border-box; /* Include padding/border in width */
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
}
#addCommentForm textarea:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}
.comment-form-actions { margin-top: 10px; justify-content: flex-end; }
#postCommentBtn { /* Specific styling for post button */
     background-color: #e9ecef; color: #495057; border: 1px solid #ced4da;
}
 #postCommentBtn:hover { background-color: #dee2e6; border-color: #adb5bd; }

/* Footer Action Buttons */
.modal-footer-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef; /* Separator line */
    display: flex;
    justify-content: flex-end; /* Right align */
    gap: 10px;
}
/* Update generic modal button styles if needed */
#taskDetailModal .btn-secondary { /* Edit, Close */
    background-color: #e9ecef;
    color: #495057;
    border: 1px solid #ced4da;
}
 #taskDetailModal .btn-secondary:hover { background-color: #dee2e6; }
 #taskDetailModal .btn-danger { /* Delete */
      background-color: #dc3545; color: white; border: none;
 }
  #taskDetailModal .btn-danger:hover { background-color: #c82333; }

/* Ensure Edit Mode form groups have adequate spacing */
#editTaskForm .form-group { margin-bottom: 15px; }