/* Custom styles for animations, scrollbar, and glassmorphism */

.slide-item {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-item.removing {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
}

.slide-item.excluded {
    opacity: 0.4;
    filter: grayscale(100%);
    transform: scale(0.95);
    border-color: rgba(239, 68, 68, 0.4) !important;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent; 
}
::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.5); 
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(107, 114, 128, 0.8); 
}

/* Glass Sliders */
input[type=range] {
    -webkit-appearance: none;
    background: transparent;
    width: 100%;
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}
input[type=range]::-webkit-slider-thumb {
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    border: 1px solid rgba(0,0,0,0.05);
    transition: transform 0.1s;
}
input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

input[type=number] {
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.6);
}

/* Logo Animation */
.logo-loading {
    animation: logo-pulse 1.5s infinite alternate ease-in-out;
}

@keyframes logo-pulse {
    0% { transform: scale(1) translateY(0); filter: drop-shadow(0 0 5px rgba(79, 70, 229, 0.2)); }
    100% { transform: scale(1.1) translateY(-2px); filter: drop-shadow(0 0 20px rgba(236, 72, 153, 0.7)); }
}

/* AI Mesh Gradient Waves */
.ai-waves {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 35vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    filter: blur(60px);
    opacity: 0.8;
}

.ai-wave-orb {
    position: absolute;
    bottom: -15vh;
    border-radius: 50%;
    mix-blend-mode: screen;
    animation: orb-float 15s infinite ease-in-out alternate;
}

.ai-orb-1 {
    width: 60vw;
    height: 40vh;
    left: -10vw;
    background: radial-gradient(circle, rgba(99,102,241,0.6) 0%, rgba(99,102,241,0) 70%);
    animation-delay: 0s;
}

.ai-orb-2 {
    width: 70vw;
    height: 45vh;
    left: 15vw;
    background: radial-gradient(circle, rgba(56,189,248,0.5) 0%, rgba(56,189,248,0) 70%);
    animation-delay: -5s;
    animation-duration: 20s;
}

.ai-orb-3 {
    width: 65vw;
    height: 42vh;
    right: -10vw;
    background: radial-gradient(circle, rgba(148,163,184,0.6) 0%, rgba(148,163,184,0) 70%);
    animation-delay: -10s;
    animation-duration: 18s;
}

@keyframes orb-float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(5vw, -5vh) scale(1.1); }
    100% { transform: translate(-5vw, 2vh) scale(0.9); }
}

/* Blob Animation */
@keyframes blob {
    0% { transform: translate(0px, 0px) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0px, 0px) scale(1); }
}

.animate-blob { animation: blob 7s infinite; }
.animation-delay-2000 { animation-delay: 2s; }
.animation-delay-4000 { animation-delay: 4s; }

/* Printer Animations */
@keyframes printOut {
    0% { transform: translateY(-40px); }
    50% { transform: translateY(0px); }
    80% { transform: translateY(0px); }
    100% { transform: translateY(-40px); }
}
@keyframes feedIn {
    0% { transform: translateY(0px); }
    50% { transform: translateY(20px); }
    80% { transform: translateY(20px); }
    100% { transform: translateY(0px); }
}
.animate-print-out {
    animation: printOut 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.animate-feed-in {
    animation: feedIn 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Mobile Bottom Sheet Smooth Transitions */
@media (max-width: 767px) {
    #settings-panel {
        position: fixed !important;
        inset-inline: 0 !important;
        bottom: 0 !important;
        z-index: 60 !important;
        max-height: 88vh !important;
        transform: translateY(100%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
        will-change: transform, opacity;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    #settings-panel.sheet-open {
        transform: translateY(0) !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    #settings-backdrop {
        position: fixed !important;
        inset: 0 !important;
        z-index: 55 !important;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    #settings-backdrop.backdrop-open {
        opacity: 1 !important;
        pointer-events: auto !important;
    }
}

.dock-safe-bottom {
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
}

/* On touchscreens, always show slide action buttons (Edit, View, Tag) */
@media (hover: none) or (pointer: coarse) {
    .slide-actions {
        opacity: 1 !important;
        transform: translateY(0) !important;
        pointer-events: auto !important;
    }
    .touch-visible {
        opacity: 1 !important;
    }
}

/* Ensure canvas doesn't trigger scroll gestures during drawing */
#draw-canvas {
    touch-action: none;
}

/* Premium Cancel & Abort Button Styles */
.btn-cancel-abort {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.55rem 1.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 9999px;
    cursor: pointer;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    user-select: none;
}

.btn-cancel-abort:hover {
    transform: translateY(-1.5px);
}

.btn-cancel-abort:active {
    transform: scale(0.95);
}

.btn-cancel-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.25rem;
    font-size: 0.8125rem;
    font-weight: 700;
    border-radius: 9999px;
    cursor: pointer;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.btn-cancel-secondary:hover {
    transform: translateY(-1px);
}

.btn-cancel-secondary:active {
    transform: scale(0.95);
}

