/* Hand-written styles the Tailwind CDN build can't cover. Palette matches the
   inline tailwind.config in layouts/app.blade.php (terracotta / sage / coral). */

:root {
    --im-terracotta: #C97B4A;
    --im-terracotta-dark: #B5651D;
    --im-terracotta-light: #F0E4D0;
    --im-sage: #6B8F71;
    --im-coral: #C25450;
    --im-ink: #4A3F2E;
    --im-muted: #8A7A62;
}

/* Range inputs: native accent colours the thumb AND the filled part of the
   track in one line — warm terracotta instead of the browser's blue. */
input[type='range'] {
    accent-color: var(--im-terracotta);
    height: 1.5rem;
    cursor: pointer;
}

/* Consistent warm focus ring app-wide (was the browser default / a stray blue). */
:focus-visible {
    outline: 2px solid var(--im-terracotta);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Subtle lift for the standard card. Add `im-card` alongside the existing
   `rounded-2xl border ... bg-white` utilities. */
.im-card {
    box-shadow: 0 1px 2px rgba(74, 63, 46, 0.04), 0 4px 16px rgba(74, 63, 46, 0.05);
}

/* Section-heading icon chip. */
.im-heading-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 1.75rem;
    width: 1.75rem;
    border-radius: 0.625rem;
    background: rgba(240, 228, 208, 0.7);
    color: var(--im-terracotta);
    flex: none;
}

/* Dashboard check-in card: sage accent once the instrument is done today. */
.checkin-card {
    border-left: 4px solid transparent;
    transition: border-color 200ms ease;
}
.checkin-card.is-done {
    border-left-color: var(--im-sage);
}

/* Shared loading / empty / error block inside islands. */
.im-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
    text-align: center;
    color: var(--im-muted);
    font-size: 0.875rem;
}
.im-state i {
    font-size: 1.5rem;
    opacity: 0.6;
}
.im-state.is-error i {
    color: var(--im-coral);
    opacity: 1;
}
i.ti-loader-2 {
    display: inline-block;
    animation: im-spin 900ms linear infinite;
}
@keyframes im-spin {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    i.ti-loader-2 { animation: none; }
}
.im-state button {
    margin-top: 0.25rem;
    border-radius: 0.75rem;
    border: 1px solid var(--im-terracotta-light);
    padding: 0.375rem 0.875rem;
    color: var(--im-terracotta-dark);
}

/* Mini value meter for the "completed today" result panels. */
.im-meter {
    display: inline-flex;
    gap: 3px;
    vertical-align: middle;
}
.im-meter-seg {
    width: 0.5rem;
    height: 1rem;
    border-radius: 3px;
    background: rgba(138, 122, 98, 0.18);
}
.im-meter-seg.on-sage { background: var(--im-sage); }
.im-meter-seg.on-coral { background: var(--im-coral); }
.im-meter-seg.on-terracotta { background: var(--im-terracotta); }

/* Sticky in-page section nav on the long report/statistics pages. */
.im-section-nav {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    gap: 0.375rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    background: linear-gradient(to bottom, #FBF7F0 75%, rgba(251, 247, 240, 0));
    scrollbar-width: none;
}
.im-section-nav::-webkit-scrollbar { display: none; }
.im-section-nav a {
    white-space: nowrap;
    border-radius: 9999px;
    border: 1px solid var(--im-terracotta-light);
    background: #fff;
    padding: 0.25rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--im-muted);
}
.im-section-nav a:hover {
    color: var(--im-ink);
    background: rgba(240, 228, 208, 0.4);
}
.im-anchor { scroll-margin-top: 3.5rem; }

/* Reward moment for freshly-submitted daily check-ins (see public/js/celebrate.js). */
.ironmind-pop-in {
    animation: ironmind-pop-in 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes ironmind-pop-in {
    0% { transform: scale(0.92); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.ironmind-confetti-burst {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: visible;
    z-index: 20;
}

.ironmind-confetti-particle {
    position: absolute;
    top: 0;
    font-size: 1.25rem;
    opacity: 0;
    animation: ironmind-confetti-pop var(--duration, 900ms) ease-out forwards;
}

@keyframes ironmind-confetti-pop {
    0% { opacity: 0; transform: translate(0, 0) rotate(0deg) scale(0.5); }
    15% { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(360deg) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .ironmind-pop-in { animation: none; }
    .checkin-card { transition: none; }
}
