/* Time Marks — Time Is Valuable Design System */
/* Visual language where time is premium, amber/cyan accents, monospace precision */

:root {
    --tm-primary: #F59E0B;
    --tm-primary-light: #FCD34D;
    --tm-primary-dark: #D97706;
    --tm-cyan: #06B6D4;
    --tm-cyan-light: #67E8F9;
    --tm-glow: rgba(245, 158, 11, 0.15);
    --tm-glow-strong: rgba(245, 158, 11, 0.25);
    --tm-glow-cyan: rgba(6, 182, 212, 0.15);
    --tm-glass: rgba(255, 255, 255, 0.7);
    --tm-glass-dark: rgba(15, 23, 42, 0.6);
}

/* ===== Planavaya brand — bright, directional and compact ===== */
.brand-lockup { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.brand-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 14px; filter: drop-shadow(0 7px 10px rgba(220,110,77,.2)); transition: transform .25s ease, filter .25s ease; }
.brand-icon svg { width: 100%; height: 100%; overflow: visible; }
.brand-lockup:hover .brand-icon { transform: translateY(-2px) rotate(-4deg); filter: drop-shadow(0 10px 14px rgba(220,110,77,.3)); }
.brand-word { color: #183b34; letter-spacing: -.045em; }
:root[data-theme="dark"] .brand-word { color: #f8f5ec; }
.brand-dot { color: #dc6e4d; }
@media (max-width: 420px) { .brand-icon { width: 36px; height: 36px; } .brand-word { font-size: 1rem; } }

/* Clear navigation control: a label gives the mobile drawer a purpose. */
.menu-trigger { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 13px; border: 1px solid #d5dfd7; border-radius: 999px; color: #34564d; background: #f7faf6; font: 800 .75rem/1 'Manrope', 'Trebuchet MS', sans-serif; letter-spacing: .01em; transition: .2s ease; cursor: pointer; }
.menu-trigger i { font-size: .9rem; }
.menu-trigger:hover, .menu-trigger--open { color: #fff; border-color: #183b34; background: #183b34; box-shadow: 0 7px 18px rgba(24,59,52,.18); }
.dark .menu-trigger { color: #e8f0e8; border-color: #49645b; background: #213b35; }
.dark .menu-trigger:hover, .dark .menu-trigger--open { color: #183b34; border-color: #f2b94b; background: #f2b94b; }
@media (max-width: 480px) { .menu-trigger { width: 40px; justify-content: center; padding: 0; } .menu-trigger span { display: none; } }

/* ===== Core Time Mark ===== */
.tm-mark {
    font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    color: var(--tm-primary);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.04) 100%);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 6px;
    padding: 4px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.tm-mark::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 7px;
    background: linear-gradient(135deg, var(--tm-primary), var(--tm-cyan));
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.tm-mark:hover::before {
    opacity: 0.15;
}

.tm-mark i {
    font-size: 0.75rem;
    color: var(--tm-primary-dark);
}

/* ===== Time companion — a tiny, safe-corner reminder ===== */
.time-pet { pointer-events: none; }
.time-pet__bubble, .time-pet__button { pointer-events: auto; }
.time-pet__bubble { animation: pet-bubble-in .24s cubic-bezier(.2,.8,.2,1); }
.time-pet__tail {
    position: absolute; right: 20px; bottom: -6px; width: 12px; height: 12px;
    background: inherit; border-right: 1px solid rgba(245,158,11,.28); border-bottom: 1px solid rgba(245,158,11,.28);
    transform: rotate(45deg);
}
.time-pet__button {
    display: flex; align-items: center; gap: 7px; padding: 5px 9px 5px 5px;
    border: 1px solid rgba(245,158,11,.28); border-radius: 999px;
    color: #92400e; background: rgba(255,255,255,.86); box-shadow: 0 12px 30px rgba(120,72,12,.14), inset 0 1px rgba(255,255,255,.9);
    backdrop-filter: blur(12px); transition: transform .22s ease, box-shadow .22s ease; cursor: pointer;
    animation: pet-float 4.5s ease-in-out infinite;
}
.time-pet__button:hover { transform: translateY(-3px) rotate(-1deg); box-shadow: 0 16px 34px rgba(120,72,12,.2); }
.time-pet__orb { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: #fff; background: linear-gradient(145deg,#f7c65b,#e78939); box-shadow: inset 0 2px rgba(255,255,255,.35); }
.time-pet__orb i { font-size: 17px; }
.time-pet__spark { position: absolute; right: 2px; top: 3px; width: 7px; height: 7px; border: 2px solid #fff7df; border-radius: 50%; background: #dc6e4d; }
.time-pet__time { min-width: 60px; font: 700 .78rem/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .04em; }
@keyframes pet-float { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(1deg); } }
@keyframes pet-bubble-in { from { opacity: 0; transform: scale(.92) translateY(5px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@media (max-width: 480px) { .time-pet { right: 12px; bottom: 12px; } .time-pet__bubble { right: -2px; width: 176px; } .time-pet__button { padding-right: 8px; } }
@media (prefers-reduced-motion: reduce) { .time-pet__button, .time-pet__bubble { animation: none; transition: none; } }

/* ===== Time Badge — compact inline time ===== */
.tm-badge {
    font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--tm-primary-dark);
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: 4px;
    padding: 2px 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.tm-badge-cyan {
    color: var(--tm-cyan);
    background: rgba(6, 182, 212, 0.1);
    border-color: rgba(6, 182, 212, 0.15);
}

/* ===== Duration Badge — estimated time ===== */
.tm-duration {
    font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
    font-size: 0.6875rem;
    font-weight: 500;
    color: #92400E;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(245, 158, 11, 0.08) 100%);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 20px;
    padding: 3px 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.01em;
}

.tm-duration i {
    font-size: 0.625rem;
}

.tm-duration-large {
    font-size: 0.8125rem;
    padding: 5px 14px;
    border-radius: 24px;
}

/* ===== Time Pulse — subtle glow indicating time is active ===== */
.tm-pulse {
    position: relative;
}

.tm-pulse::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--tm-primary);
    opacity: 0;
    animation: tmPulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes tmPulse {
    0%, 100% { opacity: 0; transform: scale(1); }
    50% { opacity: 0.06; transform: scale(1.05); }
}

/* ===== Timeline Event Marker ===== */
.tm-timeline-marker {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0;
}

.tm-timeline-marker::before {
    content: '';
    position: absolute;
    left: 19px;
    top: 44px;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, rgba(245, 158, 11, 0.4), rgba(245, 158, 11, 0.1));
    border-radius: 1px;
}

.tm-timeline-dot {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--tm-primary) 0%, var(--tm-primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: 'SF Mono', 'JetBrains Mono', monospace, monospace;
    font-size: 0.6875rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
    position: relative;
    z-index: 1;
}

.tm-timeline-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid rgba(245, 158, 11, 0.3);
    animation: tmDotPulse 2s ease-in-out infinite;
}

@keyframes tmDotPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.15); opacity: 0; }
}

/* ===== Time Header Bar ===== */
.tm-bar {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.02) 0%, rgba(245, 158, 11, 0.03) 100%);
    border-bottom: 1px solid rgba(245, 158, 11, 0.1);
    padding: 8px 0;
    position: relative;
    overflow: hidden;
}

.tm-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--tm-primary), transparent);
    opacity: 0.4;
}

