/* ============================================
   EXPANDABLE TAREA CARD
   ============================================ */

.tarea-card-expandable {
    background: transparent;
    /* Background managed by mask/after */
    border-radius: 16px;
    /* Keep radius for layout */
    overflow: visible;
    /* Allow content to overflow if needed */
    cursor: pointer;
    z-index: 1;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.3s ease;
}

/* Nitro Effect Mask */
.card-background-mask {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    overflow: hidden;
    z-index: -1;
    /* Nitro Gradient */
    background-image: linear-gradient(163deg, #ff00ff 0%, #3700ff 100%);
    transition: all 0.25s cubic-bezier(0, 0, 0, 1);
    opacity: 0.3;
    /* Subtle when inactive */
}

/* Inner Background (The "Card" surface) */
.card-background-mask::after {
    content: " ";
    position: absolute;
    inset: 1px;
    background: rgba(15, 23, 42, 0.95);
    border-radius: 15px;
    z-index: 1;
}

/* 3D TILT CONTAINER & GRID */
.tarea-card-container {
    position: relative;
    width: 100%;
    perspective: 500px;
    z-index: 1;
}

/* Base card interaction rules */
.tarea-card-expandable {
    pointer-events: none;
    /* Let mouse pass to grid */
    transition: transform 0.1s ease-out, box-shadow 0.3s ease;
    z-index: 20;
    /* Ensure card is ABOVE grid (z-5) so buttons are clickable */
}

/* Re-enable interaction for buttons and links */
/* Re-enable interaction for buttons and links */
.tarea-card-expandable button,
.tarea-card-expandable a,
.tarea-card-expandable .expand-toggle-btn,
.tarea-card-expandable .expandable-card-header,
/* Allow clicking header to expand */
.tarea-card-expandable .contributor-avatar

/* Allow clicking avatars */
    {
    pointer-events: auto;
    position: relative;
    z-index: 20;
    /* Keep high */
}

/* Nitro Glow and Opacity on Hover */
.tarea-card-container:hover .tarea-card-expandable {
    box-shadow: 0px 0px 40px 2px rgba(204, 0, 255, 0.4);
}

.tarea-card-container:hover .card-background-mask {
    opacity: 1;
}

/* Mouse Tracker Grid */
.mouse-tracker-grid {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
}

/* Transform Logic */
.tr-1:hover~.tarea-card-expandable {
    transform: translateZ(50px) rotateX(10deg) rotateY(-10deg);
}

.tr-2:hover~.tarea-card-expandable {
    transform: translateZ(50px) rotateX(10deg) rotateY(-5deg);
}

.tr-3:hover~.tarea-card-expandable {
    transform: translateZ(50px) rotateX(10deg) rotateY(0deg);
}

.tr-4:hover~.tarea-card-expandable {
    transform: translateZ(50px) rotateX(10deg) rotateY(5deg);
}

.tr-5:hover~.tarea-card-expandable {
    transform: translateZ(50px) rotateX(10deg) rotateY(10deg);
}

.tr-6:hover~.tarea-card-expandable {
    transform: translateZ(50px) rotateX(5deg) rotateY(-10deg);
}

.tr-7:hover~.tarea-card-expandable {
    transform: translateZ(50px) rotateX(5deg) rotateY(-5deg);
}

.tr-8:hover~.tarea-card-expandable {
    transform: translateZ(50px) rotateX(5deg) rotateY(0deg);
}

.tr-9:hover~.tarea-card-expandable {
    transform: translateZ(50px) rotateX(5deg) rotateY(5deg);
}

.tr-10:hover~.tarea-card-expandable {
    transform: translateZ(50px) rotateX(5deg) rotateY(10deg);
}

.tr-11:hover~.tarea-card-expandable {
    transform: translateZ(50px) rotateX(0deg) rotateY(-10deg);
}

.tr-12:hover~.tarea-card-expandable {
    transform: translateZ(50px) rotateX(0deg) rotateY(-5deg);
}

.tr-13:hover~.tarea-card-expandable {
    transform: translateZ(50px) rotateX(0deg) rotateY(0deg);
}

.tr-14:hover~.tarea-card-expandable {
    transform: translateZ(50px) rotateX(0deg) rotateY(5deg);
}

.tr-15:hover~.tarea-card-expandable {
    transform: translateZ(50px) rotateX(0deg) rotateY(10deg);
}

.tr-16:hover~.tarea-card-expandable {
    transform: translateZ(50px) rotateX(-5deg) rotateY(-10deg);
}

.tr-17:hover~.tarea-card-expandable {
    transform: translateZ(50px) rotateX(-5deg) rotateY(-5deg);
}

.tr-18:hover~.tarea-card-expandable {
    transform: translateZ(50px) rotateX(-5deg) rotateY(0deg);
}

.tr-19:hover~.tarea-card-expandable {
    transform: translateZ(50px) rotateX(-5deg) rotateY(5deg);
}

.tr-20:hover~.tarea-card-expandable {
    transform: translateZ(50px) rotateX(-5deg) rotateY(10deg);
}

.tr-21:hover~.tarea-card-expandable {
    transform: translateZ(50px) rotateX(-10deg) rotateY(-10deg);
}

.tr-22:hover~.tarea-card-expandable {
    transform: translateZ(50px) rotateX(-10deg) rotateY(-5deg);
}

.tr-23:hover~.tarea-card-expandable {
    transform: translateZ(50px) rotateX(-10deg) rotateY(0deg);
}

.tr-24:hover~.tarea-card-expandable {
    transform: translateZ(50px) rotateX(-10deg) rotateY(5deg);
}

.tr-25:hover~.tarea-card-expandable {
    transform: translateZ(50px) rotateX(-10deg) rotateY(10deg);
}




/* Drag and drop disabled */

/* ============================================
   CARD HEADER
   ============================================ */

.expandable-card-header {
    padding: 12px 27px 8px;
    position: relative;
    z-index: 2;
    border-top: 3px solid var(--priority-color, #6366f1);
    border-radius: 14px 14px 0 0;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.status-todo {
    background: rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.status-badge.status-progress {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-badge.status-review {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badge.status-done {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.expand-toggle-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    /* Cambiado a circular para que combine con el nuevo icono */
    color: #c7d2fe;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.expand-toggle-btn:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.3));
    border-color: rgba(99, 102, 241, 0.5);
    color: #ffffff;
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.expand-toggle-btn .material-symbols-outlined {
    font-size: 24px;
    /* Un poco más grande para que destaque */
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.tarea-card-expandable[data-expanded="true"] .expand-toggle-btn {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(139, 92, 246, 0.4));
    border-color: rgba(99, 102, 241, 0.6);
}

.tarea-card-expandable[data-expanded="true"] .expand-toggle-btn .material-symbols-outlined {
    transform: rotate(90deg);
    /* Rota hacia abajo al expandir */
}

.expandable-title {
    font-size: 19px;
    /* Aumentado 4px */
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1.4;
    margin: 0 0 8px 0;
    word-break: break-word;
    transition: transform 0.3s ease;
}

/* .tarea-card-expandable:hover .expandable-title {
    transform: translateZ(20px);
    text-shadow: 0 5px 10px rgba(0, 0, 0, 0.5);
} */

.expandable-description {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.5;
    margin: 0;
    word-break: break-word;
}

/* ============================================
   CARD MAIN CONTENT - Now inside expandable
   ============================================ */

/* ============================================
   PROGRESS SECTION (Always Visible)
   ============================================ */

.expandable-progress {
    padding: 0 27px 8px;
    position: relative;
    z-index: 2;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.progress-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.progress-value {
    font-size: 13px;
    font-weight: 700;
    color: #c7d2fe;
}

.progress-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    animation: shimmer 2s infinite;
}

.progress-fill.complete {
    background: linear-gradient(90deg, #22c55e, #10b981);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* ============================================
   EXPANDABLE CONTENT
   ============================================ */

.expandable-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s ease;
    opacity: 0;
}

.tarea-card-expandable[data-expanded="true"] .expandable-content {
    max-height: 2000px;
    opacity: 1;
    overflow: visible;
}

.expandable-content-inner {
    padding: 16px 31px;
    /* Aumentado 15px horizontal */
    padding-top: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 0;
    padding-top: 16px;
}

/* Description inside expandable */
.expandable-content .expandable-description {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.5;
    margin: 0;
    word-break: break-word;
}

/* Meta Info */
.expandable-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #cbd5e1;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.meta-item .material-symbols-outlined {
    font-size: 16px;
    color: #94a3b8;
}

.meta-item.due-date {
    color: #fca5a5;
}

.meta-item.due-date .material-symbols-outlined {
    color: #ef4444;
}

/* Tags */
.expandable-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-pill {
    padding: 2px 8px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 10px;
    font-size: 10px;
    color: #c7d2fe;
    font-weight: 500;
}

/* Contributors Section */
.expandable-contributors {
    padding: 8px 0;
    display: block !important;
    visibility: visible !important;
    width: 100%;
}

.expandable-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    margin: 0 0 10px 0;
}

.expandable-section-title .material-symbols-outlined {
    font-size: 18px;
    color: #a5b4fc;
}

.contributor-avatars {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.contributor-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(15, 23, 42, 0.9);
    margin-left: -6px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: white;
    transition: all 0.3s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.contributor-avatar:first-child {
    margin-left: 0;
}

.contributor-avatar:hover {
    transform: scale(1.15) translateY(-3px);
    z-index: 10;
    border-color: rgba(99, 102, 241, 0.8);
    box-shadow: 0 6px 12px rgba(99, 102, 241, 0.35);
}

.contributor-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.contributor-avatar.more {
    background: #475569;
    font-size: 11px;
}

/* Subtasks Section */
.expandable-subtasks {
    padding: 8px 0;
    display: block !important;
    visibility: visible !important;
    width: 100%;
}

.expandable-subtasks h4,
.expandable-subtasks .expandable-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    margin: 0 0 12px 0;
}

.subtask-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.subtask-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}

.subtask-title {
    font-size: 13px;
    color: #e2e8f0;
    flex: 1;
    margin-right: 8px;
}

.subtask-item.completed .subtask-title {
    color: #94a3b8;
    text-decoration: line-through;
}

.subtask-check {
    font-size: 20px;
    color: #22c55e;
    flex-shrink: 0;
}

.subtask-pending {
    font-size: 20px;
    color: #64748b;
    flex-shrink: 0;
}



/* ============================================
   CARD FOOTER (Always Visible - Before Expandable)
   ============================================ */

.expandable-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 29px;
    position: relative;
    z-index: 2;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0 0 16px 16px;
    margin-top: auto;
}

/* When expanded, footer loses bottom radius */
.tarea-card-expandable[data-expanded="true"] .expandable-card-footer {
    border-radius: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.last-updated {
    font-size: 11px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 4px;
}

.open-issues {
    font-size: 11px;
    color: #a5b4fc;
    font-weight: 500;
}

.footer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.priority-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}



/* ============================================
   LIGHT MODE OVERRIDES
   ============================================ */
/* NOTE: Light mode overrides for task cards should also be here or in a separate theme file. 
   For now, I'm including them here for completeness of the component. */

.light-mode .tarea-card-expandable {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(203, 213, 225, 0.6);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* .light-mode .tarea-card-expandable:hover {
    background: white;
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.12);
} */

.light-mode .expandable-title {
    color: #0f172a !important;
    /* Darker Gray requested by user */
    font-weight: 600;
    text-shadow: none !important;
}

.light-mode .expandable-description {
    color: #64748b;
}

.light-mode .expand-toggle-btn {
    background: rgba(241, 245, 249, 0.8);
    border-color: rgba(203, 213, 225, 0.6);
    color: #64748b;
}

.light-mode .expand-toggle-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    color: #6366f1;
}

.light-mode .progress-track {
    background: rgba(203, 213, 225, 0.4);
}

.light-mode .meta-item {
    background: rgba(241, 245, 249, 0.8);
    border-color: rgba(203, 213, 225, 0.5);
    color: #475569;
}

.light-mode .expandable-card-footer {
    background: rgba(241, 245, 249, 0.5);
    border-top-color: rgba(203, 213, 225, 0.5);
}

.light-mode .last-updated {
    color: #94a3b8;
}

.light-mode .subtask-item {
    background: rgba(241, 245, 249, 0.6);
}

.light-mode .subtask-title {
    color: #334155;
}