/* Softake - Minimal custom styles (Tailwind handles the rest) */

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: #f5f5f7;
    color: #1d1d1f;
    letter-spacing: -0.01em;
}

.dark body {
    background-color: #0d1117;
    color: #c9d1d9;
}

::selection {
    background-color: #0071e3;
    color: white;
}

.dark ::selection {
    background-color: #58a6ff;
}

/* Apple Light Mode Palette */
:root {
    --apple-bg: #f5f5f7;
    --apple-surface: #ffffff;
    --apple-elevated: #fbfbfd;
    --apple-border: #d2d2d7;
    --apple-border-soft: #e5e5ea;
    --apple-text: #1d1d1f;
    --apple-muted: #6e6e73;
    --apple-subtle: #86868b;
    --apple-blue: #0071e3;
    --apple-blue-hover: #0077ed;
    --apple-blue-pressed: #0063ce;
}

/* Storefront UI Normalization */
.storefront :is(a, button, input[type="submit"], input[type="button"]).bg-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    padding: 0 20px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    line-height: 1;
    transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.2s ease;
}

.storefront :is(a, button, input[type="submit"], input[type="button"]).bg-primary:hover {
    filter: brightness(1.03);
    transform: translateY(-1px);
}

.storefront :is(a, button, input[type="submit"], input[type="button"]).bg-primary:active {
    transform: translateY(0) scale(0.98);
}

.storefront :is(input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], input[type="search"], input[type="url"], select):not(.input-compact) {
    font-size: 0.95rem !important;
    line-height: 1.4 !important;
    padding-top: 0.6rem !important;
    padding-bottom: 0.6rem !important;
    border-radius: 12px !important;
}

.storefront textarea:not(.input-compact) {
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
    border-radius: 12px !important;
    min-height: 140px;
}

.storefront .input-compact {
    font-size: 0.85rem !important;
    line-height: 1.2 !important;
    padding-top: 0.4rem !important;
    padding-bottom: 0.4rem !important;
    border-radius: 10px !important;
}

.storefront #header-search-input {
    min-height: 52px;
    padding-top: 0.85rem !important;
    padding-bottom: 0.85rem !important;
    font-size: 0.95rem !important;
}

.storefront #mobile-search-input {
    min-height: 52px;
    padding-top: 0.85rem !important;
    padding-bottom: 0.85rem !important;
    font-size: 0.95rem !important;
}

/* Glass header */
.glass-header {
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    /* Amazing multi-layered shadow */
    box-shadow:
        0 1px 1px rgba(0, 0, 0, 0.02),
        0 2px 2px rgba(0, 0, 0, 0.02),
        0 4px 4px rgba(0, 0, 0, 0.02),
        0 8px 8px rgba(0, 0, 0, 0.02),
        0 16px 16px rgba(0, 0, 0, 0.02);
}

.light .glass-header {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--apple-border);
    box-shadow:
        0 1px 1px rgba(0, 0, 0, 0.04),
        0 8px 20px rgba(0, 0, 0, 0.06);
}

.dark .glass-header {
    background: rgba(22, 27, 34, 0.9);
    border-bottom: 1px solid rgba(48, 54, 61, 0.9);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.55);
}

/* Product card hover effects */
.product-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    border: 1px solid #e2e8f0;
}

.light .product-card {
    background: var(--apple-surface);
    border-color: var(--apple-border-soft);
}

.dark .product-card {
    background: #161b22;
    border-color: #30363d;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
}

.light .product-card:hover {
    box-shadow: 0 20px 30px -20px rgba(0, 0, 0, 0.2), 0 6px 16px -8px rgba(0, 0, 0, 0.12);
}

.dark .product-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

.product-card:hover .product-img {
    transform: scale(1.05);
}

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

.category-card:hover {
    background-color: #f8fafc;
    border-color: #2563EB;
}

.light .category-card:hover {
    background-color: var(--apple-bg);
    border-color: var(--apple-blue);
}

