/* Tasks Section Styles */
body {
    font-family: "Open Sans", sans-serif;
    margin: 0;
    padding: 0;
   
    min-height: 100vh;
}


/* Search and Filter Controls */
.tasks-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

  

    border-radius: 12px;
 
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.tasks-header {
    flex: 0 0 auto;
}

.tasks-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    font-family: 'Inter', sans-serif;
}

.search-container {
    position: relative;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 18px;
}

.task-count-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 20px;
}

.task-count {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    white-space: nowrap;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.delete-selected-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
}

.delete-selected-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.delete-selected-btn:active {
    transform: translateY(0);
}

.delete-selected-btn i {
    font-size: 16px;
}

.filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.filter-select {
    padding: 10px 14px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-width: 140px;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.clear-filters-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-filters-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.tasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.tasks-header h1 {
    color: #333;
    font-size: 2.5em;
    font-weight: 700;
    margin: 0;
    font-family: 'Inter Tight', sans-serif;
}

.add-task-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.add-task-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.add-task-button i {
    font-size: 18px;
}

/* Add Task button in global header */
.section-buttons .add-task-button {
    background: transparent;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: lighter;
    cursor: pointer;
    display: flex
;
    border: 0.5px solid #c1c1c1;
    color: #6c757d;
    align-items: center;
    gap: 6px;
    padding: 4px;
    padding-right: 6px;
    transition: all 0.3s 
ease;
    box-shadow: none;
}

.section-buttons .add-task-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.section-buttons .add-task-button i {
    font-size: 16px;
}

.table-container {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  
}

#tasks-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    table-layout: fixed; /* Fixed layout prevents column width changes */

}

#tasks-table th,
#tasks-table td {
    border: 1px solid #e1e5e9;
    padding: 16px;
    text-align: left;
    vertical-align: top;
}

/* Fixed column widths to prevent flickering during drag */
#tasks-table th:nth-child(1), #tasks-table td:nth-child(1) { /* Task (Checkbox + ID + Title) */
    width: 350px;
    min-width: 250px;
}
#tasks-table th:nth-child(2), #tasks-table td:nth-child(2) { /* Preview */
    width: 100px;
    min-width: 100px;
}
#tasks-table th:nth-child(3), #tasks-table td:nth-child(3) { /* Priority */
    width: 100px;
    min-width: 100px;
}
#tasks-table th:nth-child(4), #tasks-table td:nth-child(4) { /* Status */
    width: 120px;
    min-width: 120px;
}
#tasks-table th:nth-child(5), #tasks-table td:nth-child(5) { /* Due Date */
    width: 120px;
    min-width: 120px;
}
#tasks-table th:nth-child(6), #tasks-table td:nth-child(6) { /* Responsible */
    width: 150px;
    min-width: 150px;
}
#tasks-table th:nth-child(7), #tasks-table td:nth-child(7) { /* Project */
    width: 150px;
    min-width: 150px;
}
#tasks-table th:nth-child(8), #tasks-table td:nth-child(8) { /* Tags */
    width: 150px;
    min-width: 150px;
}
#tasks-table th:nth-child(9), #tasks-table td:nth-child(9) { /* Created At */
    width: 150px;
    min-width: 150px;
}
#tasks-table th:nth-child(10), #tasks-table td:nth-child(10) { /* Actions */
    width: 120px;
    min-width: 120px;
}

#tasks-table th {
    background: none!important; */
    color: #495057;
    font-weight: lighter;
    font-size: 7px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  
 
    position: sticky;
    top: 0;
    height: 20px;
    padding: 5px;
    z-index: 10;
    border: none;
}

#tasks-table tbody tr {
    transition: all 0.2s ease;
    position: relative;
    /* Remove transform-based stacking context to prevent z-index issues */
}

#tasks-table tbody tr:nth-child(odd) {
    background-color: #fafafa;
}
#tasks-table tbody tr:nth-child(even) {
    background-color: #f8f9ff;
}

#tasks-table tbody tr:hover {
    background-color: #e3f2fd;
    /* Use box-shadow instead of transform to avoid stacking context issues */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#tasks-table tbody tr td {
    border-bottom: 1px solid #e9ecef;
}

