/* Farmacia dott. Giantin Sergio - Styles */

/* Header Styles */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, #64e3a1, #52d48f);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Smooth scroll with header offset */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

/* Hero Animations */
@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient 15s ease infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

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

.animate-float-delayed {
    animation: float 20s ease-in-out infinite;
    animation-delay: -10s;
}

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

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

/* Service Cards 3D Effect */
.service-card {
    transform-style: preserve-3d;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.320, 1);
}

.service-card:hover {
    transform: translateY(-10px) rotateX(2deg);
}

/* Medicine/Product Cards */
.medicine-card {
    transition: all 0.4s cubic-bezier(0.23, 1, 0.320, 1);
}

.medicine-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.opening-hours li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
    font-size: 0.95rem;
}

@media (max-width: 640px) {
    .opening-hours li {
        font-size: 0.875rem;
    }
}

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

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Products Carousel Styles */
#products-carousel {
    user-select: none;
}

#products-track {
    will-change: transform;
}

/* Mobile carousel adjustments */
@media (max-width: 768px) {
    .medicine-card {
        min-width: calc(66.666% - 12px) !important;
        width: calc(66.666% - 12px) !important;
    }
}

.medicine-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Navigation buttons */
#prev-btn, #next-btn {
    transition: all 0.3s ease;
    z-index: 20;
}

#prev-btn:hover, #next-btn:hover {
    transform: translateY(-50%) scale(1.1);
}

/* Auto-scroll pause on hover */
#products-carousel:hover #products-track {
    animation-play-state: paused !important;
}

/* Performance optimizations */
* {
    box-sizing: border-box;
}

.medicine-card {
    contain: layout style paint;
}

/* Smooth transitions for better UX */
.transition {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .animate-fade-in,
    .transition,
    #products-track {
        animation: none !important;
        transition: none !important;
    }
}

/* Calendar Styles */
.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    border: 1px solid #e5e7eb;
    background-color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 32px;
}

.calendar-day:hover {
    background-color: #f3f4f6;
}

.calendar-day.today {
    border: 3px solid #00401c !important;
    font-weight: bold;
    box-shadow: 0 0 0 1px #00401c;
}

.calendar-day.other-month {
    color: #d1d5db;
    background-color: #f9fafb;
    opacity: 0.4;
    cursor: default;
}

.calendar-day.other-month:hover {
    background-color: #f9fafb;
    opacity: 0.4;
}

.calendar-day.sunday-closed {
    background-color: #c7c8c9;
    color: #41454d;
}

.calendar-day.sunday-open {
    background-color: #dcfce7;
    border: 2px solid #22c55e;
    color: #166534;
    font-weight: 600;
}

.calendar-day.night-shift {
    background-color: #dbeafe;
    border: 2px solid #3b82f6;
    color: #1e40af;
    font-weight: 600;
}

.calendar-day.holiday {
    background-color: #fef3c7;
    border: 2px solid #f59e0b;
    color: #92400e;
    font-weight: 600;
}

.calendar-day.multiple-events {
    background: linear-gradient(135deg, #dcfce7 0%, #dbeafe 100%);
    border: 2px solid #22c55e;
    color: #166534;
    font-weight: 600;
}

.calendar-header {
    text-align: center;
    font-weight: 600;
    color: #374151;
    background-color: #f3f4f6;
    font-size: 0.7rem;
    padding: 6px 0;
    min-height: 28px;
}

@media (max-width: 640px) {
    .calendar-day {
        font-size: 0.8rem;
        min-height: 34px;
    }

    .calendar-header {
        font-size: 0.7rem;
        padding: 6px 0;
        min-height: 28px;
    }
}

/* Scroll-based Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation for service cards */
.service-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.service-card:nth-child(1).visible { transition-delay: 0.1s; }
.service-card:nth-child(2).visible { transition-delay: 0.2s; }
.service-card:nth-child(3).visible { transition-delay: 0.3s; }
.service-card:nth-child(4).visible { transition-delay: 0.4s; }
.service-card:nth-child(5).visible { transition-delay: 0.5s; }
.service-card:nth-child(6).visible { transition-delay: 0.6s; }

/* Make service cards immediately visible on mobile */
@media (max-width: 768px) {
    .service-card {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Force light mode colors for service card icons */
@media (prefers-color-scheme: dark) {
    .service-card {
        color-scheme: light;
        background-color: white !important;
    }

    .service-card .bg-gradient-to-br {
        filter: none !important;
    }
}

/* Header shrink on scroll */
#main-header.scrolled {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

#main-header.scrolled .w-16.h-16 {
    width: 3rem;
    height: 3rem;
}

/* Button hover effects */
.btn-primary {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: -1;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

/* Improved form focus states */
input:focus,
textarea:focus {
    border-color: #64e3a1;
    box-shadow: 0 0 0 3px rgba(100, 227, 161, 0.1);
}

/* Loading animation for buttons */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.fa-spinner.fa-spin {
    animation: spin 1s linear infinite;
}