/* SawargiPay Custom Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-blue: #3b82f6;
    --primary-blue-dark: #2563eb;
    --primary-blue-light: #60a5fa;
    --success-color: #10b981;
    --success-dark: #059669;
    --warning-color: #f59e0b;
    --warning-dark: #d97706;
    --error-color: #ef4444;
    --error-dark: #dc2626;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
}

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Solid Blue Backgrounds */
.gradient-bg {
    background: var(--primary-blue);
}

.success-bg {
    background: var(--success-color);
}

.warning-bg {
    background: var(--warning-color);
}

.error-bg {
    background: var(--error-color);
}

/* Card Styles */
.card-shadow {
    box-shadow: var(--card-shadow);
}

.card-shadow:hover {
    box-shadow: var(--card-shadow-hover);
}

/* Input Styles */
.input-focus {
    transition: all 0.2s ease;
}

.input-focus:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

/* Button Styles */
.btn-primary {
    background: var(--primary-blue);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: var(--primary-blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    background: var(--primary-blue-dark);
}

/* Product Card Styles */
.product-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f1f5f9;
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-blue);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.product-card:hover::before {
    transform: scaleX(1);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--primary-blue);
}

/* Status Badge Animation */
.status-badge {
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.8; 
        transform: scale(1.02);
    }
}

/* Loading Animation */
.loading-dots {
    display: inline-flex;
    align-items: center;
}

.loading-dots::after {
    content: '';
    animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Smooth Transitions */
.smooth-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modal Animations */
.modal-enter {
    animation: modalEnter 0.3s ease-out;
}

@keyframes modalEnter {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Success Animation */
.success-checkmark {
    animation: successCheckmark 0.6s ease-in-out;
}

@keyframes successCheckmark {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Floating Action Button */
.floating-action {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    animation: floatingBounce 2s infinite;
}

@keyframes floatingBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* QR Code Container */
.qr-container {
    position: relative;
}

.qr-container::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: var(--primary-blue);
    border-radius: 20px;
    opacity: 0.1;
    animation: qrGlow 2s infinite alternate;
}

@keyframes qrGlow {
    from { opacity: 0.1; }
    to { opacity: 0.2; }
}

/* Countdown Animation */
.countdown-text {
    animation: countdownPulse 1s infinite;
}

@keyframes countdownPulse {
    0%, 100% { 
        transform: scale(1);
        color: var(--warning-color);
    }
    50% { 
        transform: scale(1.05);
        color: var(--warning-dark);
    }
}

/* Responsive Improvements */
@media (max-width: 640px) {
    .card-shadow {
        box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
    }
    
    .product-card:hover {
        transform: translateY(-2px);
    }
    
    .btn-primary:hover {
        transform: translateY(-1px);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        --card-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.4);
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles for Accessibility */
.focus-visible:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Stock Badge Styles */
.stock-badge {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.stock-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s;
}

.stock-badge:hover::before {
    left: 100%;
}

.stock-high {
    animation: stockPulse 2s infinite;
}

.stock-low {
    animation: stockAlert 1.5s infinite;
}

@keyframes stockPulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.02);
        opacity: 0.9;
    }
}

@keyframes stockAlert {
    0%, 100% { 
        transform: scale(1);
    }
    25%, 75% { 
        transform: scale(1.05);
    }
    50% { 
        transform: scale(1.02);
    }
}

/* Stock Status Colors */
.stock-excellent {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border-color: #16a34a;
    color: #15803d;
}

.stock-good {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #2563eb;
    color: #1d4ed8;
}

.stock-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #d97706;
    color: #b45309;
}

.stock-critical {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #dc2626;
    color: #b91c1c;
}

.stock-empty {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-color: #6b7280;
    color: #4b5563;
}

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

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-blue-dark);
}

/* Product Detail Modal Styles */
.product-detail-modal {
    backdrop-filter: blur(8px);
}

.product-detail-content {
    animation: slideUpFadeIn 0.3s ease-out;
}

@keyframes slideUpFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Enhanced Product Cards */
.product-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f1f5f9;
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.product-card:hover::before {
    transform: scaleX(1);
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #e2e8f0;
}

/* Gradient backgrounds for better visual hierarchy */
.gradient-red {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.gradient-teal {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
}

/* Loading animation for product details */
.loading-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .5;
    }
}

/* Better spacing for mobile */
@media (max-width: 640px) {
    .product-card {
        margin-bottom: 0.75rem;
    }
    
    .product-detail-modal .max-w-md {
        max-width: calc(100vw - 2rem);
        margin: 1rem;
    }
}

/* Filter Tabs Styles */
.filter-tab {
    background: #f3f4f6;
    color: #6b7280;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.filter-tab:hover {
    background: #e5e7eb;
    color: #374151;
}

.filter-tab.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.filter-tab svg {
    transition: transform 0.2s ease;
}

.filter-tab.active svg {
    transform: scale(1.1);
}

/* Package Type Badges */
.package-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.badge-akrab {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    color: #7c3aed;
    border: 1px solid #c4b5fd;
}

.badge-circle {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #2563eb;
    border: 1px solid #93c5fd;
}

.badge-other {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #059669;
    border: 1px solid #6ee7b7;
}


/* Toast Animations */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Modal Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
