/**
 * ikimon.life — Core Stylesheet v2
 * Unified with tokens.css v2 · No !important hacks
 * 2026-02-10
 */

/* ── Base ── */
body {
    font-family: var(--font-body);
    background-color: var(--color-bg-base);
    color: var(--color-text);
    overflow-x: hidden;
    letter-spacing: 0.02em;
    line-height: 1.7;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
}

/* ── Glassmorphism ── */
.glass-nav {
    background: var(--glass-surface);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--glass-border);
}

.glass-card {
    background: var(--glass-surface);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    transition: all var(--duration-normal) var(--ease-default);
}

.glass-card:hover {
    background: var(--glass-surface-heavy);
    border-color: var(--color-primary-glow);
    box-shadow: var(--shadow-md);
}

.glass-panel {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
}

/* ── Buttons ── */
.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: var(--text-sm);
    border: none;
    box-shadow: var(--shadow-primary);
    transition: all var(--duration-normal) var(--ease-default);
    cursor: pointer;
    min-height: var(--touch-min);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-fab);
    filter: brightness(1.05);
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-secondary {
    background: transparent;
    color: var(--color-text);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: var(--text-sm);
    border: 1px solid var(--color-border-strong);
    transition: all var(--duration-normal) var(--ease-default);
    cursor: pointer;
    min-height: var(--touch-min);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: var(--color-primary);
    color: var(--color-primary-dark);
}

.btn-glow {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    border: none;
    box-shadow: var(--shadow-primary);
    transition: all var(--duration-normal) var(--ease-default);
}

.btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-fab);
    filter: brightness(1.05);
}

/* Camera / FAB Button */
.camera-btn,
.fab-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    box-shadow: var(--shadow-fab);
    width: var(--touch-fab);
    height: var(--touch-fab);
    border-radius: var(--radius-full);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform var(--duration-fast) var(--ease-default);
}

.camera-btn:active,
.fab-primary:active {
    transform: scale(0.92);
}

/* ── Badges / Pills ── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 700;
    line-height: 1;
    gap: var(--space-1);
}

.badge-green {
    background: var(--color-primary-surface);
    color: var(--color-primary-dark);
    border: 1px solid var(--color-primary-glow);
}

.badge-yellow {
    background: var(--color-accent-surface);
    color: var(--color-accent);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-blue {
    background: var(--color-secondary-surface);
    color: var(--color-secondary);
    border: 1px solid rgba(14, 165, 233, 0.2);
}

.badge-gray {
    background: rgba(100, 116, 139, 0.08);
    color: var(--color-text-muted);
    border: 1px solid rgba(100, 116, 139, 0.15);
}

/* Photo overlay pill (species name on image) */
.badge-overlay {
    background: var(--overlay-dark);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--overlay-border);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
}

/* ── Filter Pill Tabs ── */
.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 600;
    white-space: nowrap;
    transition: all var(--duration-fast) var(--ease-default);
    min-height: var(--touch-min);
    cursor: pointer;
    border: none;
    background: none;
}

.filter-pill--active {
    background: var(--color-primary);
    color: white;
    box-shadow: var(--shadow-primary);
}

.filter-pill--inactive {
    background: var(--color-bg-surface);
    color: var(--color-text-muted);
}

.filter-pill--inactive:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--color-text-secondary);
}

/* ── Feed Card ── */
.feed-card {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--duration-normal) var(--ease-default);
}

.feed-card:hover {
    box-shadow: var(--shadow-md);
}

/* Feed card entrance animation */
.feed-card--animated {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--duration-slow) var(--ease-default),
        transform var(--duration-slow) var(--ease-bounce);
}

.feed-card--animated.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Animations ── */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fade-in-up var(--duration-slow) var(--ease-bounce) forwards;
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s var(--ease-bounce);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

@keyframes pulse-blue {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(14, 165, 233, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(14, 165, 233, 0);
    }
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ── Utilities ── */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-gradient {
    background: radial-gradient(circle at 50% 50%, var(--color-primary-surface) 0%, transparent 70%);
}

.shimmer-placeholder {
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 50%, #f0f0f0 100%);
    background-size: 200% 200%;
    animation: shimmer 1.5s ease-in-out infinite;
}

/* Hidden scrollbar */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ── Map Marker ── */
.user-location-marker {
    width: 20px;
    height: 20px;
    background-color: var(--color-secondary);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.7);
    animation: pulse-blue 2s infinite;
}

/* ── App Shell ── */
.app-body {
    padding-top: var(--nav-height);
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom));
    min-height: 100dvh;
}

/* ── Bottom Nav ── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    touch-action: manipulation;
    background: var(--glass-surface-heavy);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--color-border);
    padding: var(--space-2) var(--space-2) calc(var(--space-3) + var(--safe-bottom));
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: var(--touch-min);
    min-height: 56px;
    padding: 4px 2px;
    color: var(--color-text-faint);
    font-size: var(--text-xs);
    font-weight: 500;
    gap: 2px;
    white-space: nowrap;
    transition: color var(--duration-fast) var(--ease-default);
    background: none;
    border: none;
    cursor: pointer;
}

.bottom-nav__item--active {
    color: var(--color-primary);
    font-weight: 700;
}

.bottom-nav__center {
    position: relative;
    top: -12px;
}

.bottom-nav__center-btn {
    width: var(--touch-fab);
    height: var(--touch-fab);
    background: var(--color-primary);
    border-radius: var(--radius-full);
    border: 4px solid white;
    box-shadow: var(--shadow-md);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform var(--duration-fast) var(--ease-default);
}

.bottom-nav__center-btn:active {
    transform: scale(0.92);
}

/* ── Prose / Article Content ── */
.prose-ikimon {
    --tw-prose-body: var(--color-text-secondary);
    --tw-prose-headings: var(--color-text);
    --tw-prose-links: var(--color-primary-dark);
    --tw-prose-bold: var(--color-text);
    --tw-prose-quotes: var(--color-text);
    --tw-prose-quote-borders: var(--color-primary);
    color: var(--color-text-secondary);
    line-height: 1.8;
}

.prose-ikimon h1,
.prose-ikimon h2,
.prose-ikimon h3,
.prose-ikimon h4 {
    color: var(--color-text);
}

.prose-ikimon blockquote {
    border-left-color: var(--color-primary);
    color: var(--color-text-secondary);
}

.prose-ikimon a {
    color: var(--color-primary-dark);
}

/* ── Responsive: Desktop 3-column ── */
@media (min-width: 1024px) {
    .desktop-layout {
        display: grid;
        grid-template-columns: 240px 1fr 280px;
        max-width: var(--content-max-width);
        margin: 0 auto;
        gap: var(--space-6);
    }

    .desktop-sidebar {
        position: sticky;
        top: var(--nav-height);
        height: calc(100vh - var(--nav-height));
        overflow-y: auto;
    }

    .desktop-feed {
        max-width: var(--feed-max-width);
    }
}