/* FlickTask — Animations & UI */

/* ---- Keyframes ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-24px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.3); }
    50%      { box-shadow: 0 0 24px 4px rgba(99, 102, 241, 0.15); }
}
@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}
@keyframes slideUnderline {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}
@keyframes countPop {
    0%   { transform: scale(0.8); opacity: 0; }
    60%  { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

/* ---- Animation utilities ---- */
.animate-fade-in      { animation: fadeInUp 0.55s ease-out forwards; }
.animate-fade-in-down { animation: fadeInDown 0.5s ease-out forwards; }
.animate-fade-in-left { animation: fadeInLeft 0.5s ease-out forwards; }
.animate-fade-in-right{ animation: fadeInRight 0.5s ease-out forwards; }
.animate-scale-in     { animation: scaleIn 0.45s ease-out forwards; }
.animate-float        { animation: float 5s ease-in-out infinite; }
.animate-pulse-glow   { animation: pulseGlow 3s ease-in-out infinite; }
.animate-count-pop    { animation: countPop 0.6s ease-out forwards; }

.animate-delay-1 { animation-delay: 0.08s; opacity: 0; }
.animate-delay-2 { animation-delay: 0.16s; opacity: 0; }
.animate-delay-3 { animation-delay: 0.24s; opacity: 0; }
.animate-delay-4 { animation-delay: 0.32s; opacity: 0; }
.animate-delay-5 { animation-delay: 0.40s; opacity: 0; }
.animate-delay-6 { animation-delay: 0.48s; opacity: 0; }

.page-enter { animation: fadeInUp 0.4s ease-out; }
.sidebar-enter { animation: fadeInLeft 0.35s ease-out; }

/* ---- Logo (wide horizontal badge — size by WIDTH, full panel width in sidebars) ---- */
.site-logo {
    object-fit: contain;
    display: block;
    image-rendering: auto;
    max-width: 100%;
    height: auto;
}

.logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}
.logo-wrap--panel { width: 100%; }
.logo-wrap--nav   { justify-content: flex-start; }
.logo-wrap--footer { justify-content: flex-start; }
.logo-wrap--auth  { justify-content: center; }
.logo-wrap--hero  { justify-content: center; }

.logo-link {
    transition: transform 0.25s ease, opacity 0.25s ease;
    text-decoration: none;
}
.logo-link:hover { transform: scale(1.02); opacity: 0.95; }
.logo-link--sidebar,
.logo-link--admin-sidebar {
    display: block;
    width: 100%;
}

/* Sidebar / admin panel brand block */
.sidebar-brand {
    padding: 1.25rem 1.25rem 1rem;
    text-align: center;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.04) 0%, transparent 100%);
}
.dark .sidebar-brand {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.08) 0%, transparent 100%);
}
.sidebar-brand--dark {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.12) 0%, transparent 100%);
}
.sidebar-brand-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: #6b7280;
}
.sidebar-brand-meta--dark { color: #9ca3af; }

.site-logo--nav {
    width: 10rem;
    height: auto;
}
@media (min-width: 768px) {
    .site-logo--nav { width: 11.5rem; }
}
@media (min-width: 1024px) {
    .site-logo--nav { width: 12.5rem; }
}

.site-logo--sidebar,
.site-logo--admin {
    width: 100%;
    height: auto;
}

.site-logo--footer {
    width: 11rem;
    height: auto;
}

.site-logo--hero {
    width: 100%;
    max-width: 28rem;
    height: auto;
}

.site-logo--auth {
    width: 14rem;
    height: auto;
}

.site-logo--header {
    width: 8rem;
    height: auto;
}

/* ---- Glass & cards ---- */
.glass {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.dark .glass {
    background: rgba(17, 24, 39, 0.75);
}

.card-hover {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}
.card-hover:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 24px 48px -12px rgba(99, 102, 241, 0.2);
}

.stat-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}
.stat-card:hover { transform: translateY(-4px); }
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #9333ea, #6366f1);
    background-size: 200% auto;
    animation: shimmer 3s linear infinite;
}

.hero-grid {
    background-image:
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.12), transparent 40%),
        radial-gradient(circle at 80% 0%, rgba(147, 51, 234, 0.1), transparent 35%);
}

