/* ===== Custom Styles for Manea Vineyards ===== */

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

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

::-webkit-scrollbar-track {
    background: #0a192f;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #d4b965;
}

/* Selection color */
::selection {
    background: rgba(201, 168, 76, 0.3);
    color: #f0f0f0;
}

/* ===== Navbar ===== */
#navbar {
    transition: background-color 0.5s ease, box-shadow 0.5s ease, padding 0.3s ease;
}

#navbar.scrolled {
    background-color: rgba(10, 25, 47, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* ===== Mobile Menu ===== */
.mobile-link {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#mobileMenu.open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

#mobileMenu.open .mobile-link:nth-child(1) { transition-delay: 0.05s; }
#mobileMenu.open .mobile-link:nth-child(2) { transition-delay: 0.1s; }
#mobileMenu.open .mobile-link:nth-child(3) { transition-delay: 0.15s; }
#mobileMenu.open .mobile-link:nth-child(4) { transition-delay: 0.2s; }
#mobileMenu.open .mobile-link:nth-child(5) { transition-delay: 0.25s; }

/* Menu button animation */
.menu-line {
    transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
}

#menuBtn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

#menuBtn.active .menu-line:nth-child(2) {
    opacity: 0;
}

#menuBtn.active .menu-line:nth-child(3) {
    width: 24px;
    transform: rotate(-45deg) translate(4px, -4px);
}

/* ===== Service Cards ===== */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #c9a84c, #d4b965);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

.service-card:hover::before {
    transform: scaleX(1);
}

/* ===== Buttons ===== */
a, button {
    -webkit-tap-highlight-color: transparent;
}

/* ===== Image hover effects ===== */
img {
    max-width: 100%;
    height: auto;
}

/* ===== Fade-in animations (progressive enhancement) ===== */
@media (prefers-reduced-motion: no-preference) {
    .fade-in {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.8s ease, transform 0.8s ease;
    }

    .fade-in.visible {
        opacity: 1;
        transform: translateY(0);
    }

    .fade-in-left {
        opacity: 0;
        transform: translateX(-30px);
        transition: opacity 0.8s ease, transform 0.8s ease;
    }

    .fade-in-left.visible {
        opacity: 1;
        transform: translateX(0);
    }

    .fade-in-right {
        opacity: 0;
        transform: translateX(30px);
        transition: opacity 0.8s ease, transform 0.8s ease;
    }

    .fade-in-right.visible {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== Reduced motion ===== */
@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;
    }

    .fade-in, .fade-in-left, .fade-in-right {
        opacity: 1;
        transform: none;
    }
}

/* ===== Back to top button ===== */
#backToTop {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#backToTop.show {
    opacity: 1;
    pointer-events: all;
}

#backToTop:hover {
    transform: translateY(-2px);
}

/* ===== Gallery hover ===== */
.gallery-item {
    overflow: hidden;
    position: relative;
}

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 25, 47, 0.4) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover::after {
    opacity: 1;
}

/* ===== Form focus styles ===== */
input:focus, textarea:focus, select:focus {
    outline: none;
    box-shadow: 0 0 0 1px rgba(201, 168, 76, 0.3);
}

/* ===== Select dropdown ===== */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c9a84c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    appearance: none;
    -webkit-appearance: none;
}

/* ===== Responsive adjustments ===== */
@media (max-width: 768px) {
    .font-heading {
        letter-spacing: -0.01em;
    }
}

/* ===== Print styles ===== */
@media print {
    #navbar, #backToTop, #contactForm, #successMessage {
        display: none !important;
    }
}
