/* Additional custom styles for DigiThela website */

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #4ade80;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #16a34a;
}

/* Loading animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Fade in animation for products */
.product-card {
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.product-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hover effects */
.hover-scale:hover {
    transform: scale(1.05);
}

/* Button hover effects */
.btn-primary {
    background: linear-gradient(45deg, #4ade80, #16a34a);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(74, 222, 128, 0.3);
}

/* Hero section background */
#home {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    position: relative;
    overflow: hidden;
}

#home::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="%23ffffff" fill-opacity="0.1"/><circle cx="50" cy="50" r="1" fill="%23ffffff" fill-opacity="0.1"/><circle cx="90" cy="90" r="1" fill="%23ffffff" fill-opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    pointer-events: none;
}

/* Newsletter section gradient */
.newsletter-gradient {
    background: linear-gradient(135deg, #4ade80 0%, #16a34a 100%);
}

/* Card shadows */
.card-shadow {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease;
}

.card-shadow:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Mobile menu animation */
#mobile-menu {
    transition: all 0.3s ease;
}

/* Pulse animation for notifications */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Form focus styles */
input:focus, textarea:focus {
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.1);
}

/* Product filter transition */
.filter-btn {
    transition: all 0.3s ease;
}

/* Cart modal backdrop blur */
#cart-modal {
    backdrop-filter: blur(4px);
}

/* Vegetable icons for decoration */
.veggie-icon {
    display: inline-block;
    font-size: 1.5rem;
    margin: 0 0.5rem;
    opacity: 0.7;
}

/* Responsive text sizes */
@media (max-width: 640px) {
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
}

/* Loading overlay */
#loader {
    transition: opacity 0.3s ease;
}

/* Scroll to top button animation */
.scroll-top {
    transition: all 0.3s ease;
}

.scroll-top:hover {
    transform: translateY(-2px);
}

/* Feature icons hover effect */
.feature-icon {
    transition: all 0.3s ease;
}

.feature-icon:hover {
    transform: rotate(10deg) scale(1.1);
}

/* Navigation link hover effect */
nav a {
    position: relative;
    overflow: hidden;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #4ade80;
    transition: width 0.3s ease;
}

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

/* Product card image overlay */
.product-image {
    position: relative;
    overflow: hidden;
}

.product-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 60%, rgba(0,0,0,0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-image:hover::after {
    opacity: 1;
}

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

/* Focus styles for better accessibility */
button:focus, 
input:focus, 
textarea:focus, 
a:focus {
    outline: 2px solid #4ade80;
    outline-offset: 2px;
}

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

/* WhatsApp Button Styles */
.whatsapp-btn {
    animation: whatsapp-pulse 2s infinite;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
}

@keyframes whatsapp-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 25px rgba(37, 211, 102, 0.6);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
}

.whatsapp-btn:hover {
    transform: scale(1.1) !important;
    animation: none;
}

/* Currency symbol styling */
.currency-pkr {
    font-weight: 600;
    color: #16a34a;
}

/* Image size optimizations */
.hero-image {
    max-height: 16rem; /* 256px */
}

.about-image {
    max-height: 16rem; /* 256px */
}

.product-image {
    max-height: 10rem; /* 160px */
}

/* Responsive image sizing */
@media (max-width: 768px) {
    .hero-image,
    .about-image {
        max-height: 8rem; /* 128px on mobile - much smaller */
        height: 8rem;
    }
    
    .product-image {
        max-height: 6rem; /* 96px on mobile - smaller for better grid */
        height: 6rem;
    }
    
    /* Mobile logo adjustments - much smaller */
    .header-logo {
        height: 1.5rem; /* 24px - very compact for mobile */
    }
    
    .footer-logo {
        height: 1.25rem; /* 20px - very small for mobile footer */
    }
    
    /* Mobile specific image optimizations */
    .hero-section .lg\:w-1\/2 {
        margin-bottom: 1rem;
    }
    
    /* Ensure images don't overflow on small screens */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Product grid spacing on mobile */
    #products-grid {
        gap: 1rem;
    }
}