/* ---- Buttons ---- */
.btn-primary {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(99, 102, 241, 0.4);
}
.btn-primary:active { transform: translateY(0) scale(0.98); }

/* ---- Nav links ---- */
.nav-link {
    position: relative;
    transition: color 0.2s ease, background-color 0.2s ease, padding-left 0.2s ease;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    width: 0; height: 2px;
    background: linear-gradient(90deg, #6366f1, #9333ea);
    transition: width 0.3s ease, left 0.3s ease;
    border-radius: 1px;
}
.nav-link:hover::after { width: 80%; left: 10%; }

.sidebar-link {
    transition: all 0.25s ease;
    border-left: 3px solid transparent;
}
.sidebar-link:hover {
    padding-left: 1.25rem;
    background: rgba(99, 102, 241, 0.08);
    border-left-color: #6366f1;
}
.dark .sidebar-link:hover {
    background: rgba(99, 102, 241, 0.15);
}
.sidebar-link.active {
    background: rgba(99, 102, 241, 0.12);
    border-left-color: #6366f1;
    color: #6366f1;
    font-weight: 600;
}

.sidebar-pending-count {
    margin-left: auto;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.375rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
}
.sidebar-pending-count--orange {
    background: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.25);
}
.sidebar-pending-count--red {
    background: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
}

.admin-sidebar-link {
    transition: all 0.25s ease;
    border-left: 3px solid transparent;
}
.admin-sidebar-link:hover {
    padding-left: 1rem;
    background: rgba(255, 255, 255, 0.06);
    border-left-color: #818cf8;
}

/* ---- Alerts ---- */
.alert-enter { animation: fadeInDown 0.35s ease-out; }

/* ---- Prose ---- */
.prose-page h2 { font-size: 1.25rem; font-weight: 700; margin-top: 2rem; margin-bottom: 0.75rem; }
.prose-page h3 { font-size: 1.1rem; font-weight: 600; margin-top: 1.5rem; margin-bottom: 0.5rem; }
.prose-page p, .prose-page li { color: #6b7280; line-height: 1.75; margin-bottom: 0.75rem; }
.dark .prose-page p, .dark .prose-page li { color: #9ca3af; }
.prose-page ul { list-style: disc; padding-left: 1.25rem; margin-bottom: 1rem; }

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

[x-cloak] { display: none !important; }

/* ---- Image viewer & proof thumbnails ---- */
.image-viewer {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(4px);
}

.image-viewer__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    color: #fff;
    flex-shrink: 0;
}

.image-viewer__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.85);
}

.image-viewer__actions {
    display: flex;
    gap: 0.5rem;
}

.image-viewer__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transition: background 0.2s;
}
.image-viewer__btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.image-viewer__stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 0 3.5rem;
}

.image-viewer__img {
    max-width: 100%;
    max-height: calc(100vh - 9rem);
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.image-viewer__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    transition: background 0.2s;
    z-index: 2;
}
.image-viewer__nav:hover {
    background: rgba(255, 255, 255, 0.22);
}
.image-viewer__nav--prev { left: 0.75rem; }
.image-viewer__nav--next { right: 0.75rem; }

.image-viewer__thumbs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0.75rem 1rem 1rem;
    flex-shrink: 0;
    max-width: 100%;
    overflow-x: auto;
}

.image-viewer__thumb {
    flex-shrink: 0;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 2px solid transparent;
    opacity: 0.65;
    transition: opacity 0.2s, border-color 0.2s;
}
.image-viewer__thumb:hover,
.image-viewer__thumb--active {
    opacity: 1;
    border-color: #6366f1;
}

.image-viewer__thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.proof-thumb {
    position: relative;
    width: 6rem;
    height: 6rem;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    background: #f3f4f6;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.dark .proof-thumb {
    border-color: #374151;
    background: #111827;
}
.proof-thumb:hover {
    border-color: #6366f1;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.25);
}
.proof-thumb--inline {
    width: 5rem;
    height: 5rem;
}

.proof-thumb__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.proof-thumb__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s;
}
.proof-thumb:hover .proof-thumb__overlay {
    opacity: 1;
}

.proof-thumb__badge {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.25rem;
    border-radius: 9999px;
    background: #6366f1;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
