/* Custom pixel art styling */
.pixelated {
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Stamp postage border effect */
.stamp-border {
    position: relative;
    border: 3px solid #ffffff;
    border-radius: 4px;
}

.stamp-border::before {
    content: '';
    position: absolute;
    inset: -6px;
    background: radial-gradient(circle at 6px 6px, transparent 3px, #ffffff 3px, #ffffff 6px, transparent 6px);
    background-size: 12px 12px;
    border-radius: 8px;
    z-index: -1;
}

/* Custom animations */
@keyframes stampDrop {
    0% {
        transform: translateY(-100px) rotate(0deg) scale(0.8);
        opacity: 0;
    }
    70% {
        transform: translateY(10px) rotate(var(--rotation, 0deg)) scale(1.1);
        opacity: 1;
    }
    100% {
        transform: translateY(0) rotate(var(--rotation, 0deg)) scale(1);
        opacity: 1;
    }
}

@keyframes stampGlow {
    0%, 100% {
        box-shadow: 0 0 0 rgba(16, 185, 129, 0);
    }
    50% {
        box-shadow: 0 0 30px rgba(16, 185, 129, 0.6);
    }
}

@keyframes focusZoom {
    0% {
        transform: rotate(var(--rotation, 0deg)) scale(1);
    }
    100% {
        transform: translate(-50%, -50%) rotate(0deg) scale(2.5);
    }
}

@keyframes unfocusZoom {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) scale(2.5);
    }
    100% {
        transform: rotate(var(--rotation, 0deg)) scale(1);
    }
}

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

/* Prevent text selection while dragging */
.stamp-border {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Focus ring for accessibility */
button:focus,
select:focus {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stamp-border {
        transform: scale(0.8);
    }
    
    .stamp-border.focused {
        transform: scale(2) !important;
    }
}

/* Loading shimmer effect */
@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.loading-shimmer {
    background: linear-gradient(90deg, #374151 0px, #4b5563 50px, #374151 100px);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}