/* Main Frontend App CSS
 * Kledje Modern & Contemporary Design
 */

/* Core */
@import url('core/reset.css');
@import url('core/variables.css');
@import url('core/typography.css');
@import url('core/animations.css');
@import url('core/responsive.css');

/* Components */
@import url('components/buttons.css');
@import url('components/cards.css');
@import url('components/forms.css');
@import url('components/modals.css');
@import url('components/navbar.css');

/* Sections */
@import url('sections/hero.css');
@import url('sections/products.css');
@import url('sections/footer.css');

/* Utilities */
html {
    scroll-behavior: smooth;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.section-padding {
    padding: var(--spacing-2xl) 0;
}

/* Glassmorphism Effect */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Hover Scale Effect */
.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

/* Custom Selection */
::selection {
    background-color: var(--primary-color);
    color: var(--brand-dark);
}

/* Dark Mode Toggle Switch */
.theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--secondary-color);
    transition: .4s;
    border-radius: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    z-index: 2;
}

input:checked + .slider {
    background-color: var(--brand-dark);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Kledje Specific Utilities */
.text-brand { color: var(--text-brand) !important; }
.bg-pastel-pink { background-color: var(--primary-color) !important; }
.bg-pastel-lavender { background-color: var(--secondary-color) !important; }
.bg-pastel-mint { background-color: var(--accent-color) !important; }
.bg-creamy { background-color: var(--neutral-color) !important; }

.rounded-kledje { border-radius: var(--radius-lg); }
.shadow-kledje { box-shadow: var(--shadow-md); }

/* ============================================
   MICRO-INTERACTIONS & UX ENHANCEMENTS
   ============================================ */

/* Ripple Effect for Buttons */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.ripple:active::after {
    width: 200px;
    height: 200px;
}

/* Smooth Focus States */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Custom Cursor for Interactive Elements */
@media (hover: hover) {
    a, button, [role="button"] {
        cursor: pointer;
    }
}

/* Touch Feedback */
@media (hover: none) and (pointer: coarse) {
    .btn:active,
    a:active,
    .card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(var(--bg-primary-rgb, 255, 255, 255), 0.7);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    margin-left: -20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 101;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

/* Page Transition */
.page-transition {
    animation: pageFadeIn 0.4s ease-out;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--gradient-primary);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: var(--text-brand);
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

/* Image Lazy Load Blur Effect */
.img-lazy {
    filter: blur(10px);
    transition: filter 0.3s ease;
}

.img-lazy.loaded {
    filter: blur(0);
}

/* Tooltip Styling */
.tooltip {
    position: relative;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    background: var(--text-brand);
    color: white;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.tooltip:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 16px 24px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastSlideIn 0.3s ease;
    border: 1px solid var(--border-color);
}

.toast.success {
    border-right: 4px solid var(--success-color);
}

.toast.error {
    border-right: 4px solid var(--danger-color);
}

.toast.warning {
    border-right: 4px solid var(--warning-color);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Gradient Text Effect */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Badge Styles */
.badge-new {
    background: var(--accent-color);
    color: var(--text-brand);
}

.badge-sale {
    background: var(--danger-color);
    color: white;
}

.badge-featured {
    background: var(--gradient-primary);
    color: var(--text-brand);
}

/* Card Shine Effect */
.card-shine {
    position: relative;
    overflow: hidden;
}

.card-shine::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 ease;
}

.card-shine:hover::before {
    left: 100%;
}

/* Sticky Section Headers */
.sticky-header {
    position: sticky;
    top: 70px;
    background: var(--bg-primary);
    z-index: 100;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

/* Horizontal Scroll Container for Mobile */
.scroll-container {
    display: flex;
    gap: var(--spacing-md);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: var(--spacing-md);
}

.scroll-container::-webkit-scrollbar {
    display: none;
}

.scroll-item {
    flex: 0 0 auto;
    scroll-snap-align: start;
}

/* Pull to Refresh Indicator */
.pull-refresh {
    position: fixed;
    top: -60px;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: top 0.3s ease;
    z-index: 1000;
}

.pull-refresh.visible {
    top: 0;
}

/* Mobile-specific Utilities */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
    
    .text-center-mobile {
        text-align: center !important;
    }
    
    .full-width-mobile {
        width: 100% !important;
    }
    
    .no-shadow-mobile {
        box-shadow: none !important;
    }
    
    .sticky-bottom-mobile {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 999;
        background: var(--bg-card);
        padding: 15px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}

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