/* Priority styling */
.priority-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.priority-low {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.priority-medium {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.priority-high {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.priority-urgent {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Status styling */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-in-progress {
    background-color: #cce5ff;
    color: #0066cc;
    border: 1px solid #b3d7ff;
}

.status-completed {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-cancelled {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Due date styling */
.due-date {
    font-size: 13px;
    font-weight: 500;
}

.due-date.overdue {
    color: #dc3545;
}

.due-date.due-soon {
    color: #fd7e14;
}

.due-date.on-time {
    color: #28a745;
}

/* Task title cell - combines checkbox, ID, and title */
.task-title-cell {
    vertical-align: middle;
}

.task-title-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.task-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
    flex-shrink: 0;
}

#select-all-tasks {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.task-id {
    font-weight: 600;
    color: #667eea;
    font-size: 13px;
    flex-shrink: 0;
    min-width: 40px;
}

.task-title-text {
    flex: 1;
    word-wrap: break-word;
}

/* Make rows draggable */
#tasks-table tbody tr {
    cursor: grab;
}

#tasks-table tbody tr:active {
    cursor: grabbing;
}

/* Keep pointer cursor for interactive elements */
#tasks-table tbody tr .task-checkbox,
#tasks-table tbody tr button,
#tasks-table tbody tr a,
#tasks-table tbody tr input,
#tasks-table tbody tr select,
#tasks-table tbody tr .actions-cell,
#tasks-table tbody tr .status-cell,
#tasks-table tbody tr .responsible-cell {
    cursor: pointer;
}

/* Actions column */
.actions-cell {
    white-space: nowrap;
    width: 140px;
    min-width: 140px;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 14px;
    margin-right: 4px;
    transition: all 0.2s ease;
}

.action-btn.edit {
    color: #007bff;
}

.action-btn.edit:hover {
    background-color: #e7f3ff;
}

.action-btn.delete {
    color: #dc3545;
}

.action-btn.delete:hover {
    background-color: #fdeaea;
}

.action-btn.add-task-btn {
    color: #28a745;
    border: 1px solid #28a745;
}

.action-btn.add-task-btn:hover {
    background-color: #e8f5e8;
    color: #1e7e34;
}

.action-btn.view-figma {
    color: #667eea;
}

.action-btn.view-figma:hover {
    background-color: #e7f3ff;
}

.action-btn.view-figma i {
    font-size: 16px;
    display: inline-block;
}

.comment-actions {
    text-align: center;
    white-space: nowrap;
}

/* Task ID styling */
.task-id {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #666;
    font-size: 12px;
    text-align: center;
    width: 60px;
}

/* Task thumbnail styling */
.thumbnail-cell {
    text-align: center;
    vertical-align: middle;
    width: 80px;
    padding: 5px;
}

.task-thumbnail {
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.task-thumbnail:hover {
    transform: scale(1.1);
}

.no-thumbnail {
    color: #999;
    font-size: 11px;
    font-style: italic;
}

.no-tags {
    color: #999;
    font-style: italic;
}

/* Tags styling */
.tag-badge {
    display: inline-block;
    background-color: #e3f2fd;
    color: #1565c0;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin: 1px 2px;
    border: 1px solid #bbdefb;
}

.tag-badge:hover {
    background-color: #bbdefb;
}

/* Tags container for form input */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 40px;
    padding: 8px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    background-color: #fafbfc;
    margin-top: 8px;
    position: relative;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    background-color: #e3f2fd;
    color: #1565c0;
    padding: 4px 8px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #bbdefb;
    margin: 2px;
}

.tag-remove {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    margin-left: 6px;
    padding: 0;
    font-size: 16px;
    line-height: 1;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.tag-remove:hover {
    background-color: #f5f5f5;
    color: #333;
}

.tag-chip:hover .tag-remove {
    opacity: 1;
}

/* Tags input field styling */
.form-group input[data-tags-input] {
    margin-bottom: 0;
}

/* Form group with tags input */
.form-group:has(input[data-tags-input]) {
    position: relative;
}

/* Tags suggestions dropdown */
.tags-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
}

.tag-suggestion {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #333;
    transition: background-color 0.2s ease;
}

.tag-suggestion:hover {
    background-color: #f8f9ff;
}

.tag-suggestion:last-child {
    border-bottom: none;
}

/* Figma comment indicator styling */
.figma-comment-indicator {
    display: inline-flex;
    align-items: center;
    margin-left: 5px;
    color: #667eea;
}

.figma-comment-indicator i {
    font-size: 14px;
    margin-right: 3px;
}

.figma-comment-author {
    font-size: 12px;
    color: #666;
    font-weight: normal;
    margin-left: 5px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

/* Task modal content - override any other modal styles */
#add-task-modal .modal-content {
    background-color: #fff;
    margin: 2% auto;
    margin-top: 90px!important;
    padding: 0;
    border-radius: 16px;
    width: 95% !important;
    max-width: 95% !important;
    max-height: 94vh;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease-out;
    overflow-y: auto;
    position: relative;
    z-index: 10001;
}

.modal-content {
    background-color: #fff;
    margin: 2% auto;
    padding: 0;
    border-radius: 16px;
    width: 95%;
    max-width: 95%;
    max-height: 94vh;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease-out;
    overflow-y: auto;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px 32px;
    margin-bottom: 0;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.modal-header h2 {
    margin: 0;
    color: #1a1a1a;
    font-size: 26px;
    font-weight: 700;
    font-family: 'Inter Tight', sans-serif;
}

.close-modal {
    font-size: 32px;
    font-weight: 300;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: transparent;
    line-height: 1;
    user-select: none;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    border: none;
    pointer-events: auto;
}

.close-modal:hover {
    color: #dc3545;
    background: #f8f9fa;
    transform: scale(1.1);
}

.close-modal:active {
    transform: scale(0.95);
}

.task-form {
    padding: 0 32px 32px 32px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* Column layout */
.form-column-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-column-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Two-column form layout */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 0;
}

.form-group {
    margin-bottom: 0;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-actions-wrapper {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s ease;
    box-sizing: border-box;
    background: #fafbfc;
}

.form-group input:hover,
.form-group textarea:hover,
.form-group select:hover {
    border-color: #c7cdd3;
    background: #fff;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.08);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    line-height: 1.6;
}

.datetime-inputs {
    display: flex;
    gap: 10px;
}

.datetime-inputs input[type="date"] {
    flex: 2;
}

.datetime-inputs input[type="time"] {
    flex: 1;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px solid #e9ecef;
}

.cancel-btn,
.submit-btn {
    padding: 13px 28px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.cancel-btn {
    background-color: #f8f9fa;
    color: #495057;
    border: 2px solid #dee2e6;
}

.cancel-btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.25);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.35);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Attachments Section */
.attachments-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 18px;
    margin-top: 8px;
    border: 2px solid #e9ecef;
}

.attachment-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.attachment-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    border: 2px solid #dee2e6;
    background: white;
    color: #495057;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.attachment-btn:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.attachment-btn i {
    font-size: 18px;
}

