/* Custom styles for CardVault */

/* Prevent horizontal scroll / sideways jitter on entire document */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    touch-action: pan-y;
}

/* Hide scrollbars utility */
.scrollbar-none::-webkit-scrollbar {
    display: none;
}
.scrollbar-none {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Binder Page Styles */
.binder-album {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5), inset 0 1px 2px 0 rgba(255, 255, 255, 0.05);
    border: 2px solid #334155;
    border-radius: 1.25rem;
    position: relative;
    padding: 1.25rem;
    min-height: auto;
    width: 100%;
}

@media (max-width: 640px) {
    .binder-album {
        padding: 0.75rem;
        border-radius: 1rem;
        border-width: 1.5px;
    }
}

/* Realistic Binder Rings on the left margin */
.binder-spine {
    position: absolute;
    left: 8px;
    top: 5%;
    bottom: 5%;
    width: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    pointer-events: none;
    z-index: 10;
}

.binder-ring {
    width: 16px;
    height: 34px;
    background: linear-gradient(90deg, #94a3b8, #cbd5e1, #475569);
    border-radius: 8px;
    box-shadow: inset 1px 1px 2px rgba(255,255,255,0.7), 2px 4px 6px rgba(0,0,0,0.6);
    border: 1px solid #334155;
}

/* 9-Card 3x3 Pocket Grid */
.binder-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    padding-left: 20px;
    width: 100%;
}

/* Tablet: 3 columns or 2 columns */
@media (max-width: 840px) {
    .binder-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.75rem;
        padding-left: 0;
    }
    .binder-spine {
        display: none;
    }
}

/* Mobile: 2 columns with proportional pocket aspect ratio */
@media (max-width: 600px) {
    .binder-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.625rem;
        padding-left: 0;
    }
    .binder-spine {
        display: none;
    }
}

/* Pocket Sleeve styling */
.card-pocket {
    aspect-ratio: 2.5 / 3.5;
    background: rgba(15, 23, 42, 0.75);
    border: 1.5px dashed rgba(148, 163, 184, 0.25);
    border-radius: 0.75rem;
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    width: 100%;
}

.card-pocket:hover {
    border-color: rgba(59, 130, 246, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.6);
}

/* Pocket plastic sleeve reflection */
.card-pocket::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 55%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.0) 60%);
    pointer-events: none;
    border-radius: inherit;
}

/* Card Foil / Holographic Sheen */
.holo-sheen {
    position: relative;
    overflow: hidden;
}

.holo-sheen::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        115deg,
        transparent 35%,
        rgba(255, 255, 255, 0.15) 45%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0.15) 55%,
        transparent 65%
    );
    transform: rotate(25deg);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.card-pocket:hover .holo-sheen::before {
    opacity: 1;
    animation: holo-pass 1.5s ease-in-out infinite alternate;
}

@keyframes holo-pass {
    0% { transform: translate(-30%, -30%) rotate(25deg); }
    100% { transform: translate(30%, 30%) rotate(25deg); }
}

/* Scanner Laser animation */
@keyframes scan-laser {
    0% { top: 5%; opacity: 0.8; }
    50% { top: 90%; opacity: 1; }
    100% { top: 5%; opacity: 0.8; }
}

.scanning-laser {
    position: absolute;
    left: 10%;
    right: 10%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #3b82f6, #60a5fa, #3b82f6, transparent);
    box-shadow: 0 0 15px #3b82f6, 0 0 25px #60a5fa;
    animation: scan-laser 2.2s ease-in-out infinite;
    z-index: 20;
}

/* Flip Card 3D Effect in Modal */
.flip-card-container {
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.flip-card-container.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 1rem;
    overflow: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* Category Badge Colors */
.badge-baseball { background-color: #1e3a8a; color: #93c5fd; }
.badge-pokemon { background-color: #854d0e; color: #fef08a; }
.badge-wrestling { background-color: #991b1b; color: #fca5a5; }
.badge-football { background-color: #14532d; color: #86efac; }
.badge-soccer { background-color: #0f766e; color: #99f6e4; }
.badge-basketball { background-color: #c2410c; color: #fdba74; }
.badge-other { background-color: #374151; color: #d1d5db; }

/* Custom scrollbars for desktop */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #0f172a;
}
::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #475569;
}