.dark .category-card:hover {
    background-color: #21262d;
    border-color: #2563EB;
}

/* Material Symbols */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

.icon-filled {
    font-variation-settings: 'FILL' 1, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

/* Product title clamp to keep hero above the fold */
.product-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

/* Shadow utility */
.shadow-subtle {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

/* Hero gradient overlay */
.hero-gradient-overlay {
    background: linear-gradient(90deg, rgba(249, 250, 251, 0.95) 0%, rgba(249, 250, 251, 0.7) 50%, rgba(37, 99, 235, 0.05) 100%);
}

.light .hero-gradient-overlay {
    background: linear-gradient(90deg, rgba(245, 245, 247, 0.98) 0%, rgba(255, 255, 255, 0.8) 55%, rgba(0, 113, 227, 0.06) 100%);
}

.dark .hero-gradient-overlay {
    background: linear-gradient(90deg, rgba(13, 17, 23, 0.95) 0%, rgba(13, 17, 23, 0.7) 50%, rgba(88, 166, 255, 0.15) 100%);
}

/* FAQ accordion */
.faq-item .faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

/* Premium Card Shadow */
.shadow-premium-card {
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 10px 15px -3px rgba(0, 0, 0, 0.05),
        0 0 0 1px rgba(0, 0, 0, 0.02);
}

.light .shadow-premium-card {
    background: var(--apple-surface);
    box-shadow:
        0 6px 12px -6px rgba(0, 0, 0, 0.15),
        0 20px 30px -25px rgba(0, 0, 0, 0.25),
        0 0 0 1px var(--apple-border-soft);
}

.dark .shadow-premium-card {
    background: rgba(22, 27, 34, 0.85);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.3),
        0 10px 15px -3px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(48, 54, 61, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Premium Gradient Text */
.text-gradient-gold {
    background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.light .text-gradient-gold {
    background: linear-gradient(135deg, #1d1d1f 0%, #6e6e73 100%);
}

.dark .text-gradient-gold {
    background: linear-gradient(135deg, #f8fafc 0%, #94a3b8 100%);
}

/* AI Highlight Block */
.ai-summary-block {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.03) 0%, rgba(139, 92, 246, 0.03) 100%);
    border: 1px solid rgba(37, 99, 235, 0.1);
}

.light .ai-summary-block {
    background: linear-gradient(135deg, rgba(0, 113, 227, 0.06) 0%, rgba(0, 113, 227, 0.02) 100%);
    border: 1px solid rgba(0, 113, 227, 0.12);
}

.dark .ai-summary-block {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
    border: 1px solid rgba(37, 99, 235, 0.2);
}

/* Glass Image Effects */
.glass-image-container {
    position: relative;
    overflow: hidden;
}

.glass-image-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 10;
}

.glass-image-container:hover::before {
    opacity: 0.1;
}

/* Badge Pill */
.badge-pill {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Skeleton Screens (UI Ghosts) */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    background: #f1f5f9;
    background-image: linear-gradient(90deg, #f1f5f9 0px, #e2e8f0 40px, #f1f5f9 80px);
    background-size: 1000px 100%;
    background-repeat: no-repeat;
    animation: shimmer 2s infinite linear;
    border-radius: var(--skeleton-radius, 0.75rem);
}

.light .skeleton {
    background: #f5f5f7;
    background-image: linear-gradient(90deg, #f5f5f7 0px, #e5e5ea 40px, #f5f5f7 80px);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
}

.dark .skeleton {
    background: #21262d;
    background-image: linear-gradient(90deg, #21262d 0px, #30363d 40px, #21262d 80px);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
}

.skeleton-text {
    height: 0.75rem;
    margin-bottom: 0.5rem;
    width: 100%;
    --skeleton-radius: 9999px;
}

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

.skeleton-btn {
    height: 3rem;
    border-radius: 0.75rem;
}

/* Maintain aspect ratio for skeletons to prevent layout shift */
.skeleton-card-img {
    aspect-ratio: 3/4;
    width: 100%;
    --skeleton-radius: 1.25rem;
}

.skeleton-hero {
    width: 100%;
    min-height: 420px;
    border-radius: 1.5rem;
}

@media (max-width: 1024px) {
    .skeleton-hero {
        min-height: 360px;
    }
}

@media (min-width: 768px) {
    .skeleton-hero {
        min-height: 560px;
    }
}

/* Dashboard Layout Utilities */
.dashboard-layout {
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .dashboard-layout {
        flex-direction: row;
    }

    .dashboard-main {
        margin-left: 256px;
        /* Matches fixed sidebar width (w-64) */
        width: calc(100% - 256px);
    }
}

/* GitHub Dark Palette Overrides for Tailwind Dark Utilities */
.dark .dark\:bg-slate-900 { background-color: #0d1117 !important; }
.dark .dark\:bg-slate-800 { background-color: #161b22 !important; }
.dark .dark\:bg-slate-700 { background-color: #21262d !important; }
.dark .dark\:bg-slate-800\/70 { background-color: rgba(22, 27, 34, 0.7) !important; }
.dark .dark\:bg-slate-800\/60 { background-color: rgba(22, 27, 34, 0.6) !important; }
.dark .dark\:bg-slate-800\/50 { background-color: rgba(22, 27, 34, 0.5) !important; }
.dark .dark\:bg-slate-800\/40 { background-color: rgba(22, 27, 34, 0.4) !important; }
.dark .dark\:bg-slate-800\/30 { background-color: rgba(22, 27, 34, 0.3) !important; }
.dark .dark\:border-slate-800 { border-color: #30363d !important; }
.dark .dark\:border-slate-700 { border-color: #30363d !important; }
.dark .dark\:border-slate-600 { border-color: #484f58 !important; }
.dark .dark\:text-slate-100 { color: #c9d1d9 !important; }
.dark .dark\:text-slate-200 { color: #c9d1d9 !important; }
.dark .dark\:text-slate-300 { color: #b1bac4 !important; }
.dark .dark\:text-slate-400 { color: #8b949e !important; }
.dark .dark\:text-slate-500 { color: #8b949e !important; }

/* GitHub Dark Global Overrides for non-dark classes (fallback coverage) */
.dark .bg-white { background-color: #161b22 !important; }
.dark .text-slate-900 { color: #c9d1d9 !important; }
.dark .text-slate-800 { color: #c9d1d9 !important; }
.dark .text-slate-700 { color: #c9d1d9 !important; }
.dark .text-slate-600 { color: #b1bac4 !important; }
.dark .text-slate-500 { color: #8b949e !important; }
.dark .text-slate-400 { color: #8b949e !important; }
.dark .border-slate-50 { border-color: #30363d !important; }
.dark .border-slate-100 { border-color: #30363d !important; }
.dark .border-slate-200 { border-color: #30363d !important; }

/* Admin inline validation helpers */
.field-error {
    border-color: #f43f5e !important;
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.15) !important;
}

.field-error-text {
    margin-top: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #e11d48;
}

.dark .field-error-text {
    color: #fb7185;
}

/* Apple Light Palette Overrides for Tailwind Utilities */
.light .bg-white { background-color: var(--apple-surface) !important; }
.light .bg-slate-50 { background-color: var(--apple-bg) !important; }
.light .bg-slate-100 { background-color: var(--apple-elevated) !important; }
.light .bg-slate-200 { background-color: #f0f0f2 !important; }
.light .bg-slate-800 { background-color: #1d1d1f !important; }
.light .bg-background-light { background-color: var(--apple-bg) !important; }
.light .bg-off-white { background-color: var(--apple-bg) !important; }

.light .text-slate-900 { color: var(--apple-text) !important; }
.light .text-slate-800 { color: #2d2d2f !important; }
.light .text-slate-700 { color: #424245 !important; }
.light .text-slate-600 { color: var(--apple-muted) !important; }
.light .text-slate-500 { color: var(--apple-subtle) !important; }
.light .text-slate-400 { color: #a1a1a6 !important; }

.light .border-slate-50 { border-color: var(--apple-border-soft) !important; }
.light .border-slate-100 { border-color: var(--apple-border) !important; }
.light .border-slate-200 { border-color: var(--apple-border) !important; }
.light .border-slate-300 { border-color: #c7c7cc !important; }

.light .bg-primary { background-color: var(--apple-blue) !important; }
.light .text-primary { color: var(--apple-blue) !important; }
.light .border-primary { border-color: var(--apple-blue) !important; }

.light .bg-primary\\/5 { background-color: rgba(0, 113, 227, 0.05) !important; }
.light .bg-primary\\/10 { background-color: rgba(0, 113, 227, 0.1) !important; }
.light .bg-primary\\/20 { background-color: rgba(0, 113, 227, 0.2) !important; }
.light .border-primary\\/10 { border-color: rgba(0, 113, 227, 0.12) !important; }
.light .border-primary\\/30 { border-color: rgba(0, 113, 227, 0.3) !important; }
.light .hover\\:border-primary\\/50:hover { border-color: rgba(0, 113, 227, 0.5) !important; }

.light .ring-primary\\/20 { --tw-ring-color: rgba(0, 113, 227, 0.2) !important; }
.light .focus\\:ring-primary\\/20:focus { --tw-ring-color: rgba(0, 113, 227, 0.2) !important; }
.light .focus\\:ring-primary\\/10:focus { --tw-ring-color: rgba(0, 113, 227, 0.12) !important; }
.light .focus\\:border-primary\\/30:focus { border-color: rgba(0, 113, 227, 0.3) !important; }

.light .hover\\:bg-blue-700:hover { background-color: var(--apple-blue-hover) !important; }
.light .active\\:bg-blue-700:active { background-color: var(--apple-blue-pressed) !important; }

.light .shadow-primary\\/10 { --tw-shadow-color: rgba(0, 113, 227, 0.15) !important; }
.light .shadow-primary\\/20 { --tw-shadow-color: rgba(0, 113, 227, 0.25) !important; }
.light .shadow-primary\\/30 { --tw-shadow-color: rgba(0, 113, 227, 0.35) !important; }

.light .bg-blue-50 { background-color: rgba(0, 113, 227, 0.08) !important; }
.light .bg-blue-100 { background-color: rgba(0, 113, 227, 0.12) !important; }
.light .bg-blue-500\\/10 { background-color: rgba(0, 113, 227, 0.1) !important; }
.light .bg-blue-600 { background-color: var(--apple-blue) !important; }
.light .text-blue-600 { color: var(--apple-blue) !important; }
.light .text-blue-700 { color: #005bb5 !important; }
.light .text-blue-800 { color: #004c99 !important; }
.light .border-blue-100 { border-color: rgba(0, 113, 227, 0.18) !important; }

/* Softflix-inspired storefront refinements (dark mode only) */
.dark .storefront {
    --sf-bg: #121316;
    --sf-surface: #1b1e22;
    --sf-card: #1f2328;
    --sf-card-border: #2b3036;
    --sf-muted: #9aa3ad;
    --sf-text: #f4f5f7;
    --sf-accent: #f28c28;
    --sf-accent-strong: #ffb15e;
    --sf-accent-soft: rgba(242, 140, 40, 0.18);
}

.dark body.storefront,
.dark .storefront {
    background-color: var(--sf-bg);
    color: var(--sf-text);
}

.dark .storefront .glass-header {
    background: rgba(18, 19, 22, 0.94);
    border-bottom: 1px solid var(--sf-card-border);
    box-shadow: 0 12px 32px -14px rgba(0, 0, 0, 0.7);
}

.dark .storefront .bg-white { background-color: var(--sf-surface) !important; }
.dark .storefront .bg-slate-50 { background-color: #16181c !important; }
.dark .storefront .bg-slate-100 { background-color: #1c1f24 !important; }
.dark .storefront .bg-slate-800 { background-color: #0f1114 !important; }

.dark .storefront .text-slate-900 { color: var(--sf-text) !important; }
.dark .storefront .text-slate-800 { color: #e1e5ea !important; }
.dark .storefront .text-slate-700 { color: #d2d7de !important; }
.dark .storefront .text-slate-600 { color: var(--sf-muted) !important; }
.dark .storefront .text-slate-500 { color: var(--sf-muted) !important; }
.dark .storefront .text-slate-400 { color: #80868f !important; }

.dark .storefront .border-slate-50,
.dark .storefront .border-slate-100,
.dark .storefront .border-slate-200 {
    border-color: var(--sf-card-border) !important;
}

.dark .storefront .text-primary { color: var(--sf-accent) !important; }
.dark .storefront .bg-primary { background-color: var(--sf-accent) !important; }
.dark .storefront .border-primary { border-color: var(--sf-accent) !important; }
.dark .storefront .bg-primary\/10 { background-color: var(--sf-accent-soft) !important; }
.dark .storefront .hover\:bg-blue-700:hover { background-color: var(--sf-accent-strong) !important; }
.dark .storefront .shadow-primary\/10 { --tw-shadow-color: rgba(242, 140, 40, 0.25) !important; }
.dark .storefront .shadow-primary\/20 { --tw-shadow-color: rgba(242, 140, 40, 0.35) !important; }

.dark .storefront .product-card {
    background: var(--sf-card);
    border-color: var(--sf-card-border);
    box-shadow: 0 12px 28px -18px rgba(0, 0, 0, 0.75);
}

.dark .storefront .product-card:hover {
    box-shadow: 0 26px 48px -26px rgba(0, 0, 0, 0.85);
    transform: translateY(-6px);
}

.dark .storefront .product-card .wishlist-toggle {
    background: rgba(15, 17, 20, 0.85);
    border: 1px solid var(--sf-card-border);
}

.dark .storefront .product-card .add-cart-btn {
    background: #262b31;
    color: var(--sf-text);
}

.dark .storefront .product-card .add-cart-btn:hover {
    background: var(--sf-accent);
    color: #111;
    box-shadow: 0 12px 28px -16px rgba(242, 140, 40, 0.65);
}

.dark .storefront .slider-prev,
.dark .storefront .slider-next {
    background: rgba(18, 19, 22, 0.85);
    border-color: var(--sf-card-border);
    color: var(--sf-muted);
}

.dark .storefront .slider-prev:hover,
.dark .storefront .slider-next:hover {
    border-color: var(--sf-accent);
    color: var(--sf-accent);
}

.storefront .group-section h2,
.storefront .grid-section h2 {
    letter-spacing: -0.02em;
}

.storefront .group-section .text-primary,
.storefront .grid-section .text-primary {
    letter-spacing: 0.28em;
    font-size: 0.62rem;
}

.dark .storefront .filter-chip.active {
    background: var(--sf-accent) !important;
    color: #111 !important;
}

.dark .storefront .filter-chip:not(.active) {
    color: var(--sf-muted) !important;
}

.dark .storefront .filter-chip:not(.active):hover {
    background: #1b1f24 !important;
}

.dark .storefront .filter-chips {
    background: #15181c;
    border-color: var(--sf-card-border);
}

.dark .storefront .section-link {
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    border: 1px solid var(--sf-card-border);
    background: rgba(19, 20, 22, 0.7);
    color: var(--sf-muted);
    letter-spacing: 0.2em;
}

.dark .storefront .section-link:hover {
    background: var(--sf-accent);
    border-color: var(--sf-accent);
    color: #111;
}

.dark .storefront .hero-cta {
    background: var(--sf-accent);
    color: #111;
    box-shadow: 0 18px 45px -22px rgba(242, 140, 40, 0.65);
}

.dark .storefront .hero-cta:hover {
    background: var(--sf-accent-strong);
}

.dark .storefront .hero-cta:active {
    transform: translateY(0) scale(0.98);
}