.attachment-btn.secondary {
    border-color: #dc3545;
    color: #dc3545;
}

.attachment-btn.secondary:hover {
    background: #dc3545;
    color: white;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
}

.attachments-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.attachment-item {
    position: relative;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 280px;
    transition: all 0.2s ease;
}

.attachment-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.attachment-item i {
    font-size: 28px;
    color: #667eea;
}

.attachment-info {
    flex: 1;
    min-width: 0;
}

.attachment-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.attachment-size {
    font-size: 11px;
    color: #6c757d;
}

.attachment-remove {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.attachment-remove:hover {
    background: #fdeaea;
}

.attachment-preview-image {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.attachment-preview-image:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.attachment-item video {
    max-width: 120px;
    max-height: 90px;
    border-radius: 8px;
    object-fit: cover;
}

.recording-preview {
    margin-top: 16px;
}

.recording-controls {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    justify-content: center;
}

.recording-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #fff3cd;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #856404;
}

.recording-status .recording-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #dc3545;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}


/* Responsive Design */
@media (max-width: 768px) {
    main {
        padding: 15px;
    }

    /* Tasks view toggles responsive */
    .tasks-view-toggles {
        gap: 6px;
        margin-right: 8px;
    }

    .view-toggle-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .tasks-controls {
        padding: 15px;
        gap: 15px;
        flex-direction: column;
        align-items: stretch;
    }

    .tasks-title {
        font-size: 20px;
        margin-bottom: 10px;
    }

    .search-container {
        max-width: 100%;
    }

    .filter-container {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-select {
        min-width: auto;
        width: 100%;
    }

    .clear-filters-btn {
        align-self: flex-start;
        width: auto;
    }

    .tasks-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .tasks-header h1 {
        font-size: 2em;
    }

    .table-container {
        margin-top: 15px;
    }

    #tasks-table th,
    #tasks-table td {
        padding: 12px 8px;
        font-size: 13px;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        max-height: 85vh;
    }

    .form-actions {
        flex-direction: column;
    }

    .cancel-btn,
    .submit-btn {
        width: 100%;
    }

    /* Responsive form layout */
    .task-form {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 20px 20px 20px;
    }

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

    .attachment-controls {
        flex-direction: column;
    }

    .attachment-btn {
        width: 100%;
        justify-content: center;
    }

    #add-task-modal .modal-content {
        width: 98% !important;
        max-width: 98% !important;
        margin: 5% auto;
    }
    
    .modal-content {
        width: 98%;
        max-width: 98%;
        margin: 5% auto;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-header h2 {
        font-size: 20px;
    }
    
    .close-modal {
        width: 32px;
        height: 32px;
        font-size: 28px;
    }
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #495057;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 30px;
}

/* Error state */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

/* Drag and Drop Styles for Task Rows */
.task-row {
    cursor: move;
    transition: all 0.2s ease;
}

.task-row:hover {
    background-color: #f8f9ff;
}

/* Dragging styles are handled in JavaScript now - row is hidden during drag */

.drag-placeholder {
    background: rgba(102, 126, 234, 0.05) !important;
    border: 1px dashed #667eea !important;
    pointer-events: none !important;
    opacity: 0.7 !important;
    transition: all 0.2s ease !important;
}

.drag-placeholder:hover {
    background: rgba(102, 126, 234, 0.08) !important;
    border-color: #4c63d2 !important;
}

.drag-ghost {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3) !important;
    border-radius: 8px !important;
    background: white !important;
    pointer-events: none !important;
    border: 2px dashed #667eea !important;
    opacity: 0.95 !important;
}

/* Style for the row being dragged */
tr.task-row.dragging {
    opacity: 0.5 !important;
    border: 2px dashed #667eea !important;
}

/* Drag over indicator for table reordering */
.task-row.drag-over-above::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 4px;
    background-color: #007bff;
    z-index: 1001;
}

.task-row.drag-over-below::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 4px;
    background-color: #007bff;
    z-index: 1001;
}

/* Table row positioning for drag feedback */
.task-row {
    position: relative;
}

