/**
 * xmdigitalapps.com - Custom Styles
 * Premium UI Templates Marketplace
 *
 * Design System:
 * - Primary: Blue (#2563eb)
 * - Accent Warm: Amber (#f59e0b)
 * - Accent Coral: Pink (#f472b6)
 * - Accent Mint: Emerald (#34d399)
 * - Typography: Satoshi (display) + Fraunces (serif accents)
 */

/* ═══════════════════════════════════════════════════════════════
   BASE STYLES & RESETS
   ═══════════════════════════════════════════════════════════════ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Selection styling */
::selection {
    background-color: rgba(37, 99, 235, 0.2);
    color: #1e3a8a;
}

/* Focus styles for accessibility */
:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════ */

/* Serif italic accent (for headings) */
.font-serif {
    font-family: 'Fraunces', Georgia, serif;
    font-optical-sizing: auto;
}

/* Text balance for headings */
h1, h2, h3 {
    text-wrap: balance;
}

/* Paragraph optimization */
p {
    text-wrap: pretty;
}

/* ═══════════════════════════════════════════════════════════════
   GLASS MORPHISM EFFECTS
   ═══════════════════════════════════════════════════════════════ */

.glass {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.glass-dark {
    background: rgba(17, 24, 39, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* ═══════════════════════════════════════════════════════════════
   NOISE TEXTURE OVERLAY
   ═══════════════════════════════════════════════════════════════ */

.noise-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.04;
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: overlay;
}

/* ═══════════════════════════════════════════════════════════════
   CUSTOM SCROLLBAR
   ═══════════════════════════════════════════════════════════════ */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #d1d5db 0%, #9ca3af 100%);
    border-radius: 5px;
    border: 2px solid #f4f6f8;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #9ca3af 0%, #6b7280 100%);
}

/* Hide scrollbar for horizontal scroll containers */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

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

/* ═══════════════════════════════════════════════════════════════
   BUTTON STYLES
   ═══════════════════════════════════════════════════════════════ */

/* Primary button hover glow */
button[class*="bg-primary"],
a[class*="bg-primary"] {
    position: relative;
}

button[class*="bg-primary"]::before,
a[class*="bg-primary"]::before {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    border-radius: inherit;
    filter: blur(20px);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

button[class*="bg-primary"]:hover::before,
a[class*="bg-primary"]:hover::before {
    opacity: 0.4;
}

/* Button press effect */
button:active,
a[role="button"]:active {
    transform: scale(0.98);
}

/* ═══════════════════════════════════════════════════════════════
   CARD HOVER EFFECTS
   ═══════════════════════════════════════════════════════════════ */

/* Magnetic hover effect for cards */
.card-magnetic {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Image zoom on card hover */
.group:hover .group-hover\:scale-110 {
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATION UTILITIES
   ═══════════════════════════════════════════════════════════════ */

/* Fade up animation */
@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-up {
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Float animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) rotate(1deg);
    }
    75% {
        transform: translateY(-5px) rotate(-1deg);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* Pulse soft */
@keyframes pulseSoft {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

.animate-pulse-soft {
    animation: pulseSoft 3s ease-in-out infinite;
}

/* Shimmer effect for loading states */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.animate-shimmer {
    background: linear-gradient(
        90deg,
        #f4f6f8 0%,
        #e5e7eb 20%,
        #f4f6f8 40%,
        #f4f6f8 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

/* Stagger animation delays */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }
.stagger-7 { animation-delay: 0.7s; }
.stagger-8 { animation-delay: 0.8s; }

/* ═══════════════════════════════════════════════════════════════
   LINE CLAMP UTILITIES
   ═══════════════════════════════════════════════════════════════ */

.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════
   GRADIENT TEXT
   ═══════════════════════════════════════════════════════════════ */

.text-gradient {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-warm {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ═══════════════════════════════════════════════════════════════
   FORM STYLES
   ═══════════════════════════════════════════════════════════════ */

input[type="text"],
input[type="email"],
input[type="search"],
textarea {
    transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
textarea:focus {
    transform: translateY(-1px);
}

/* Placeholder styling */
::placeholder {
    color: #9ca3af;
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════
   HEADER STYLES
   ═══════════════════════════════════════════════════════════════ */

header {
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
}

/* ═══════════════════════════════════════════════════════════════
   PRODUCT CARD STYLES
   ═══════════════════════════════════════════════════════════════ */

/* Badge pulse animation */
.badge-pulse {
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
    }
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER STYLES
   ═══════════════════════════════════════════════════════════════ */

footer a {
    position: relative;
}

footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width 0.3s ease;
}

footer a:hover::after {
    width: 100%;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE UTILITIES
   ═══════════════════════════════════════════════════════════════ */

/* Mobile-first tap targets */
@media (max-width: 768px) {
    button,
    a[role="button"],
    input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
    }
}

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

    html {
        scroll-behavior: auto;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .glass {
        background: rgba(255, 255, 255, 0.95);
    }

    button[class*="bg-primary"],
    a[class*="bg-primary"] {
        border: 2px solid currentColor;
    }
}

/* ═══════════════════════════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════════════════════════ */

@media print {
    header,
    footer,
    .no-print {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    a {
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}
