/* =====================================================
   PLANNING — Crayon & Emploi du temps Aventurier
   ===================================================== */

/* ── Animations crayon ── */
@keyframes pencil-shimmer {
    0%,  100% { background-position:   0% 50%; }
    50%        { background-position: 100% 50%; }
}

@keyframes star-bounce {
    0%,  100% {
        transform: translateX(-50%) scale(1);
        filter: drop-shadow(0 0 5px gold);
    }
    50% {
        transform: translateX(-50%) scale(1.35);
        filter: drop-shadow(0 0 12px #ffd60a);
    }
}

@keyframes pulse-orange {
    0%   { box-shadow: 0 0 0   0  rgba(233, 168, 58, 0.45); }
    70%  { box-shadow: 0 0 0 12px rgba(233, 168, 58, 0); }
    100% { box-shadow: 0 0 0   0  rgba(233, 168, 58, 0); }
}

[data-theme="dark"] .current-task td {
    animation: pulse-orange-dark 2s infinite;
}

@keyframes pulse-orange-dark {
    0%   { box-shadow: 0 0 0   0  rgba(100, 255, 218, 0.4); }
    70%  { box-shadow: 0 0 0 12px rgba(100, 255, 218, 0); }
    100% { box-shadow: 0 0 0   0  rgba(100, 255, 218, 0); }
}

/* ── Conteneur planning ── */
.planning-container {
    display: flex;
    gap: 30px;
    align-items: stretch;
    position: relative;
    padding: 1rem 0;
}

/* ── Corps du crayon (hexagonal) ── */
.timeline-track {
    position: relative;
    width: 30px;
    flex-shrink: 0;
    z-index: 5;
    margin-top: 28px;
    margin-bottom: 20px;
    overflow: visible;
    /* Corps jaune doré */
    background: linear-gradient(90deg,
        #b8730a 0%, #d4930e 12%, #f5c518 30%,
        #ffe566 50%, #f5c518 70%, #d4930e 88%, #b8730a 100%);
    border-radius: 3px 3px 0 0;
    box-shadow: 2px 0 6px rgba(0,0,0,0.25),
               -1px 0 3px rgba(0,0,0,0.15);
}

/* ── Gomme rose (haut) ── */
.timeline-track::before {
    content: '';
    position: absolute;
    top: -28px;
    left: -2px;
    right: -2px;
    height: 28px;
    background: linear-gradient(90deg,
        #c05570, #f0809a, #ffb3c6, #f0809a, #c05570);
    border-radius: 8px 8px 2px 2px;
    box-shadow: 0 -3px 10px rgba(255, 80, 120, 0.35),
                2px 0 6px rgba(0,0,0,0.2);
    border-bottom: 4px solid #9a9a9a;
}

/* ── Pointe en bois (bas) ── */
.timeline-track::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: -1px;
    right: -1px;
    height: 20px;
    background: linear-gradient(90deg,
        #5c2e08, #9a5c20, #c87d30, #9a5c20, #5c2e08);
    clip-path: polygon(10% 0, 90% 0, 55% 100%, 45% 100%);
}

/* ── Mine / remplissage animé ── */
.timeline-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    background: linear-gradient(90deg,
        #b8730a 0%, #d4930e 12%, #f5c518 30%,
        #ffe566 50%, #f5c518 70%, #d4930e 88%, #b8730a 100%);
    background-size: 200% 100%;
    animation: pencil-shimmer 4s ease-in-out infinite;
    transition: height 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Étoile indicatrice ── */
.timeline-progress::after {
    content: '⭐';
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    line-height: 1;
    animation: star-bounce 2s ease-in-out infinite;
    display: block;
    z-index: 20;
    pointer-events: none;
}

/* ── Reflet mine ── */
.timeline-progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255,255,255,0.65);
    box-shadow: 0 0 8px rgba(255,255,200,0.95);
}

/* ── Table planning ── */
.planning-table-container {
    overflow-x: auto;
    flex: 1;
}

.planning {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
}

.planning tr {
    border-radius: 0.75rem;
    transition: background 0.2s ease;
}

.planning tr:not(.current-task):hover td {
    background: var(--stamp-color);
}

.planning td {
    padding: 0.9rem 1rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.planning td:first-child {
    font-weight: 800;
    color: var(--primary);
    white-space: nowrap;
    width: 150px;
    border-left: 3px solid var(--border);
    border-radius: 0.5rem 0 0 0.5rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
}

[data-theme="dark"] .planning td:first-child {
    color: var(--secondary);
}

.planning td:last-child {
    border-right: 3px solid var(--border);
    border-radius: 0 0.5rem 0.5rem 0;
}

/* ── Tâche en cours ── */
.current-task td {
    background: var(--glass-bg) !important;
    border-color: var(--secondary) !important;
    border-width: 2px !important;
    transform: scale(1.02);
    z-index: 5;
    animation: pulse-orange 2s infinite;
    font-weight: 700;
}

.current-task td:first-child {
    color: var(--secondary) !important;
    border-left-color: var(--secondary) !important;
    border-left-width: 4px !important;
}

[data-theme="dark"] .current-task td {
    background: rgba(100, 255, 218, 0.07) !important;
    border-color: var(--primary) !important;
}

[data-theme="dark"] .current-task td:first-child {
    color: var(--primary) !important;
    border-left-color: var(--primary) !important;
}
