/*
 * polish.css — Sora.ion App Suite
 * Shared micro-enhancements across all mini-apps
 * Light · Minimal · Just the right amount of magic
 */

/* ── Page Entrance ── */
@keyframes pageIn {
    from { opacity: 0; transform: translate3d(0, 15px, 0); }
    to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

body > .container {
    animation: pageIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ── Header slides in from top ── */
@keyframes headerIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.header {
    animation: headerIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
}

/* ── Controls fade in ── */
.controls {
    animation: pageIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(90, 143, 196, 0.3);
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(90, 143, 196, 0.55);
}

/* Firefox */
* { scrollbar-width: thin; scrollbar-color: rgba(90,143,196,0.3) transparent; }

/* ── Text Selection ── */
::selection {
    background: rgba(90, 143, 196, 0.2);
    color: inherit;
}

/* ── Focus Ring ── */
:focus-visible {
    outline: 2.5px solid rgba(90, 143, 196, 0.6);
    outline-offset: 2px;
    border-radius: 6px;
}

/* ── Button Press Feedback ── */
button:active:not(:disabled),
.ss-theme-dot:active,
.grid-cell:active,
a.add-btn:active {
    transform: scale(0.96) translate3d(0, 0, 0) !important;
    transition: transform 0.1s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* ── Prevent Mobile Zoom on Input ── */
@media screen and (max-width: 768px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* ── Card Stagger Animation ── */
.stat-card:nth-child(1) { animation: pageIn 0.4s ease 0.12s both; }
.stat-card:nth-child(2) { animation: pageIn 0.4s ease 0.18s both; }
.stat-card:nth-child(3) { animation: pageIn 0.4s ease 0.24s both; }

/* ── "empty-state" enhancement ── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 52px 20px;
    color: #9ca3af;
    font-size: 14px;
    font-weight: 500;
}
.empty-state::before {
    font-size: 36px;
    display: block;
    opacity: 0.55;
    margin-bottom: 2px;
}

/* tasks empty state icon */
.tasks-list .empty-state::before   { content: '📝'; }
.history-list .empty-state::before { content: '⏱️'; }
.tasks-card .tasks-list .empty-state::before { content: '☑️'; }

/* ── Smooth border-color on all inputs ── */
input, select, textarea {
    transition:
        border-color 0.18s ease,
        box-shadow    0.18s ease,
        background    0.18s ease !important;
}

/* ── Cards subtle entrance on scroll ── */
@keyframes cardFadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.left-section > *,
.right-section > * {
    animation: cardFadeUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.left-section > *:nth-child(1)  { animation-delay: 0.08s; }
.left-section > *:nth-child(2)  { animation-delay: 0.14s; }
.left-section > *:nth-child(3)  { animation-delay: 0.20s; }
.left-section > *:nth-child(4)  { animation-delay: 0.26s; }
.right-section > *:nth-child(1) { animation-delay: 0.12s; }
.right-section > *:nth-child(2) { animation-delay: 0.18s; }
.right-section > *:nth-child(3) { animation-delay: 0.24s; }

/* ── Link buttons consistent underline removal ── */
a { text-decoration: none; }

/* ── Toast/snackbar base style (if used) ── */
.toast {
    position: fixed; bottom: 24px; left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e; color: white;
    padding: 12px 24px; border-radius: 40px;
    font-size: 14px; font-weight: 600;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    z-index: 9999;
    animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Responsive: reduce animation on slow devices ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
