﻿/* taskCard.css */

/* Task Card Container */
.task-panel-cards {
    padding: 0 1.5em;
    max-height: 62vh;
    overflow-y: auto;
}

.task-panel-cards a,
 .task-panel-cards span {
        font-size: 1.3rem !important;
}
/* Task Card Styles */
.task-card {
    background: white;
    border-radius: 6px;
    padding: 1.2em;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    user-select: none;

}

    .task-card:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
        transform: translateY(-1px);
    }

    .task-card:focus {
        outline: 2px solid #4a7fff;
        outline-offset: 2px;
    }

    /* Expanded card state */
    .task-card.expanded {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        border-color: #1e3a5f;
    
    }

/* Card Header */
.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    padding-right: 28px; /* reserves space for menu button whether present or not */
    position: relative;
}

.task-assigned {
    font-size: 1.5em;
    font-weight: 600;
    color: #1e3a5f;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-due-date {
    font-size: 1.5em;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

    .task-due-date i {
        font-size: 1.5em;
    }

    /* Due date states */
    .task-due-date.overdue {
        color: var(--crm-material-red);        
        font-weight: 600;
    }

    .task-due-date.due-soon {
        color: #c9871c;
        font-weight: 600;
    }

/* Task Description - Updated with truncation */
.task-description {
    font-size: 1.3rem !important;
    color: #333;
    text-align: left;
    margin-bottom: 12px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.3s ease;
    position: relative;
    min-height: 1.5em;
    max-height: 1.5em;
}

    /* Expanded description */
    .task-description.expanded {
        -webkit-line-clamp: unset;
        overflow: visible;
        background: rgba(0, 0, 0, 0.02);
        padding: 0.5em;
        margin: 0.5em -0.5em;
        border-radius: 4px;
        max-height: unset;
    }

/* Allow text selection when expanded */
.task-card.expanded .task-description {
    user-select: text;
}



/* Visual feedback on hover for expandable descriptions */
.task-description:not(.expanded):hover {
    background: rgba(0, 0, 0, 0.02);       
    border-radius: 4px;
}

/* Task Footer */
.task-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
}

.task-category {
    font-size: 1.5em;
    color: #666;
    background: #f5f5f5;
    padding: 4px 10px;
    border-radius: 4px;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-created {
    font-size: 1.25em;
    color: #999;
    white-space: nowrap;
}

/* Priority Indicators */
.task-card.high-priority {
    border-left: 4px solid var(--crm-material-red);    
    padding-left: 13px;
}

.task-card.medium-priority {
    border-left: 4px solid #c9871c;
    padding-left: 13px;
}

.task-card.low-priority {
    border-left: 4px solid var(--success-color);
    padding-left: 13px;
}

/* Expand/collapse indicator */
.task-expand-indicator {
    position: absolute;
    bottom: .25em;
    right: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 1em;
    transition: all 0.3s ease;
    pointer-events: none;
}

    .task-expand-indicator i {
        font-size: 1.2em;
    }

/* Indicator styling when expanded */
.task-card.expanded .task-expand-indicator {
    color: #1e3a5f;
    transform: rotate(180deg);
}

/* Compact variant */
.task-card.compact {
    padding: 12px;
}

    .task-card.compact .task-description {
        -webkit-line-clamp: 1; /* Only 1 line in compact mode */
        margin-bottom: 8px;
    }

/* Section headers */
.task-section {
    font-size: 1em;
    font-weight: 600;
    color: #666;
    margin: 16px 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}

    .task-section:first-child {
        margin-top: 10px;
    }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 3em;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    margin: 0 0 8px 0;
    font-size: 2em;
}

.empty-state small {
    font-size: 1.5em;
    color: #bbb;
}

/* Scrollbar styling */
.task-panel-cards::-webkit-scrollbar {
    width: 6px;
}

.task-panel-cards::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.task-panel-cards::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

    .task-panel-cards::-webkit-scrollbar-thumb:hover {
        background: #555;
    }

