@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;700;900&display=swap');

* {
    -webkit-tap-highlight-color: transparent;
}

body {
    overflow-x: hidden;
}

/* Safe areas */
.safe-pb {
    padding-bottom: max(env(safe-area-inset-bottom), 12px);
}

.safe-pt {
    padding-top: env(safe-area-inset-top);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 3px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d4d4d8;
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #3f3f46;
}

/* Glass */
.glass-panel {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
}

.dark .glass-panel {
    background: rgba(24, 24, 27, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

.glass-modal {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: 0 -4px 40px rgba(0, 0, 0, 0.12);
}

.dark .glass-modal {
    background: rgba(18, 18, 20, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -4px 60px rgba(0, 0, 0, 0.6);
}

/* Card themes */
.theme-blue {
    --tc: 59, 130, 246;
}

.theme-yellow {
    --tc: 234, 179, 8;
}

.theme-pink {
    --tc: 236, 72, 153;
}

.card-item {
    position: relative;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease, border-color 0.35s ease;
    cursor: pointer;
}

.card-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(var(--tc), 0.07) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.card-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px -8px rgba(var(--tc), 0.18);
    border-color: rgba(var(--tc), 0.25);
}

.card-item:hover::before {
    opacity: 1;
}

.card-item:active {
    transform: scale(0.97);
}

.card-content {
    position: relative;
    z-index: 2;
}

/* FAB */
.fab {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom) + 20px);
    right: 20px;
    z-index: 50;
    width: 60px;
    height: 60px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.fab:active {
    transform: scale(0.92);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.dark .fab {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* Bottom sheet */
.sheet-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 60;
    border-radius: 28px 28px 0 0;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 92vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.sheet-panel.open {
    transform: translateY(0);
}

/* Sheet handle */
.sheet-handle {
    width: 40px;
    height: 4px;
    border-radius: 99px;
    background: rgba(0, 0, 0, 0.12);
    margin: 12px auto 0;
}

.dark .sheet-handle {
    background: rgba(255, 255, 255, 0.15);
}

/* Share modal */
.share-overlay-content {
    transform: scale(0.88) translateY(20px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}

.share-overlay-content.open {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Poster */
.poster-wrapper {
    position: relative;
    overflow: hidden;
    background: #fff;
}

.dark .poster-wrapper {
    background: #18181b;
}

.poster-glow {
    position: absolute;
    width: 160%;
    height: 160%;
    top: -30%;
    left: -30%;
    background: conic-gradient(from 180deg at 50% 50%, rgba(var(--tc), 0.3) 0deg, transparent 60deg, transparent 300deg, rgba(var(--tc), 0.3) 360deg);
    animation: rotateGlow 10s linear infinite;
    filter: blur(50px);
    opacity: 0.7;
}

@keyframes rotateGlow {
    to {
        transform: rotate(360deg);
    }
}

/* Animations */
.stagger-enter {
    animation: cardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Press effect */
.btn-press:active {
    transform: scale(0.93);
    transition: transform 0.1s;
}

/* Sortable */
.sortable-ghost {
    opacity: 0.25;
}

.sortable-drag {
    transform: scale(1.04) rotate(1.5deg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    z-index: 99;
}

/* Input */
input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0.5;
    cursor: pointer;
}

.dark input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.55;
}

/* Noise */
.noise-overlay {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    mix-blend-mode: multiply;
}

.dark .noise-overlay {
    opacity: 0.05;
    mix-blend-mode: overlay;
}

/* Overlay backdrop */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.modal-backdrop.open {
    opacity: 1;
    pointer-events: all;
}