/* 
 * PAVARA Stock-Service Stylesheet
 * ดีไซน์ทันสมัย คลีน สไตล์แอปพลิเคชันยุคใหม่ (LINE MAN feel)
 */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #059669;
    --primary-hover: #047857;
    --accent: #2563eb;
    --bg-main: #f8fafc;
}

body {
    font-family: 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: #1e293b;
    -webkit-tap-highlight-color: transparent;
}

/* Skeleton Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

/* Camera Scanner Viewfinder */
#scanner-container video {
    border-radius: 1rem;
    object-fit: cover;
    width: 100% !important;
}

.scanner-laser {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #ef4444;
    box-shadow: 0 0 12px #ef4444;
    animation: scanAnim 2s infinite ease-in-out;
}

@keyframes scanAnim {
    0% { top: 15%; opacity: 0.3; }
    50% { top: 85%; opacity: 1; }
    100% { top: 15%; opacity: 0.3; }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Hide scrollbar for clean app pill carousel */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Safe area for modern smartphone home indicators */
.safe-area-bottom {
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom, 1.25rem));
}

/* App-style tap state */
.tap-bounce {
    transition: transform 0.15s ease;
}
.tap-bounce:active {
    transform: scale(0.96);
}

/* Responsive Viewport Fit for All Modals */
.modal-responsive-card {
    max-height: calc(100dvh - 2rem);
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-top: auto;
    margin-bottom: auto;
}

@media (max-height: 700px) {
    .modal-responsive-card {
        max-height: calc(100dvh - 1.25rem);
        max-height: calc(100vh - 1.25rem);
        border-radius: 1.25rem !important;
    }
}

/* Sidebar & Drawer Animations */
@keyframes slideRight {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.animate-slide-right {
    animation: slideRight 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-fade-in {
    animation: fadeIn 0.2s ease-out forwards;
}

/* Print Styles for Sticker Labels */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    
    .no-print {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }

    .printable-sheet {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8mm !important;
        padding: 5mm !important;
        page-break-after: always;
    }

    .sticker-card {
        border: 1px dashed #64748b !important;
        padding: 6mm !important;
        page-break-inside: avoid;
        text-align: center;
        background: white !important;
        box-shadow: none !important;
    }
}

.print-only {
    display: none;
}
