/*
 * Login page: the stylised day planning on the left (same structure and status colours as the
 * real day view, see ember/public/src/shared/style/planning.scss). Driven by login-planning.js.
 */

/* The mini app: same structure as the real day view */
.app {
    --label-w: 292px;
    --line: #e4eaf2;
    position: relative;
    animation: fade-up 800ms var(--ease-out) 200ms both;
}

.app-frame {
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    color: #24364d;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18), 0 30px 60px -20px rgba(4, 20, 45, 0.6);
}

.app-body { transition: opacity 600ms; }
.resetting .app-body { opacity: 0; }

.app-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 38px;
    padding: 0 12px;
    background: #3b8ad6;
    color: #fff;
    font: 600 11px/1 "Open Sans", sans-serif;
}

.app-nav .nav-logo { display: block; height: 24px; width: auto; margin: 0 14px 0 -2px; }
.app-nav span { padding: 6px 9px; border-radius: 6px; opacity: 0.85; }
.app-nav span.on { background: rgba(255, 255, 255, 0.22); opacity: 1; }

.app-day {
    display: grid;
    grid-template-columns: var(--label-w) 1fr;
    align-items: center;
    height: 30px;
    padding: 0 12px;
    border-bottom: 1px solid var(--line);
    font: 600 11.5px/1 "Open Sans", sans-serif;
}