/* Additional mobile optimizations for very small screens */
@media (max-width: 480px) {
    .hero-image,
    .about-image {
        max-height: 6rem; /* 96px on very small screens */
        height: 6rem;
    }
    
    .product-image {
        max-height: 5rem; /* 80px on very small screens */
        height: 5rem;
    }
    
    .header-logo {
        height: 1.25rem; /* 20px on very small screens */
    }
    
    .footer-logo {
        height: 1rem; /* 16px on very small screens */
    }
}

/* Logo styling */
.header-logo {
    height: 2.5rem; /* 40px */
    width: auto;
    transition: transform 0.3s ease;
    object-fit: contain; /* Ensure logo maintains aspect ratio */
}

.header-logo:hover {
    transform: scale(1.05);
}

.footer-logo {
    height: 2rem; /* 32px */
    width: auto;
    filter: brightness(1.2); /* Slightly brighter for dark footer */
    object-fit: contain; /* Ensure logo maintains aspect ratio */
}

/* Mobile image container improvements */
@media (max-width: 768px) {
    /* Hero section mobile optimization */
    .hero-section .flex.flex-col.lg\:flex-row {
        gap: 1rem;
    }
    
    /* About section mobile optimization */
    .about-section .flex.flex-col.lg\:flex-row {
        gap: 1rem;
    }
    
    /* Reduce padding on mobile for more space */
    .container.mx-auto.px-4 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Hero text sizing for mobile */
    .hero-title {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }
    
    /* Better mobile card layout */
    .bg-white.rounded-lg.shadow-md {
        margin-bottom: 1rem;
    }
}

/* Navratri Popup Styling */
.navratri-popup {
    backdrop-filter: blur(5px);
    animation: fadeIn 0.5s ease-out;
}

.navratri-popup-content {
    animation: slideInUp 0.6s ease-out;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from { 
        opacity: 0;
        transform: translateY(100px) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Popup Items Styling */
.fruit-item, .veg-item, .demand-item {
    background: white;
    padding: 0.75rem;
    border-radius: 8px;
    border-left: 4px solid #f97316;
    margin-bottom: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.fruit-item {
    border-left-color: #f97316; /* Orange for fruits */
}

.veg-item {
    border-left-color: #16a34a; /* Green for vegetables */
}

.demand-item {
    border-left-color: #9333ea; /* Purple for on-demand */
}

.fruit-item:hover, .veg-item:hover, .demand-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.price {
    font-weight: 700;
    color: #dc2626;
    float: right;
}

.demand-price {
    font-weight: 700;
    color: #9333ea;
    float: right;
}

/* Close button hover effect */
#close-navratri-popup {
    transition: all 0.3s ease;
}

#close-navratri-popup:hover {
    transform: rotate(90deg);
    color: #fbbf24;
}

/* Responsive popup adjustments */
@media (max-width: 768px) {
    .navratri-popup-content {
        margin: 1rem;
        max-height: 95vh;
    }
    
    .navratri-popup-content h2 {
        font-size: 1.5rem;
    }
    
    .navratri-popup-content h3 {
        font-size: 1.25rem;
    }
    
    .fruit-item, .veg-item, .demand-item {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .grid.md\\:grid-cols-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .navratri-popup-content {
        margin: 0.5rem;
        border-radius: 12px;
    }
    
    .navratri-popup-content h2 {
        font-size: 1.25rem;
    }
    
    .fruit-item, .veg-item, .demand-item {
        padding: 0.4rem;
        font-size: 0.85rem;
    }
    
    .price, .demand-price {
        display: block;
        float: none;
        text-align: right;
        margin-top: 0.25rem;
    }
}

/* Special animations for popup elements */
.navratri-popup-content .border-b-2 {
    position: relative;
    overflow: hidden;
}

.navratri-popup-content .border-b-2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #f97316, transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Festive glow effect */
.navratri-popup-content h2 {
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

/* Scrollbar styling for popup */
.navratri-popup-content::-webkit-scrollbar {
    width: 6px;
}

.navratri-popup-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.navratri-popup-content::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #f97316, #ea580c);
    border-radius: 3px;
}

.navratri-popup-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #ea580c, #dc2626);
}