/* ============================================================
   SMOOTH TRANSITIONS & MICRO-ANIMATIONS
   ============================================================ */

/* ── Page entry ─────────────────────────────────────────── */
@keyframes fade-up {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes scale-in {
    from { opacity: 0; transform: scale(0.93); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes slide-down {
    from { opacity: 0; transform: translateY(-14px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slide-right {
    from { opacity: 0; transform: translateX(-18px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Staggered section reveal ───────────────────────────── */
body > *,
main > section,
.premium-card {
    animation: fade-up 0.55s cubic-bezier(0.16,1,0.3,1) both;
}

header { animation: slide-down 0.45s cubic-bezier(0.16,1,0.3,1) both; }

/* Stagger children inside grids */
.grid > *:nth-child(1)  { animation-delay: 0.04s; }
.grid > *:nth-child(2)  { animation-delay: 0.09s; }
.grid > *:nth-child(3)  { animation-delay: 0.14s; }
.grid > *:nth-child(4)  { animation-delay: 0.19s; }
.grid > *:nth-child(5)  { animation-delay: 0.24s; }
.grid > *:nth-child(6)  { animation-delay: 0.29s; }

/* ── Modal open animation ───────────────────────────────── */
[id^="modal-"]:not(.hidden) > div {
    animation: scale-in 0.28s cubic-bezier(0.16,1,0.3,1) both;
}

/* ── Global transitions ─────────────────────────────────── */
*,
*::before,
*::after {
    transition-timing-function: cubic-bezier(0.16,1,0.3,1);
}

a,
button {
    transition: color 0.18s ease, background-color 0.22s ease,
                box-shadow 0.22s ease, transform 0.18s ease,
                border-color 0.18s ease, opacity 0.18s ease !important;
}

/* ── Button press micro-interaction ────────────────────── */
button:active:not(:disabled) {
    transform: scale(0.96) !important;
}

/* ── Card lift ──────────────────────────────────────────── */
.premium-card {
    transition: transform 0.35s cubic-bezier(0.16,1,0.3,1),
                box-shadow 0.35s ease,
                border-color 0.35s ease !important;
    will-change: transform;
}
.premium-card:hover {
    transform: translateY(-5px) scale(1.006) !important;
}

/* ── Image zoom on hover ────────────────────────────────── */
.group\/gallery img,
.group\/campus img {
    transition: transform 0.55s cubic-bezier(0.16,1,0.3,1) !important;
}

/* ── Spinner / loading pulse ────────────────────────────── */
@keyframes spin-slow {
    to { transform: rotate(360deg); }
}
.animate-spin-slow {
    animation: spin-slow 3s linear infinite;
}

/* ── Floating badge bounce ──────────────────────────────── */
@keyframes float-badge {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-4px); }
}
#session-security-badge {
    animation: float-badge 3.5s ease-in-out infinite;
}

/* ── Animated gradient underline for links ──────────────── */
a:not([class*="btn"]):not([class*="button"]):not(.no-underline) {
    position: relative;
}
a:not([class*="btn"]):not(.no-underline)::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0;
    width: 0; height: 1px;
    background: linear-gradient(90deg, #8b5cf6, #ec4899);
    transition: width 0.3s ease;
}
a:not([class*="btn"]):not(.no-underline):hover::after {
    width: 100%;
}

/* ── Smooth scroll behaviour ────────────────────────────── */
html {
    scroll-behavior: smooth;
}

/* ── Tab switching fade ─────────────────────────────────── */
[id$="-tab-content"],
[id^="vault-"] {
    animation: fade-in 0.3s ease both;
}

/* ── Toast slide-in ─────────────────────────────────────── */
@keyframes toast-slide-in {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}
#toast-container > div {
    animation: toast-slide-in 0.3s cubic-bezier(0.16,1,0.3,1) both !important;
    border-radius: 14px !important;
}

/* ── Skeleton shimmer (for loading states) ──────────────── */
@keyframes skeleton-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 800px 100%;
    animation: skeleton-shimmer 1.6s infinite linear;
    border-radius: 8px;
}

/* ── Cursor pointer on interactive elements ─────────────── */
button, [role="button"], label[for] {
    cursor: pointer;
}

/* ── Smooth colour theme transitions ────────────────────── */
body, header, .premium-card, section, div {
    transition: background-color 0.6s cubic-bezier(0.16,1,0.3,1),
                border-color 0.4s ease,
                color 0.3s ease !important;
}