/* Responsive adjustments */
@media (max-width: 400px) {
    .task-card {
        padding: 12px;
    }

    .task-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .task-category {
        max-width: 100%;
    }
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    .task-card {
        min-height: 60px; /* Larger touch target */
    }

    /* No hover effects on mobile */
    .task-description:not(.expanded):hover {
        background: transparent;
       
     
    }
}

/* Animation for new cards */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.task-card {
    animation: slideIn 0.3s ease-out;
}

/* Task Card Menu */
.task-card-menu {
    position: absolute;
    top: 0;
    right: 0;
}

.task-card-menu-trigger {
    background: white;   
    border-radius: 4px;
    border: 0px;   
    padding: 0px;
    cursor: pointer;
    font-size: 1.6em !important;
    color: black;
    line-height: 1;
}

    .task-card-menu-trigger:hover {
        background: #f5f5f5;
        color: #333;
    }

.task-card-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 100;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    list-style: none;
    margin: 4px 0 0 0;
    padding: 4px 0;
    min-width: 120px;
}

    .task-card-menu-dropdown li button {
        width: 100%;
        text-align: left;
        background: none;
        border: none;
        padding: 8px 16px;
        font-size: 1.3rem;
        color: #333;
        cursor: pointer;
    }

        .task-card-menu-dropdown li button:hover {
            background: #f5f5f5;
        }

        .task-card-menu-dropdown li button.danger {
            color: var(--crm-material-red);
        }

/* Edit Form */
.task-edit-form {
    border-top: 1px solid #e0e0e0;
    margin-top: 10px;
    padding-top: 12px;
}

.edit-description {
    max-height: 200px !important;
    resize: vertical !important;
    min-height: 75px;

}

.edit-task-title {
    color: #555 !important;
    margin-top: 10px !important;
    margin-bottom: 10px !important;
}
.task-edit-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}
input[type="date"]::-webkit-calendar-picker-indicator {
    color: var(--crm-button-primary-color);
}

    .task-edit-field label {
        font-size: 1.2rem;
        font-weight: 600;
        color: #666;
        margin-bottom: 4px;
    }

    .task-edit-field textarea,
    .task-edit-field input[type="date"],
    .task-edit-field select {
        font-size: 1.3rem;
        padding: 6px 8px;
        border: 1px solid #e0e0e0;
        border-radius: 4px;
        color: #333;
        width: 100%;
        background: white;
    }

        .task-edit-field textarea:focus,
        .task-edit-field input[type="date"]:focus,
        .task-edit-field select:focus {
            outline: 2px solid #4a7fff;
            border-color: transparent;
        }

.task-card {
    animation: card-fade-in 0.25s ease-out;
}

@keyframes card-fade-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.task-delete-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
    flex-shrink: 0;
}

    .task-delete-actions button {
        flex-shrink: 0;
        flex-grow: 0;
    }

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spin {
    display: inline-block;
    animation: spin 0.7s linear infinite;
}

.task-edit-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 4px;
    align-items: center;
}

    .task-edit-actions button {
        flex-shrink: 0;
        flex-grow: 0;
    }
.btn-save {
    background: #1e3a5f;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 16px;
    font-size: 1.3rem;
    cursor: pointer;
}

    .btn-save:hover {
        background: #2a4f7f;
    }

.btn-cancel {
    color: #333 !important;
    margin: 5px 2px 2px;
    -moz-border-radius: 5px !important;
    -webkit-border-radius: 5px !important;
    border-radius: 5px !important;
    padding: 9px 14px !important;
    height: unset !important;
    border: 1px solid #DDD !important;
    background-color: white !important;
    border-width: 1px;
    font-weight: bold !important;
    letter-spacing: 1px;
    min-width: 8rem;
    cursor: pointer;
}

    .btn-cancel:hover {
        background-color: #f5f5f5 !important;
    }
/* Delete Confirm */
.task-delete-confirm {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #e0e0e0;
    margin-top: 10px;
    padding-top: 12px;
    font-size: 1.3rem;
    color: #333;
}

.task-delete-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-delete {
    background: var(--crm-material-red);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 16px;
    font-size: 1.3rem;
    cursor: pointer;
}

    .btn-delete:hover {
        opacity: 0.9;
    }