/* Figma Comments Styles */
.figma-comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.figma-comments-header h3 {
    margin: 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

/* Comments Controls (Search and Filters) */
.comments-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.comments-controls .search-container {
    position: relative;
    max-width: 400px;
}

.comments-controls .search-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.comments-controls .search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.comments-controls .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 18px;
}

.comments-controls .filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.comments-controls .filter-select {
    padding: 10px 14px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-width: 140px;
}

.comments-controls .filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.comments-controls .clear-filters-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.comments-controls .clear-filters-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.refresh-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: background-color 0.2s;
}

.refresh-btn:hover:not(:disabled) {
    background: #0056b3;
}

.refresh-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.figma-comments-table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background: white;
}

#figma-comments-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

#figma-comments-table th,
#figma-comments-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

#figma-comments-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
}

#figma-comments-table tbody tr:hover {
    background-color: #f8f9ff;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-message {
    max-width: 400px;
    word-wrap: break-word;
    line-height: 1.4;
}

/* Enhanced Figma Comments Table Styles */
#figma-comments-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

#figma-comments-table th,
#figma-comments-table td {
    border: 1px solid #e1e5e9;
    padding: 12px 16px;
    text-align: left;
    vertical-align: top;
}

#figma-comments-table th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-weight: 600;
    color: #495057;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

#figma-comments-table tbody tr {
    transition: all 0.2s ease;
}

#figma-comments-table tbody tr:nth-child(even) {
    background-color: #f8f9ff;
}

#figma-comments-table tbody tr:hover {
    background-color: #e3f2fd;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Specific column styles */
.comment-id {
    font-family: monospace;
    font-size: 12px;
    color: #6c757d;
    min-width: 100px;
}

.comment-message {
    max-width: 300px;
    word-wrap: break-word;
    line-height: 1.4;
}

.comment-date,
.comment-resolved-date {
    white-space: nowrap;
    min-width: 120px;
}

.comment-order-id {
    font-family: monospace;
    font-size: 12px;
    color: #6c757d;
}

.comment-position {
    font-family: monospace;
    font-size: 12px;
    color: #6c757d;
    min-width: 100px;
}

/* Node ID column styles */
.comment-node-id {
    text-align: center;
}

.node-id {
    font-family: monospace;
    font-size: 11px;
    color: #495057;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #dee2e6;
}

.no-node-id {
    color: #9e9e9e;
    font-size: 11px;
}

/* Reactions column styles */
.comment-reactions {
    text-align: center;
}

.reactions-display {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    justify-content: center;
    max-width: 100px;
}

.reaction-item {
    background: #f0f4f8;
    border: 1px solid #d1ecf1;
    border-radius: 8px;
    padding: 1px 4px;
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}

.reaction-item:hover {
    background: #e3f2fd;
}

.no-reactions {
    color: #9e9e9e;
    font-size: 11px;
}

/* Region size/position column styles */
.comment-region-size {
    text-align: center;
}

.region-size {
    font-family: monospace;
    font-size: 10px;
    color: #495057;
    background: #f0f4f8;
    padding: 2px 4px;
    border-radius: 3px;
    border: 1px solid #d1ecf1;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

.no-region {
    color: #9e9e9e;
    font-size: 11px;
}

/* Replies column styles */
.comment-replies {
    text-align: center;
}

.replies-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 12px;
    background: #e3f2fd;
    color: #1976d2;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.replies-count:hover {
    background: #bbdefb;
}

.replies-number {
    font-weight: 600;
    color: #0d47a1;
}

.replies-text {
    opacity: 0.8;
}

.replies-icon {
    font-size: 14px;
    opacity: 0.7;
}

.no-replies {
    color: #9e9e9e;
    font-size: 12px;
}

/* Figma link column styles */
.comment-figma-link {
    text-align: center;
}

.figma-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.figma-link-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.figma-link-btn i {
    font-size: 14px;
}

.figma-link-btn span {
    display: inline;
}

/* Replies modal styles */
.replies-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.replies-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    max-height: 80vh;
    width: 90%;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-out;
}

.replies-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.replies-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.close-replies-modal {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-replies-modal:hover {
    background: #e9ecef;
    color: #333;
}

.original-comment {
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9ff;
}

.replies-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 0 24px 24px 24px;
}

/* Inline replies display styles */
.replies-row {
    background: #f8f9ff;
}

.replies-row:hover {
    background: #f0f2ff;
}

.replies-cell {
    padding: 0;
    border-top: 1px solid #e9ecef;
}

.replies-container {
    padding: 16px 20px;
    background: #f8f9ff;
    border-left: 3px solid #667eea;
    margin: 8px 0;
}

.replies-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
}

.replies-header i {
    color: #667eea;
}

.replies-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.reply-item {
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 3px solid #e3f2fd;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.reply-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.reply-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.reply-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.reply-author-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.reply-date {
    font-size: 11px;
    color: #6c757d;
}

.reply-message {
    font-size: 14px;
    line-height: 1.4;
    color: #495057;
    margin-left: 38px;
    word-wrap: break-word;
}

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