.app-day .when::before { content: "‹  "; color: #8a99ad; }
.app-day .when::after { content: "  ›"; color: #8a99ad; }

.hours {
    display: flex;
    justify-content: space-between;
    font: 500 9.5px/1 "Open Sans", sans-serif;
    color: #8a99ad;
}

.event, .shift-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    font: 700 11px/1 "Open Sans", sans-serif;
    white-space: nowrap;
}

.event { height: 30px; background: #3185d2; color: #fff; }
.shift-row { height: 26px; background: #8dbfe8; color: #12345a; font-weight: 600; }

.event .name, .shift-row .name { flex: 1; overflow: hidden; text-overflow: ellipsis; }

.count {
    min-width: 30px;
    padding: 3px 5px;
    border-radius: 4px;
    text-align: center;
    font-size: 10px;
    background: #e05757;
    color: #fff;
    transition: background 300ms;
}

/* red while people are missing, green when the shift is full (as in the real planning) */
.count.full { background: #008a5d; }

.event .meta { font-weight: 600; opacity: 0.92; font-variant-numeric: tabular-nums; }

.export {
    padding: 3px 7px;
    border-radius: 999px;
    background: #fff;
    color: #1f7a46;
    font-size: 9.5px;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 300ms, transform 400ms var(--ease-spring);
}

.declared .export { opacity: 1; transform: none; transition-delay: 1.3s; }

.send-icon { width: 14px; height: 14px; opacity: 0.75; }

/* Employee rows */
.emp {
    position: relative;
    display: grid;
    grid-template-columns: var(--label-w) 1fr;
    align-items: center;
    height: 42px;
    padding: 0 12px;
    border-bottom: 1px solid var(--line);
}

.emp:last-child { border-bottom: 0; }

.label { position: relative; height: 100%; display: flex; align-items: center; }

/* Open jobspot: red outline and a red user-plus square */
.ghost {
    position: absolute;
    inset: 6px 0;
    padding: 0 6px;
    border: 1px solid #e05757;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    font: 600 11px/1 "Open Sans", sans-serif;
    color: #9aa9bc;
    transition: opacity 250ms;
}

.ghost .plus {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: #e05757;
    color: #fff;
}

.ghost .plus svg { width: 11px; height: 11px; }
.ghost .plus .ic-plane { display: none; }
.ghost .sent-text { display: none; color: #44566d; }
.sent .ghost .add-text { display: none; }
.sent .ghost .sent-text { display: inline; }
/* call-out sent, waiting for an answer: orange paper plane */
.sent .ghost .plus { background: #f2994a; }
.sent .ghost .plus .ic-add { display: none; }
.sent .ghost .plus .ic-plane { display: block; }

.who {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    opacity: 0;
    transform: translateX(-14px);
    transition: opacity 350ms, transform 500ms var(--ease-out);
}

.filled .ghost { opacity: 0; }
.filled .who { opacity: 1; transform: none; }

.avatar {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #dbe7f5;
    color: #2c5f9e;
    font: 700 9px/1 "Open Sans", sans-serif;
}

.person { width: 104px; flex-shrink: 0; line-height: 1.2; }
.person b { display: block; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.person small { display: block; font-size: 9.5px; color: #8a99ad; }

.statute {
    flex-shrink: 0;
    width: 40px;
    padding: 2px 0;
    border-radius: 4px;
    text-align: center;
    font: 700 8.5px/1.2 "Open Sans", sans-serif;
}

.statute.st-a { background: #e3eefa; color: #3b7cc4; }
.statute.st-flx { background: #fdeedd; color: #d97e1e; }
.statute.st-sa { background: #e2f3e6; color: #3b9a52; }

/* Status squares in the real row's order: contract, oproep, Dimona, papieren contract, uren */
.squares { display: flex; gap: 3px; flex-shrink: 0; }

.sq {
    display: grid;
    place-items: center;
    width: 17px;
    height: 17px;
    border-radius: 4px;
    background: #dedfde;
    color: #fff;
    transform: scale(0.4);
    transition: transform 400ms var(--ease-spring), background 350ms;
}

.sq svg { display: block; width: 11px; height: 11px; }

.filled .sq { transform: none; }
.filled .sq:nth-child(2) { transition-delay: 60ms, 0s; }
.filled .sq:nth-child(3) { transition-delay: 120ms, 0s; }
.filled .sq:nth-child(4) { transition-delay: 180ms, 0s; }
.filled .sq:nth-child(5) { transition-delay: 240ms, 0s; }

.filled .sq.push { background: #008a5d; }
.filled .sq.contract { animation: contract-ok 1400ms forwards; }
.filled .sq.dimona { background: #f2994a; }
.filled .sq.paper { background: #008a5d; }
.declared .sq.dimona, .declared .sq.uren { background: #008a5d; }
.declared .emp:nth-child(2) .sq.dimona, .declared .emp:nth-child(2) .sq.uren { transition-delay: 0s, 250ms; }
.declared .emp:nth-child(3) .sq.dimona, .declared .emp:nth-child(3) .sq.uren { transition-delay: 0s, 500ms; }

@keyframes contract-ok {
    0%, 55% { background: #f2994a; }
    100% { background: #008a5d; }
}

/* Timeline track, hours 12..24 */
.track {
    position: relative;
    height: 100%;
    background-image: linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: calc(100% / 6) 100%;
}

.bar {
    position: absolute;
    top: 50%;
    height: 16px;
    margin-top: -8px;
    display: flex;
    align-items: center;
    padding: 0 6px;
    border-radius: 4px;
    background: #d0d0d0;
    color: #3c4856;
    font: 600 8.5px/1 "Open Sans", sans-serif;
    white-space: nowrap;
    overflow: hidden;
    font-variant-numeric: tabular-nums;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 650ms var(--ease-out) 250ms, background 500ms;
}

/* planned = grey, worked = light blue */
.filled .bar { transform: scaleX(1); }
.declared .bar { background: #8dbfe8; color: #12345a; }

/* The paper plane flying from the shift to the phone */
.plane {
    position: absolute;
    left: 46%;
    top: 108px;
    width: 18px;
    height: 18px;
    color: #fff;
    opacity: 0;
    pointer-events: none;
}

.sending .plane { animation: fly 1100ms cubic-bezier(0.45, 0, 0.55, 1) forwards; }

@keyframes fly {
    0% { opacity: 0; transform: translate(0, 0) rotate(0deg) scale(0.8); }
    15% { opacity: 1; }
    100% { opacity: 0; transform: translate(230px, 150px) rotate(25deg) scale(1.2); }
}

/* The employee's phone with the call-out */
.phone {
    position: absolute;
    right: -34px;
    bottom: -74px;
    z-index: 2;
    width: 156px;
    padding: 5px;
    border-radius: 22px;
    background: #10233d;
    box-shadow: 0 24px 40px -12px rgba(4, 20, 45, 0.6);
    opacity: 0;
    transform: translateY(40px) rotate(6deg);
    transition: opacity 350ms, transform 600ms var(--ease-spring);
}

.phone.in { opacity: 1; transform: rotate(6deg); }

.screen {
    overflow: hidden;
    border-radius: 17px;
    background: #eef1f5;
    color: #1f2d3d;
    font-family: "Open Sans", sans-serif;
}

.screen .ph-bar { height: 22px; background: #3b97dd; }

.ph-call {
    margin: 8px 8px 6px;
    padding: 7px 8px;
    border-radius: 8px;
    background: #ffa53a;
    color: #fff;
    font: 700 10px/1.2 "Open Sans", sans-serif;
}

.ph-call::before { content: "📣 "; }

.ph-msg {
    margin: 0 8px 6px;
    padding: 7px 8px;
    border-radius: 8px;
    background: #fff;
    line-height: 1.3;
}

.ph-msg b { display: block; font-size: 9.5px; }
.ph-msg small { font-size: 8.5px; color: #5b6c83; }

.ph-actions { position: relative; display: flex; gap: 5px; margin: 0 8px 10px; height: 24px; }

.ph-actions > span {
    flex: 1;
    display: grid;
    place-items: center;
    border-radius: 6px;
    color: #fff;
    font: 700 8.5px/1 "Open Sans", sans-serif;
    transition: opacity 250ms;
}

.ph-actions .no { background: #ff4b12; }
.ph-actions .yes { position: relative; background: #00b36b; }

.ph-actions .yes::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 26px;
    height: 26px;
    margin: -13px 0 0 -13px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    opacity: 0;
}

.tapping .ph-actions .yes::after { animation: tap 500ms ease-out; }

@keyframes tap {
    0% { opacity: 0.9; transform: scale(0.3); }
    100% { opacity: 0; transform: scale(1.8); }
}

.ph-done {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: #00b36b;
    color: #fff;
    font: 700 9px/1 "Open Sans", sans-serif;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 250ms, transform 350ms var(--ease-spring);
}

.confirmed .ph-actions > span { opacity: 0; }

.ph-done-inner { display: inline-flex; align-items: center; gap: 4px; line-height: 1; }
.ph-done-inner svg { display: block; width: 9px; height: 9px; flex-shrink: 0; }
.confirmed .ph-done { opacity: 1; transform: none; }

/* Steps under the app, in sync with the animation */
.steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
    animation: fade-up 800ms var(--ease-out) 300ms both;
}

.steps li {
    position: relative;
    padding-top: 12px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.55);
    transition: color 300ms;
}

.steps li::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.18);
}

.steps li::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 3px;
    border-radius: 3px;
    background: #6ee7f9;
    transform: scaleX(0);
    transform-origin: left;
}

.steps li.active { color: #fff; }
.steps li.active::after { animation: step-progress var(--step-ms, 2000ms) linear forwards; }
.steps li.done { color: rgba(255, 255, 255, 0.85); }
.steps li.done::after { transform: scaleX(1); }

@keyframes step-progress { to { transform: scaleX(1); } }

.steps .n { display: block; margin-bottom: 2px; font-size: 11px; color: #6ee7f9; letter-spacing: 0.04em; }

/* Small screens: only the rows, as a header band */
@media (max-width: 900px) {
    .steps, .phone, .plane, .app-nav { display: none; }
    .app { --label-w: 64%; }
    .person { width: 92px; }
    .person small, .statute { display: none; }
    .emp { height: 34px; }
    .ghost { inset: 4px 0; }
    .bar { font-size: 0; padding: 0; } /* the bars are too narrow for the times */
}

/* Narrow desktops: make room for the five status squares */
@media (min-width: 901px) and (max-width: 1180px) {
    .app { --label-w: 252px; }
    .statute { display: none; }
}
