/**
 * Homepage Enhancements CSS
 * Additional styles for improved retention and conversion
 */

/* ================================
   Hero Section Enhancements
   ================================ */

.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(228, 44, 0, 0.05) 0%, rgba(0, 0, 0, 0.02) 100%);
    pointer-events: none;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background-color: #000;
    color: #fff;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
}

.btn-primary:hover {
    background-color: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-outline {
    background-color: transparent;
    color: #000;
    padding: 1rem 2rem;
    border: 2px solid #000;
    border-radius: 0.5rem;
}

.btn-outline:hover {
    background-color: #000;
    color: #fff;
}

.btn-lg {
    padding: 1.25rem 2.5rem;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ================================
   Promotional Banner
   ================================ */

.promo-banner {
    position: relative;
    z-index: 40;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.countdown-timer {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #E42C00;
}

/* ================================
   Scrolling Marquee Animation
   ================================ */

.marquee-wrapper {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.marquee-content {
    display: flex;
    width: fit-content;
    animation: scroll-left 25s linear infinite;
    will-change: transform;
}

.marquee-text {
    display: inline-block;
    white-space: nowrap;
    padding-right: 4rem;
    font-size: 0.875rem;
    font-weight: 500;
}

@media (min-width: 768px) {
    .marquee-text {
        font-size: 1rem;
    }
}

@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-25%);
    }
}

/* Pause animation on hover for better UX and accessibility */
.promo-banner:hover .marquee-content {
    animation-play-state: paused;
}

/* Reduced motion support for accessibility */
@media (prefers-reduced-motion: reduce) {
    .marquee-content {
        animation: none;
    }
    
    .marquee-text:not(:first-child) {
        display: none;
    }
}

/* ================================
   Social Proof Section
   ================================ */

.social-proof-section {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

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

/* ================================
   Skeleton Loading Screens
   ================================ */

.skeleton-card, .skeleton-photo {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* ================================
   Product Card Enhancements
   ================================ */

.product-card {
    position: relative;
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-4px);
}

.product-card .card {
    overflow: hidden;
}

.product-card img {
    transition: transform 0.5s ease;
}

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

/* Stock Badge */
.stock-badge {
    animation: pulse 1.5s ease-in-out infinite;
}

/* ================================
   Category Cards
   ================================ */

.category-card {
    position: relative;
    overflow: hidden;
}

.category-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.category-card:hover::after {
    opacity: 1;
}

/* Ensure category figure elements always have a visible background */
.category-card figure,
.card figure {
    background-color: rgb(249 250 251) !important; /* bg-gray-50 */
    min-height: 100%;
}

/* Ensure card containers have white backgrounds - no black boxes */
.card, 
.card > *,
a .card,
a > .card {
    background-color: #ffffff !important;
}

/* Override any potential dark backgrounds on card bodies */
.card .card-body,
a .card .card-body,
div.card-body {
    background-color: #ffffff !important;
    color: #000000 !important;
}

/* Specifically target category cards to ensure no black backgrounds */
.grid a .card,
section a[href*="category"] .card,
a[href*="search-results.html"] .card {
    background-color: #ffffff !important;
}

.grid a .card-body,
section a[href*="category"] .card-body,
a[href*="search-results.html"] .card-body {
    background-color: #ffffff !important;
    color: #000000 !important;
}

/* Category images should fade in smoothly and fill containers properly */
.category-card figure img,
.card figure img {
    transition: opacity 0.3s ease;
    background-color: transparent;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Prevents black boxes by ensuring images fill containers */
    display: block; /* Removes extra space below images */
}

.category-card figure img:not(.hidden),
.card figure img:not(.hidden) {
    opacity: 1;
}

/* Ensure hidden images don't render or cause layout issues */
.category-card figure img.hidden,
.card figure img.hidden {
    display: none !important;
    visibility: hidden;
    opacity: 0;
}

/* Ensure placeholders are always visible when images are hidden */
.category-card figure #category-shirts-placeholder,
.category-card figure #category-sweats-placeholder,
.category-card figure #category-accessories-placeholder,
.card figure #category-shirts-placeholder,
.card figure #category-sweats-placeholder,
.card figure #category-accessories-placeholder {
    position: relative;
    z-index: 1;
}

/* ================================
   Newsletter Section
   ================================ */

.newsletter-section {
    position: relative;
    overflow: hidden;
}

.newsletter-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(228, 44, 0, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

#newsletter-form {
    position: relative;
    z-index: 1;
}

/* ================================
   Quick View Button
   ================================ */

.quick-view-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
}

/* ================================
   Modal Styles
   ================================ */

.fixed {
    position: fixed;
}