.original-comment .comment-author,
.reply-item .comment-author {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.original-comment .comment-author .author-avatar,
.reply-item .comment-author .author-avatar {
    width: 24px;
    height: 24px;
}

.original-comment .comment-author span:first-child,
.reply-item .comment-author span:first-child {
    font-size: 14px;
}

.original-comment .comment-date,
.reply-item .comment-date {
    font-size: 12px;
    color: #6c757d;
    margin-left: auto;
}

.original-comment .comment-message,
.reply-item .comment-message {
    font-size: 14px;
    line-height: 1.4;
    margin-left: 32px;
}

.resolution-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.resolution-status.resolved {
    background-color: #d4edda;
    color: #155724;
}

.resolution-status.unresolved {
    background-color: #fff3cd;
    color: #856404;
}

.loading-state {
    text-align: center;
    padding: 40px;
}

.loading-state p {
    margin: 16px 0 0 0;
    color: #666;
}

.error-state h4 {
    margin: 16px 0 8px 0;
}

.error-state p {
    margin: 0 0 16px 0;
    color: #666;
}

/* Thumbnail column styles */
.comment-thumbnail-cell {
    text-align: center;
    vertical-align: middle;
    min-width: 120px;
    max-width: 150px;
}

.comment-thumbnail {
    width: 80px;
    height: 60px;
    border-radius: 6px;
    border: 2px solid #e9ecef;
    overflow: hidden;
    display: inline-block;
    position: relative;
    background: #f8f9fa;
    transition: all 0.2s ease;
}

.comment-thumbnail:hover {
    border-color: #667eea;
    transform: scale(1.05);
}

.comment-thumbnail.loading {
    background: linear-gradient(90deg, #f8f9fa 25%, #e9ecef 50%, #f8f9fa 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.comment-thumbnail.loading span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 4px;
}

.comment-thumbnail.loading .loading-spinner {
    width: 12px;
    height: 12px;
    border: 1px solid #6c757d;
    border-top: 1px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.comment-thumbnail.error {
    background: #f8d7da;
    border-color: #dc3545;
}

.comment-thumbnail.error span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 9px;
    color: #721c24;
    text-align: center;
}

.comment-thumbnail.no-thumbnail {
    background: #f8f9fa;
    border-color: #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comment-thumbnail.no-thumbnail span {
    font-size: 10px;
    color: #6c757d;
    text-align: center;
}

.thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* Generate thumbnail button styles */
.generate-thumbnail-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.generate-thumbnail-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.generate-thumbnail-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.generate-thumbnail-btn i {
    font-size: 12px;
}

.generate-thumbnail-btn span {
    white-space: nowrap;
}

/* Comment pin overlay styles */
.comment-pin-overlay {
    position: absolute;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
    transition: all 0.2s ease;
}

.comment-pin-overlay:hover {
    background: rgba(102, 126, 234, 1);
    transform: scale(1.1);
}

.comment-pin-overlay i {
    font-size: 8px;
    color: white;
}

/* Responsive adjustments for Figma comments */
@media (max-width: 768px) {
    .figma-comments-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .comment-message {
        max-width: 200px;
    }

    #figma-comments-table th,
    #figma-comments-table td {
        padding: 8px 12px;
        font-size: 13px;
    }

    .comment-author {
        gap: 8px;
    }

    .author-avatar {
        width: 28px;
        height: 28px;
    }

    /* Comments controls responsive */
    .comments-controls {
        padding: 15px;
        gap: 15px;
    }

    .comments-controls .search-container {
        max-width: 100%;
    }

    .comments-controls .filter-container {
        flex-direction: column;
        align-items: stretch;
    }

    .comments-controls .filter-select {
        min-width: auto;
        width: 100%;
    }

    .comments-controls .clear-filters-btn {
        align-self: flex-start;
        width: auto;
    }

    /* Enhanced Figma comments table responsive */
    .comment-id {
        min-width: 80px;
        font-size: 11px;
    }

    .comment-message {
        max-width: 200px;
    }

    .comment-date,
    .comment-resolved-date {
        min-width: 100px;
        font-size: 12px;
    }

    .comment-order-id {
        font-size: 11px;
    }

    .comment-position {
        min-width: 80px;
        font-size: 11px;
    }

    .comment-replies {
        font-size: 11px;
    }

    .comment-node-id,
    .comment-reactions,
    .comment-region-size {
        font-size: 10px;
    }

    .node-id,
    .reaction-item,
    .region-size {
        padding: 1px 3px;
        font-size: 9px;
    }

    .reactions-display {
        max-width: 80px;
    }

    .comment-figma-link {
        padding: 4px;
    }

    .figma-link-btn {
        padding: 4px 6px;
        font-size: 11px;
    }

    .figma-link-btn span {
        display: none; /* Hide text on mobile, show only icon */
    }

    .replies-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .replies-list {
        padding: 0 16px 16px 16px;
    }

    /* Thumbnail responsive */
    .comment-thumbnail-cell {
        min-width: 100px;
        max-width: 120px;
    }

    .comment-thumbnail {
        width: 70px;
        height: 50px;
    }

    .generate-thumbnail-btn {
        padding: 4px 6px;
        font-size: 10px;
    }

    .generate-thumbnail-btn i {
        font-size: 10px;
    }

    .generate-thumbnail-btn span {
        display: none; /* Hide text on mobile, show only icon */
    }

    .comment-pin-overlay {
        width: 18px;
        height: 18px;
        font-size: 9px;
    }

    .comment-pin-overlay i {
        font-size: 7px;
    }
}

/* ===========================================
   CALENDAR VIEW STYLES
   =========================================== */

.calendar-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    overflow: hidden;
 
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.calendar-nav-btn {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s ease;
    color: #495057;
}

.calendar-nav-btn:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: translateY(-1px);
}

