/* --- Base / Global Styles --- */

body {
    -webkit-tap-highlight-color: transparent;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overscroll-behavior: none;
    background-color: #f9fafb;
}

video {
    object-fit: cover;
}

/* Scanner styles */
#reader video {
    object-fit: cover;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
}

/* Wood Textures */
.bg-wood {
    background-color: #5D4037;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h40v40H0V0zm20 20h20v20H20V20zM0 20h20v20H0V20z' fill='%236d4c41' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
}

.wood-texture {
    background-color: #8B4513;
    background-image: linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
    border-top: 4px solid #5D4037;
}

.wood-shelf {
    background: #5D4037;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid #3E2723;
}

/* UI Components */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scroll-bar {
    height: 24px;
    background: #5D4037;
    background-image: linear-gradient(90deg, #3E2723 0%, #8D6E63 50%, #3E2723 100%);
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 20;
}

.scroll-bar::before,
.scroll-bar::after {
    content: '';
    position: absolute;
    top: -4px;
    width: 12px;
    height: 32px;
    background: #3E2723;
    border-radius: 2px;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
}

.scroll-bar::before {
    left: -6px;
}

.scroll-bar::after {
    right: -6px;
}

/* 3D Viewer Helpers */
.transform-style-3d {
    transform-style: preserve-3d;
}

.translate-z-24 {
    transform: translateZ(6rem);
}

.-translate-z-24 {
    transform: translateZ(-6rem);
}

/* Patterns and Certificate */
.pattern-diamond {
    background-image: linear-gradient(45deg, #00000010 25%, transparent 25%, transparent 75%, #00000010 75%, #00000010),
        linear-gradient(45deg, #00000010 25%, transparent 25%, transparent 75%, #00000010 75%, #00000010);
    background-position: 0 0, 10px 10px;
    background-size: 20px 20px;
}

.pattern-rice {
    background-color: #FFF8E1;
    background-image: radial-gradient(#D7CCC8 1px, transparent 1px);
    background-size: 10px 10px;
}

.certificate-bg {
    background-color: #fdf6e3;
    background-image:
        linear-gradient(90deg, transparent 95%, #e0d4b9 95%),
        linear-gradient(transparent 95%, #e0d4b9 95%);
    background-size: 20px 20px;
    border: 8px solid #8B4513;
    outline: 2px solid #D2B48C;
    outline-offset: -12px;
}

.scan-line {
    width: 100%;
    height: 2px;
    background: #ef4444;
    position: absolute;
    top: 0;
    left: 0;
    animation: scan 2s linear infinite;
    box-shadow: 0 0 4px #ef4444;
}

@keyframes scan {
    0% {
        top: 0%;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

/* Utility Classes */
.btn-bounce {
    transition-property: transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

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

.btn-bounce:hover {
    filter: brightness(1.1);
}