.inset-0 {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.z-50 {
    z-index: 50;
}

.bg-opacity-60 {
    background-color: rgba(0, 0, 0, 0.6);
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.max-w-4xl {
    max-width: 56rem;
}

.max-w-lg {
    max-width: 32rem;
}

.rounded-2xl {
    border-radius: 1rem;
}

.overflow-y-auto {
    overflow-y: auto;
}

.max-h-\[90vh\] {
    max-height: 90vh;
}

/* ================================
   Line Clamp Utility
   ================================ */

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

/* ================================
   Aspect Ratio
   ================================ */

.aspect-square {
    aspect-ratio: 1 / 1;
}

/* ================================
   Customer Photos Grid
   ================================ */

.customer-photos-grid img {
    transition: transform 0.3s ease, filter 0.3s ease;
    cursor: pointer;
}

.customer-photos-grid img:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Customer photo cards - prevent black boxes */
.customer-photo-card {
    background-color: rgb(229 231 235) !important; /* bg-gray-200 */
    position: relative;
    overflow: hidden;
}

.customer-photo-card img,
.customer-photo-card video {
    background-color: transparent !important;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.customer-photo-card img.hidden,
.customer-photo-card video.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none;
}

/* Prevent images without src from showing */
.customer-photo-card img:not([src]),
.customer-photo-card img[src=""],
.customer-photo-card video:not([src]),
.customer-photo-card video[src=""] {
    display: none !important;
    visibility: hidden !important;
}

.customer-photo-card img:not(.hidden),
.customer-photo-card video:not(.hidden) {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Skeleton placeholder for photos */
.customer-photo-card .skeleton-photo {
    z-index: 2;
    background-color: rgb(229 231 235) !important; /* bg-gray-200 */
}

/* Ensure skeleton stays visible until image loads */
.customer-photo-card .skeleton-photo[style*="display: none"] {
    display: none !important;
}

/* Hide overlay until image loads */
.customer-photo-card .overlay.hidden {
    display: none !important;
}

/* Overlay should be transparent by default, only show on hover */
.customer-photo-card:hover .overlay:not(.hidden) {
    background-color: rgba(0, 0, 0, 0.4) !important;
}

/* Ensure images are behind placeholders but above card background */
.customer-photo-card img,
.customer-photo-card video {
    z-index: 1;
}

/* Overlay should be above images but below placeholders */
.customer-photo-card > div[class*="absolute"][class*="inset-0"]:not(.skeleton-photo) {
    z-index: 3;
    background-color: transparent !important;
}

/* ================================
   Badge Styles
   ================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-outline {
    background-color: transparent;
    border: 1px solid currentColor;
}

.badge-primary {
    background-color: #E42C00;
    color: white;
}

/* ================================
   Card Styles
   ================================ */

.card {
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: #ffffff !important;
    color: #000000 !important;
}

.card-body {
    padding: 1.5rem;
    background-color: #ffffff !important;
    color: #000000 !important;
    min-height: auto;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #000000;
}

.card-actions {
    display: flex;
    margin-top: 1rem;
}

.justify-end {
    justify-content: flex-end;
}

/* ================================
   Shadow Utilities
   ================================ */

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
}

.shadow-xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
}

.shadow-2xl {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* Ensure category cards have minimal shadows - no black boxes */
section a[href*="search-results"] .card.shadow-xl,
.grid > a .card.shadow-xl {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.04) !important;
}

/* ================================
   Transform Utilities
   ================================ */

.transform {
    transform: translateY(0);
}

.-translate-y-1 {
    transform: translateY(-0.25rem);
}

.hover\:-translate-y-1:hover {
    transform: translateY(-0.25rem);
}

.scale-105 {
    transform: scale(1.05);
}

.group:hover .group-hover\:scale-105 {
    transform: scale(1.05);
}

/* ================================
   Transition Utilities
   ================================ */

.transition-all {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-transform {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-colors {
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.duration-300 {
    transition-duration: 300ms;
}

/* ================================
   Mobile Optimizations
   ================================ */

@media (max-width: 768px) {
    .hero-section {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    .btn-lg {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    .quick-view-btn {
        opacity: 1 !important;
        position: static;
        transform: none !important;
        margin-top: 1rem;
        width: 100%;
    }
}

/* ================================
   Base/Background Color Classes
   ================================ */

.bg-base-100 {
    background-color: #ffffff;
}

.bg-base-200 {
    background-color: #f9fafb;
}

.base-100 {
    background-color: #ffffff;
}

.text-base-content {
    color: #1f2937;
}

/* ================================
   Accessibility
   ================================ */

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

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

/* Sale styling removed - manage pricing through Printify */

/* ================================
   Print Styles
   ================================ */

@media print {
    .promo-banner,
    .exit-popup-overlay,
    .quick-view-btn,
    .newsletter-section {
        display: none !important;
    }
}