.calendar-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    min-width: 200px;
    text-align: center;
}

.calendar-view-switcher {
    display: flex;
    gap: 8px;
}

.view-btn {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    color: #495057;
}

.view-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.view-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.calendar-today-btn button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.calendar-today-btn button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

/* Month View Styles */
.calendar-month-view {
    display: flex;
    flex-direction: column;
}

.calendar-header-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.calendar-header-cell {
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    color: #495057;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-body {
    display: flex;
    flex-direction: column;
}

.calendar-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: 120px;
}

.calendar-cell {
    border: 1px solid #e9ecef;
    padding: 8px;
    position: relative;
    transition: all 0.2s ease;
    overflow: hidden;
    min-width: 0;
}

.calendar-cell:hover {
    background-color: #f8f9ff;
}

.calendar-cell.other-month {
    background-color: #fafafa;
    color: #adb5bd;
}

.calendar-cell.today {
    background-color: #e3f2fd;
    border-color: #2196f3;
}

.calendar-cell.today .calendar-cell-date {
    background-color: #2196f3;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 4px auto;
}

.calendar-cell-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 4px;
}

.calendar-cell-date {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
}

.calendar-cell-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    max-height: 100px;
    min-width: 0;
}

/* Task items in calendar */
.calendar-task-item {
    background: white;
    border-left: 4px solid;
    border-radius: 4px;
    padding: 4px 6px;
    margin-bottom: 2px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    min-width: 0;
    overflow: hidden;
}

