/* 
 * Store K Custom UI/UX Enhancements
 * Blueprint: "Complex in the backend, magical in the frontend"
 */

/* ============================================
   1. MARKETPLACE DISCOVERY ENGINE (/shop)
   ============================================ */

/* Hero Section - Search First Design */
.marketplace-hero {
    background: linear-gradient(135deg, #FFF9F0 0%, #FFFFFF 50%, #FFFBEB 100%);
    position: relative;
    overflow: hidden;
}

.marketplace-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 155, 0, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

/* Giant Search Bar with Quick Tags */
.search-giant-wrapper {
    max-width: 768px;
    margin: 0 auto;
}

.search-giant-input {
    font-size: 1.125rem;
    padding: 1.25rem 1.5rem;
    border-radius: 24px;
    border: 2px solid #E5E7EB;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.search-giant-input:focus {
    border-color: #FF9B00;
    box-shadow: 0 6px 30px rgba(255, 155, 0, 0.15);
    transform: translateY(-2px);
}

.quick-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.quick-tag {
    background: rgba(255, 155, 0, 0.1);
    color: #FF9B00;
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.quick-tag:hover {
    background: #FF9B00;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 155, 0, 0.2);
}

/* Masonry/Pinterest-Style Grid */
.masonry-grid {
    column-count: 2;
    column-gap: 0.75rem;
}

@media (min-width: 640px) {
    .masonry-grid {
        column-count: 3;
        column-gap: 1rem;
    }
}

@media (min-width: 768px) {
    .masonry-grid {
        column-count: 4;
        column-gap: 1.25rem;
    }
}

@media (min-width: 1024px) {
    .masonry-grid {
        column-count: 5;
        column-gap: 1.5rem;
    }
}

@media (min-width: 1280px) {
    .masonry-grid {
        column-count: 6;
        column-gap: 1.5rem;
    }
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 0.75rem;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #F3F4F6;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.masonry-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    border-color: #FFE100;
}

.masonry-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* Curated Collections Cards */
.curated-collection {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
    cursor: pointer;
}

.curated-collection::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
}

.curated-collection-content {
    position: relative;
    z-index: 10;
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: white;
}

.curated-collection-badge {
    display: inline-block;
    background: #FF9B00;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    width: fit-content;
}

/* Smart Filter Pills */
.filter-pills-container {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.filter-pills-container::-webkit-scrollbar {
    display: none;
}

.filter-pill {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid #E5E7EB;
    background: white;
    color: #6B7280;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.filter-pill:hover {
    border-color: #FF9B00;
    color: #FF9B00;
    background: rgba(255, 155, 0, 0.05);
}

.filter-pill.active {
    background: #FF9B00;
    border-color: #FF9B00;
    color: white;
    box-shadow: 0 4px 12px rgba(255, 155, 0, 0.25);
}

/* ============================================
   2. PERSONAL STORE / BRAND BUILDER
   ============================================ */

/* Store Header with Banner & Logo */
.store-header-banner {
    height: 160px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #FF9B00 0%, #FFE100 100%);
}

.store-header-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.store-logo-wrapper {
    width: 80px;
    height: 80px;
    background: white;
    border: 4px solid white;
    border-radius: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    position: absolute;
    bottom: -40px;
    left: 1.25rem;
    z-index: 20;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.store-logo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Trust Badges */
.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: rgba(34, 197, 94, 0.1);
    color: #22C55E;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 800;
    text-transform: uppercase;
}

.trust-badge.fast-response {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
}

.trust-badge.verified {
    background: rgba(168, 85, 247, 0.1);
    color: #A855F7;
}

/* Category Tabs (Instagram-style) */
.category-tabs-container {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scrollbar-width: none;
}

.category-tab {
    flex-shrink: 0;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    background: #F9FAFB;
    color: #6B7280;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.category-tab:hover {
    background: #FEF3C7;
    color: #FF9B00;
}

.category-tab.active {
    background: #FF9B00;
    color: white;
    box-shadow: 0 4px 12px rgba(255, 155, 0, 0.25);
}

/* Sticky Add to Cart (Mobile) */
.sticky-add-to-cart {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 1rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 100;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.sticky-add-to-cart-btn {
    flex: 1;
    background: #FF9B00;
    color: white;
    font-weight: 800;
    padding: 0.875rem 1.5rem;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.sticky-add-to-cart-btn:hover {
    background: #FFE100;
    color: #1F1F1F;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 155, 0, 0.3);
}

/* WhatsApp Checkout Button */
.wa-checkout-btn {
    background: #25D366;
    color: white;
    font-weight: 700;
    padding: 0.75rem 1.25rem;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.wa-checkout-btn:hover {
    background: #128C7E;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.3);
}

/* Share Store Button */
.share-store-btn {
    background: white;
    border: 2px solid #E5E7EB;
    color: #6B7280;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    font-size: 0.75rem;
}

.share-store-btn:hover {
    border-color: #FF9B00;
    color: #FF9B00;
    background: rgba(255, 155, 0, 0.05);
}

/* ============================================
   3. SELLER DASHBOARD - MOBILE FIRST
   ============================================ */

/* Onboarding Wizard Progress */
.onboarding-progress {
    background: linear-gradient(135deg, #FF9B00 0%, #FFE100 100%);
    border-radius: 20px;
    padding: 1.5rem;
    color: white;
    margin-bottom: 1.5rem;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%);
    z-index: 1;
}

.progress-step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.progress-step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    color: #FF9B00;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.875rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.progress-step.completed .progress-step-circle {
    background: #22C55E;
    color: white;
    border-color: #22C55E;
}

.progress-step.active .progress-step-circle {
    background: #FF9B00;
    color: white;
    border-color: white;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3);
}

.progress-step-label {
    font-size: 0.625rem;
    font-weight: 700;
    text-align: center;
    opacity: 0.9;
}

/* Chat-Style Order Cards */
.order-chat-card {
    background: white;
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid #F3F4F6;
    transition: all 0.2s ease;
    cursor: pointer;
}

.order-chat-card:hover {
    border-color: #FF9B00;
    box-shadow: 0 4px 12px rgba(255, 155, 0, 0.1);
    transform: translateX(4px);
}

.order-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.order-chat-status {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 800;
    text-transform: uppercase;
}

.order-chat-status.new {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
}

.order-chat-status.processing {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}

.order-chat-status.shipped {
    background: rgba(99, 102, 241, 0.1);
    color: #6366F1;
}

.order-chat-status.completed {
    background: rgba(34, 197, 94, 0.1);
    color: #22C55E;
}

/* Swipe Actions for Mobile */
.swipe-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.swipe-action-btn {
    flex: 1;
    padding: 0.625rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.swipe-action-btn.primary {
    background: #FF9B00;
    color: white;
}

.swipe-action-btn.primary:hover {
    background: #FFE100;
    color: #1F1F1F;
}

.swipe-action-btn.secondary {
    background: #F3F4F6;
    color: #6B7280;
}

.swipe-action-btn.secondary:hover {
    background: #E5E7EB;
}

/* Human-Friendly Analytics */
.analytics-big-number {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, #FF9B00 0%, #FFE100 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.analytics-insight-card {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border-radius: 16px;
    padding: 1rem;
    border-left: 4px solid #FF9B00;
}

.analytics-insight-text {
    font-size: 0.75rem;
    color: #92400E;
    line-height: 1.5;
}

/* AI Upload Helper */
.ai-upload-zone {
    border: 3px dashed #E5E7EB;
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: linear-gradient(135deg, #FAFAFA 0%, #FFFFFF 100%);
}

.ai-upload-zone:hover,
.ai-upload-zone.dragover {
    border-color: #FF9B00;
    background: linear-gradient(135deg, #FFFBEB 0%, #FFFFFF 100%);
    transform: scale(1.02);
}

.ai-upload-zone-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.ai-upload-zone-title {
    font-weight: 800;
    color: #1F1F1F;
    margin-bottom: 0.25rem;
}

.ai-upload-zone-desc {
    font-size: 0.75rem;
    color: #6B7280;
}

.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: linear-gradient(135deg, #A855F7 0%, #9333EA 100%);
    color: white;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 800;
    margin-top: 0.5rem;
}

/* ============================================
   4. MICRO-INTERACTIONS & DELIGHTERS
   ============================================ */

/* Skeleton Loading Animation */
.skeleton {
    background: linear-gradient(90deg, #F3F4F6 25%, #E5E7EB 50%, #F3F4F6 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

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

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: 0.75rem;
}

.skeleton-image {
    aspect-ratio: 1;
    border-radius: 16px;
}

.skeleton-card {
    background: white;
    border-radius: 16px;
    padding: 1rem;
    border: 1px solid #F3F4F6;
}

/* Empty States with Education */
.empty-state-wrapper {
    text-align: center;
    padding: 3rem 1.5rem;
    background: white;
    border-radius: 20px;
    border: 2px dashed #E5E7EB;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 800;
    color: #1F1F1F;
    margin-bottom: 0.5rem;
}

.empty-state-desc {
    font-size: 0.875rem;
    color: #6B7280;
    max-width: 320px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

.empty-state-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #FF9B00;
    color: white;
    font-weight: 700;
    padding: 0.75rem 1.5rem;
    border-radius: 16px;
    transition: all 0.2s ease;
}

.empty-state-cta:hover {
    background: #FFE100;
    color: #1F1F1F;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 155, 0, 0.3);
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1F1F1F;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-notification.success {
    background: #22C55E;
}

.toast-notification.error {
    background: #EF4444;
}

/* Backdrop Blur for Modals */
.backdrop-blur-modal {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, 0.5);
}

/* Smooth Page Transitions */
.page-transition-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-transition-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.page-transition-exit {
    opacity: 1;
    transform: translateY(0);
}

.page-transition-exit-active {
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ============================================
   5. RESPONSIVE UTILITIES
   ============================================ */

/* Hide scrollbar but keep functionality */
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Safe area for mobile notches */
.safe-area-top {
    padding-top: env(safe-area-inset-top);
}

.safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom);
}

/* Touch-friendly tap targets */
.touch-target {
    min-height: 44px;
    min-width: 44px;
}

/* Prevent zoom on iOS input focus */
.prevent-zoom {
    touch-action: manipulation;
}

@media (max-width: 640px) {
    html {
        font-size: 14px;
    }
    
    .touch-target-mobile {
        min-height: 48px;
        min-width: 48px;
    }
}

/* ============================================
   6. ACCESSIBILITY ENHANCEMENTS
   ============================================ */

/* Focus visible styles */
*:focus-visible {
    outline: 3px solid #FF9B00;
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid #FF9B00;
    outline-offset: 2px;
}

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

/* High contrast mode support */
@media (prefers-contrast: high) {
    .masonry-item,
    .order-chat-card,
    .category-tab {
        border-width: 2px;
    }
}