.tm-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
}

.tm-bar-time {
    font-family: 'SF Mono', 'JetBrains Mono', monospace, monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--tm-primary-dark);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tm-bar-time i {
    font-size: 0.6875rem;
    animation: tmTick 1s steps(1) infinite;
}

@keyframes tmTick {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
}

.tm-bar-label {
    font-size: 0.6875rem;
    color: #64748b;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ===== Glass Card with Time Accent ===== */
.tm-glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(245, 158, 11, 0.12);
    border-radius: 16px;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.04),
        0 1px 4px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.tm-glass-card:hover {
    border-color: rgba(245, 158, 11, 0.25);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.06),
        0 0 0 1px rgba(245, 158, 11, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

.tm-glass-card-dark {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(245, 158, 11, 0.15);
}

/* ===== Time Progress Indicator ===== */
.tm-progress {
    height: 3px;
    background: rgba(245, 158, 11, 0.15);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.tm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--tm-primary-dark), var(--tm-cyan));
    border-radius: 2px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.tm-progress-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: -1px;
    bottom: -1px;
    width: 8px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6));
    border-radius: 2px;
}

/* ===== Responsive — xs breakpoint (320px+) ===== */
@media (max-width: 480px) {
    .tm-mark {
        font-size: 0.75rem;
        padding: 2px 6px;
        gap: 4px;
    }

    .tm-mark i {
        font-size: 0.6875rem;
    }

    .tm-badge {
        font-size: 0.6875rem;
        padding: 1px 4px;
        gap: 3px;
    }

    .tm-duration {
        font-size: 0.625rem;
        padding: 2px 6px;
    }

    .tm-duration i {
        display: none;
    }

    .tm-duration-large {
        font-size: 0.6875rem;
        padding: 3px 10px;
    }

    .tm-timeline-dot {
        width: 32px;
        height: 32px;
        font-size: 0.5625rem;
    }

    .tm-timeline-marker::before {
        left: 15px;
        top: 36px;
    }
}

@media (max-width: 640px) {
    .tm-mark {
        font-size: 0.8125rem;
        padding: 3px 8px;
    }

    .tm-duration {
        font-size: 0.625rem;
        padding: 2px 8px;
    }

    .tm-duration-large {
        font-size: 0.75rem;
        padding: 4px 12px;
    }

    .tm-timeline-dot {
        width: 36px;
        height: 36px;
        font-size: 0.625rem;
    }

    .tm-timeline-marker::before {
        left: 17px;
        top: 40px;
    }
}

/* ===== Dark Mode ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --tm-glass: rgba(15, 23, 42, 0.6);
    }

    .tm-badge {
        color: var(--tm-primary-light);
        background: rgba(245, 158, 11, 0.15);
        border-color: rgba(245, 158, 11, 0.25);
    }

    .tm-duration {
        color: var(--tm-primary-light);
        background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(245, 158, 11, 0.1) 100%);
        border-color: rgba(245, 158, 11, 0.3);
    }

    .tm-glass-card {
        background: rgba(15, 23, 42, 0.5);
        border-color: rgba(245, 158, 11, 0.15);
        box-shadow:
            0 4px 16px rgba(0, 0, 0, 0.3),
            0 1px 4px rgba(0, 0, 0, 0.2);
    }

    .tm-glass-card:hover {
        background: rgba(15, 23, 42, 0.65);
        border-color: rgba(245, 158, 11, 0.3);
    }

    .tm-bar {
        background: linear-gradient(135deg, rgba(15, 23, 42, 0.05) 0%, rgba(245, 158, 11, 0.05) 100%);
        border-color: rgba(245, 158, 11, 0.15);
    }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    .tm-pulse::after,
    .tm-timeline-dot::after,
    .tm-bar-time i,
    .tm-mark::before {
        animation: none;
    }

    .tm-glass-card,
    .tm-mark::before {
        transition: none;
    }
}