.calendar-task-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.calendar-task-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.calendar-task-title {
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-task-priority {
    font-size: 9px;
    text-transform: uppercase;
    font-weight: 600;
    opacity: 0.8;
}

.calendar-task-responsible {
    font-size: 9px;
    color: #666;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.8;
}

/* Priority colors */
.calendar-task-item.priority-low {
    border-left-color: #28a745;
    background: linear-gradient(90deg, #d4edda 0%, #f8f9fa 100%);
}

.calendar-task-item.priority-medium {
    border-left-color: #ffc107;
    background: linear-gradient(90deg, #fff3cd 0%, #f8f9fa 100%);
}

.calendar-task-item.priority-high {
    border-left-color: #fd7e14;
    background: linear-gradient(90deg, #ffeaa7 0%, #f8f9fa 100%);
}

.calendar-task-item.priority-urgent {
    border-left-color: #dc3545;
    background: linear-gradient(90deg, #f8d7da 0%, #f8f9fa 100%);
}

.calendar-task-more {
    font-size: 10px;
    color: #6c757d;
    text-align: center;
    margin-top: 2px;
    font-style: italic;
}

/* Week View Styles */
.calendar-week-view {
    display: flex;
    flex-direction: column;
}

.calendar-week-header {
    display: grid;
    grid-template-columns: 80px repeat(5, 1fr);
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 10;
}

.time-column {
    padding: 12px 8px;
    font-weight: 600;
    color: #495057;
    font-size: 12px;
    text-align: center;
}

.week-day-header {
    padding: 12px 8px;
    text-align: center;
    border-left: 1px solid #dee2e6;
}

.week-day-header.today {
    background-color: #e3f2fd;
}

.day-name {
    font-weight: 600;
    color: #495057;
    font-size: 12px;
    text-transform: uppercase;
}

.day-date {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin-top: 4px;
}

.calendar-week-body {
    display: flex;
    flex-direction: column;
    max-height: 600px;
    overflow-y: auto;
}

.time-slot-row {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    border-bottom: 1px solid #e9ecef;
    min-height: 40px;
}

.time-slot-row:nth-child(even) {
    background-color: #fafafa;
}

.week-time-slot {
    border-left: 1px solid #e9ecef;
    padding: 2px;
    position: relative;
    min-height: 38px;
}

/* FullCalendar Custom Styles */
.fc {
    font-family: 'Inter', sans-serif;
}

.fc-event {
    border-radius: 4px;
    border-left-width: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #1e293b !important; /* Dark text for readability on light backgrounds */
    padding: 2px 4px !important;
    overflow: hidden;
}

.fc-event:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
    filter: brightness(0.95);
}

/* Priority-based colors are now replaced with responsible-based colors (applied via JS) */
/* Keep pulse animation for urgent tasks */
.fc-event.priority-urgent {
    animation: pulse 2s infinite;
}

.fc-event-main-frame {
    overflow: hidden;
    padding: 2px;
}

.fc-event-title-container {
    overflow: hidden;
}

.fc-event-title {
    font-weight: 600;
    font-size: 11px;
    color: #1e293b;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    max-width: 100%;
}

.fc-event-time {
    font-size: 10px;
    opacity: 0.8;
    color: #475569;
    line-height: 1.2;
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fc-event-details {
    font-size: 9px;
    opacity: 0.75;
    margin-top: 1px;
    color: #64748b;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* FullCalendar header styling */
.fc-header-toolbar {
    margin-bottom: 20px;
}

.fc-toolbar-title {

    font-size: 24px!important;
   
    color: #495057;
    margin-top: 0px;
    position: relative;
    top: 10px;
}

.fc-button {
    background: #667eea !important;
    border-color: #667eea !important;
    text-transform: capitalize;
}

.fc-button:hover {
    background: #5568d3 !important;
    border-color: #5568d3 !important;
}

.fc-button-active {
    background: #4c51bf !important;
    border-color: #4c51bf !important;
}

/* Hide weekends */
.fc-day-sat,
.fc-day-sun {
    display: none;
}

/* Today highlight */
.fc-day-today {
    background: #f8f9ff!important;
}

/* Taller time slots - double the default height */
.fc-timegrid-slot {
    height: 70px !important;
}

.fc-timegrid-slot-label {
    height: 70px !important;
}

/* Task list row dragging cursor */
#tasks-table tbody tr[draggable="true"] {
    cursor: move;
}

.time-slot-task {
    margin-bottom: 2px;
    font-size: 10px;
    padding: 2px 4px;
}

/* Day View Styles */
.calendar-day-view {
    display: flex;
    flex-direction: column;
}

.day-view-header {
    padding: 20px 24px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.day-view-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.day-view-body {
    display: flex;
    flex-direction: column;
    max-height: 600px;
    overflow-y: auto;
}

.day-time-slot-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    border-bottom: 1px solid #e9ecef;
    min-height: 60px;
}

.day-time-slot-row:nth-child(even) {
    background-color: #fafafa;
}

.day-time-column {
    padding: 12px 16px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
    border-right: 1px solid #dee2e6;
    display: flex;
    align-items: center;
}

.day-time-slot {
    padding: 4px;
    position: relative;
}

/* Drag and Drop Styles */
.drag-over {
    background-color: #e3f2fd !important;
    border-color: #2196f3 !important;
}

.calendar-cell.drag-over {
    box-shadow: inset 0 0 0 2px #2196f3;
}

.week-time-slot.drag-over,
.day-time-slot.drag-over {
    background-color: #e3f2fd !important;
}

/* Responsive Design for Calendar */
@media (max-width: 768px) {
    .calendar-header {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }

    .calendar-nav {
        width: 100%;
        justify-content: space-between;
    }

    .calendar-title {
        font-size: 18px;
        min-width: auto;
    }

    .calendar-view-switcher {
        width: 100%;
        justify-content: center;
    }

    .calendar-today-btn {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .calendar-today-btn button {
        width: 100%;
        max-width: 120px;
    }

    /* Month view responsive */
    .calendar-row {
        min-height: 100px;
    }

    .calendar-cell {
        padding: 4px;
    }

    .calendar-cell-date {
        font-size: 12px;
    }

    .calendar-task-item {
        font-size: 10px;
        padding: 2px 4px;
    }

    /* Week view responsive */
    .calendar-week-header {
        grid-template-columns: 60px repeat(5, 1fr);
    }

    .time-column {
        font-size: 11px;
        padding: 8px 4px;
    }

    .week-day-header {
        padding: 8px 4px;
    }

    .day-name {
        font-size: 11px;
    }

    .day-date {
        font-size: 12px;
    }

    .time-slot-row {
        min-height: 35px;
    }

    .week-time-slot {
        min-height: 33px;
    }

    /* Day view responsive */
    .day-time-slot-row {
        grid-template-columns: 100px 1fr;
        min-height: 50px;
    }

    .day-time-column {
        font-size: 12px;
        padding: 8px 12px;
    }
}

/* Tasks Horizontal Layout (now vertical 2-row layout) */
#tasks-section main.tasks-layout-horizontal {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: calc(100vh - 80px); /* Full viewport minus header */
}

/* Controls should span full width in horizontal layout - positioned above both rows */
#tasks-section main.tasks-layout-horizontal .tasks-controls {
    flex: 0 0 auto;
    width: 100%;
    margin-bottom: 0;
    /* Add visual separation to make it clear this controls both panels below */
    border-bottom: 3px solid #e9ecef;
    padding-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
}

#taskst-table-body tr{background-color: #fafafa;}

#tasks-list-container {
    margin-bottom: 20px !important;
    background: transparent;
    box-shadow: none;
    border: 0.5px solid #c1c1c1;
}

#tasks-section main.tasks-layout-horizontal #tasks-list-container {
    flex: 0 0 50vh;
    max-height: 50vh;
    overflow-y: auto;
    overflow-x: auto;
    width: 100%;
}

#tasks-section main.tasks-layout-horizontal #tasks-list-container .table-container {
    max-height: none;
    overflow: visible;
}

#tasks-section main.tasks-layout-horizontal #tasks-calendar-wrapper {
    flex: 0 0 50vh;
    max-height: 50vh;
    overflow-y: auto;
    width: 100%;
    margin-top: 0 !important;
}

