/* Custom styles for Verity Market Buyer PWA */

/* Sample 3: Elegant Pink & Purple Luxury Theme */
body {
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    min-height: 100vh;
}

/* Header Styles */
.header {
    background: #FA003F;
    box-shadow: 0 4px 20px rgba(250, 0, 63, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}

#branding-header {
    background: #FA003F !important;
    box-shadow: 0 4px 20px rgba(250, 0, 63, 0.3) !important;
    color: white !important;
}

#branding-header * {
    color: white !important;
}

/* Search Bar */
#search-header {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(250, 0, 63, 0.2);
}

#search-input {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 2px solid rgba(250, 0, 63, 0.2) !important;
    transition: all 0.3s ease;
}

#search-input:focus {
    border-color: #FA003F !important;
    box-shadow: 0 0 0 3px rgba(250, 0, 63, 0.1) !important;
}

/* Categories */
#categories-header {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(250, 0, 63, 0.2);
}

/* Hero Section */
.bg-gray-100 {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(236, 72, 153, 0.1)) !important;
    backdrop-filter: blur(10px);
}

/* Section Titles */
h2 {
    background: linear-gradient(135deg, #FA003F, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* Product Cards */
.product-card {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(250, 0, 63, 0.2) !important;
    box-shadow: 0 8px 32px rgba(250, 0, 63, 0.1) !important;
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 40px rgba(250, 0, 63, 0.2) !important;
    border-color: #FA003F !important;
}

/* Seller Cards */
.seller-card {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(250, 0, 63, 0.2) !important;
    box-shadow: 0 8px 32px rgba(250, 0, 63, 0.1) !important;
}

/* Carousel Items */
.carousel-item {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(250, 0, 63, 0.2) !important;
    box-shadow: 0 8px 32px rgba(250, 0, 63, 0.1) !important;
}

/* Category Items */
.category-item {
    background: linear-gradient(135deg, #FA003F, #8b5cf6) !important;
    color: white !important;
    border: none !important;
    transition: all 0.3s ease;
}

.category-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(250, 0, 63, 0.3);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #FA003F, #8b5cf6) !important;
    border: none !important;
    color: white !important;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(250, 0, 63, 0.3);
}

/* Bottom Navigation */
nav {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(250, 0, 63, 0.2) !important;
}

/* Loading animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Hide scrollbars but keep functionality */
.scrollbar-hide {
    -ms-overflow-style: none;  /* Internet Explorer 10+ */
    scrollbar-width: none;  /* Firefox */
}
.scrollbar-hide::-webkit-scrollbar { 
    display: none;  /* Safari and Chrome */
}

/* Header scroll behavior */
.header-scrolled {
    transform: translateY(-100%);
}

/* Compact header behavior - when brand row is hidden */
.header-compact {
    top: 0 !important;
}

#search-header.header-compact {
    top: 0 !important;
}

#categories-header.header-compact {
    top: 64px !important; /* Height of search header */
}

/* Product card styles */
.product-card {
    min-width: 120px;
    max-width: 150px;
    flex-shrink: 0;
}

.seller-card {
    min-width: 250px;
    flex-shrink: 0;
}

.carousel-item {
    min-width: 300px;
    flex-shrink: 0;
}

/* Grid item sizing */
.trending-grid .product-card,
.recent-grid .product-card {
    min-width: 100px;
    max-width: 120px;
    width: 100%;
    height: auto;
}

/* Featured products - larger */
#featured-products .product-card {
    min-width: 180px;
    max-width: 200px;
    width: 100%;
    height: auto;
}

/* Force grid items to be small */
.trending-grid,
.recent-grid {
    display: grid !important;
}

.trending-grid > *,
.recent-grid > * {
    width: 100% !important;
    max-width: 120px !important;
}

/* Responsive grid adjustments */
@media (max-width: 640px) {
    .trending-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .recent-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .trending-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    .recent-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1025px) {
    .trending-grid {
        grid-template-columns: repeat(8, 1fr);
    }
    .recent-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Product card hover effects */
.product-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Button hover effects */
.btn-primary {
    background: linear-gradient(135deg, #3B82F6, #8B5CF6);
    transition: all 0.2s ease-in-out;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563EB, #7C3AED);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Category card styles */
.category-card {
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.category-card:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Search input focus */
#search-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Cart badge animation */
.cart-badge {
    animation: pulse 2s infinite;
}

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

/* Responsive grid adjustments */
@media (max-width: 640px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1025px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Error message styles */
.error-message {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #DC2626;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

/* Success message styles */
.success-message {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    color: #16A34A;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* PWA specific styles */
@media (display-mode: standalone) {
    body {
        -webkit-user-select: none;
        -webkit-touch-callout: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .dark-mode {
        background-color: #1a1a1a;
        color: #ffffff;
    }
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for keyboard navigation */
button:focus,
input:focus,
a:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .product-card {
        border: 2px solid #000;
    }
    
    .btn-primary {
        border: 2px solid #000;
    }
}
