/* ============================================================================
   Task Card Component Styles — Refined
   ============================================================================
   
   Polished task card system with visual guidelines:
   - Clean header/body/meta/footer layout
   - Consistent footer alignment (sticky to bottom)
   - Due-status pill color variants
   - Modern SaaS-style design (Asana/Notion/Salesforce inspired)
   - Responsive grid layout
*/

/* ============================================================================
   GRID CONTAINER
   ============================================================================ */

.task-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
    align-items: stretch;
}

@media (min-width: 1440px) {
    .task-card-grid {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .task-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .task-card-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* ============================================================================
   CARD CONTAINER
   ============================================================================ */

.task-card {
    background-color: #ffffff;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    overflow: hidden;
    min-height: 240px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.task-card:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    cursor: pointer;
}

/* ============================================================================
   LEFT ACCENT STRIP
   ============================================================================ */

.task-card__strip {
    width: 4px;
    flex-shrink: 0;
    background-color: #3b82f6;
}

/* ============================================================================
   INNER FLEX CONTAINER (ensures footer stays at bottom)
   ============================================================================ */

.task-card__inner {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 16px 18px;
}

/* ============================================================================
   HEADER: Client name + category tag
   ============================================================================ */

.task-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.task-card__client {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    line-height: 1.4;
}

.task-card__tag {
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background-color: #f3f4f6;
    color: #6b7280;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ============================================================================
   BODY: Title + description
   ============================================================================ */

.task-card__body {
    flex: 1;
    margin-bottom: 10px;
}

.task-card__title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
    margin: 0 0 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-card__description {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================================
   META: Assigned to info
   ============================================================================ */

.task-card__meta {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 8px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.task-card__assigned-label {
    font-weight: 500;
    color: #9ca3af;
}

.task-card__assigned-name {
    font-weight: 600;
    color: #6b7280;
    margin-left: 4px;
}

/* ============================================================================
   FOOTER: Due date pill + action icons
   ============================================================================ */

.task-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
    margin-top: auto;
    min-height: 40px;
}

.task-card__due {
    flex: 1;
}

.task-card__due-pill {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 12px;
    white-space: nowrap;
    background-color: #e9ecef;
    color: #495057;
}

/* Due status color variants */

.task-card__due-pill--overdue {
    background-color: #dc3545;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.task-card__due-pill--today {
    background-color: #ffc107;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
}

.task-card__due-pill--this_week {
    background-color: #28a745;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.task-card__due-pill--no_date {
    background-color: #e9ecef;
    color: #6b7280;
}

/* ============================================================================
   ACTION ICONS
   ============================================================================ */

.task-card__actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.task-card__icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background-color: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 16px;
    padding: 0;
    text-decoration: none;
}

.task-card__icon-btn:hover {
    background-color: #f3f4f6;
    color: #111827;
}

.task-card__icon-btn:active {
    background-color: #e5e7eb;
}

.task-card__icon-btn.is-active {
    background-color: #d1fae5;
    color: #065f46;
}

.task-card__icon-btn--complete {
    /* Green accent on hover for completion */
}

.task-card__icon-btn--complete:hover {
    background-color: #dcfce7;
    color: #15803d;
}

.task-card__icon-btn--comment {
    /* Blue accent on hover for comments */
}

.task-card__icon-btn--comment:hover {
    background-color: #dbeafe;
    color: #1e40af;
}

.task-card__icon-btn--view {
    /* Purple accent on hover for view */
}

.task-card__icon-btn--view:hover {
    background-color: #ede9fe;
    color: #7c3aed;
}

/* ============================================================================
   RESPONSIVE REFINEMENTS
   ============================================================================ */

@media (max-width: 768px) {
    .task-card__inner {
        padding: 14px 14px;
    }

    .task-card__title {
        font-size: 15px;
    }

    .task-card__description {
        font-size: 12px;
    }

    .task-card__footer {
        min-height: 36px;
    }
}

@media (max-width: 480px) {
    .task-card__inner {
        padding: 12px 12px;
    }

    .task-card__title {
        font-size: 14px;
    }

    .task-card__header {
        margin-bottom: 8px;
    }

    .task-card__body {
        margin-bottom: 8px;
    }
}

/* ============================================================================
   UTILITY MODIFIERS
   ============================================================================ */

/* Optional: Add a subtle glow on focus for accessibility */
.task-card:focus-within {
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #3b82f6;
}

/* Optional: Darkened state for completed tasks */
.task-card.task-card--completed {
    opacity: 0.6;
}

.task-card.task-card--completed .task-card__title {
    text-decoration: line-through;
    color: #9ca3af;
}

/* Optional: Highlight for urgent tasks */
.task-card.task-card--urgent {
    border-left: 2px solid #ef4444;
}