#tasks-section main.tasks-layout-horizontal #tasks-figma-container {
    flex: 1 1 auto;
    margin-top: 0;
}

/* Responsive: maintain vertical layout on mobile */
@media (max-width: 1024px) {
    #tasks-section main.tasks-layout-horizontal {
        height: auto;
    }
    
    #tasks-section main.tasks-layout-horizontal #tasks-list-container,
    #tasks-section main.tasks-layout-horizontal #tasks-calendar-wrapper {
        flex: 0 0 45vh;
        max-height: 45vh;
        width: 100%;
    }
}

/* Tasks View Toggle Buttons */
.tasks-view-toggles {
    display: flex;
    gap: 0;
    align-items: center;
    margin-right: 0;
}

.view-toggle-btn {
    background: transparent;
    border: none;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6c757d;
}

.view-toggle-btn:hover {
    transform: scale(1.1);
}

.view-toggle-btn.active {
    color: #667eea;
}

.view-toggle-btn.active:hover {
    color: #667eea;
}

.view-toggle-btn i {
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* Allow clicks to pass through to button */
    font-size: 20px;
    color: inherit;
}

/* Layout toggle button */
#toggle-layout {
    margin-right: 0;
}

/* Status Cell Dropdown Styles */
.status-cell {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.status-cell:hover {
    background-color: #f0f4ff !important;
}

.status-dropdown {
    /* Position is set dynamically via JS to fixed */
    min-width: 250px;
    max-width: 300px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
    z-index: 10000 !important;
    animation: slideDown 0.2s ease-out;
    will-change: transform;
    transform: translateZ(0);
}

.status-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px 8px 0 0;
}

.status-dropdown-header span {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
}

.status-dropdown-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.status-dropdown-close:hover {
    background: #dee2e6;
    color: #333;
}

.status-dropdown-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}

.status-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #495057;
}

.status-option:hover {
    background: #e3f2fd;
}

.status-option.selected {
    background: #e3f2fd;
    color: var(--status-color, #1976d2);
    font-weight: 500;
}

.status-option i {
    font-size: 16px;
    color: var(--status-color, #6c757d);
}

.status-option.selected i {
    color: var(--status-color, #1976d2);
}

.status-option .selected-icon {
    margin-left: auto;
    color: var(--status-color, #1976d2);
    font-weight: bold;
}

.status-option span {
    flex: 1;
}

/* Responsible Cell Dropdown Styles */
.responsible-cell {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.responsible-cell:hover {
    background-color: #f0f4ff !important;
}

.responsible-dropdown {
    /* Position is set dynamically via JS to fixed */
    min-width: 250px;
    max-width: 300px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
    z-index: 10000 !important; /* Very high z-index to ensure it's above everything */
    animation: slideDown 0.2s ease-out;
    /* Force hardware acceleration to ensure smooth rendering */
    will-change: transform;
    transform: translateZ(0);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.responsible-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px 8px 0 0;
}

.responsible-dropdown-header span {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
}

.responsible-dropdown-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.responsible-dropdown-close:hover {
    background: #dee2e6;
    color: #333;
}

.responsible-dropdown-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}

.responsible-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #495057;
}

.responsible-option:hover {
    background: #e3f2fd;
}

.responsible-option.selected {
    background: #e3f2fd;
    color: #1976d2;
    font-weight: 500;
}

.responsible-option i {
    font-size: 16px;
    color: #6c757d;
}

.responsible-option.selected i {
    color: #1976d2;
}

.responsible-option .selected-icon {
    margin-left: auto;
    color: #1976d2;
    font-weight: bold;
}

.responsible-option span {
    flex: 1;
}

/* Figma Comments Empty State */
.figma-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.figma-empty-state .empty-state-icon {
    font-size: 48px;
    color: #adb5bd;
    margin-bottom: 20px;
}

.figma-empty-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #495057;
    font-weight: 600;
}

.figma-empty-state p {
    font-size: 16px;
    margin-bottom: 30px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

/* Compact View Styles */
#tasks-table.compact-view tbody tr {
    height: 50px;
    max-height: 50px;
}

#tasks-table.compact-view tbody tr td {
    padding: 8px 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;

    border: none;
}

#tasks-table.compact-view .task-thumbnail {
    width: 30px;
    height: 30px;
    object-fit: cover;
}

#tasks-table.compact-view .no-thumbnail {
    width: 30px;
    height: 30px;
    font-size: 12px;
}

#tasks-table.compact-view .priority-badge,
#tasks-table.compact-view .status-badge {
    padding: 4px 8px;
    font-size: 11px;
}

#tasks-table.compact-view .tag-badge {
    padding: 2px 6px;
    font-size: 10px;
    margin-right: 4px;
}

#tasks-table.compact-view .action-btn {
    padding: 0px !important;
    font-size: 12px;
    background-color: transparent;
}

#tasks-table.compact-view .task-id {
    font-size: 11px;
}

#toggle-compact-view.active {
    color: #667eea;
}

#toggle-compact-view.active:hover {
    color: #667eea;
}
