/* Custom styles for Rancho San Pascual */

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

body {
    overflow-x: hidden;
}

/* Hero section particles container */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

/* Primary button style */
.btn-primary {
    background-color: #8B4513;
    color: #FAF6F1;
    border: 2px solid #8B4513;
}

.btn-primary:hover {
    background-color: #5D4037;
    border-color: #5D4037;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}

/* Secondary button style */
.btn-secondary {
    background-color: transparent;
    color: #FAF6F1;
    border: 2px solid #FAF6F1;
}

.btn-secondary:hover {
    background-color: #FAF6F1;
    color: #3E2723;
    transform: translateY(-2px);
}

/* Navbar styles */
#navbar {
    background: transparent;
}

#navbar.scrolled {
    background: rgba(62, 39, 35, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

#navbar.scrolled .nav-link {
    color: #FAF6F1;
}

/* Gallery item hover effect */
.gallery-item {
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.02);
}

/* Lightbox styles */
#lightbox.active {
    display: flex;
}

/* Section transitions */
section {
    opacity: 1;
}

/* Image placeholder styling - exclude carousel */
.gallery-item .aspect-square > div {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #5D4037 0%, #8B4513 100%);
    color: #FAF6F1;
    font-style: italic;
}

/* Carousel styles */
.carousel-wrapper {
    position: relative;
    width: 100%;
}

.carousel-viewport {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    width: 100%;
}

.carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
}

.carousel-slide img {
    display: block;
    width: 100%;
    height: auto;
}

/* OverlayScrollbars Custom Theme */
.os-theme-custom {
    --os-handle-bg: linear-gradient(180deg, #8B4513 0%, #5D4037 100%);
    --os-handle-bg-hover: linear-gradient(180deg, #A0522D 0%, #8B4513 100%);
    --os-handle-bg-active: #3E2723;
}

.os-theme-custom.os-scrollbar {
    --os-size: 12px;
    --os-padding-perpendicular: 3px;
    --os-padding-axis: 3px;
}

.os-theme-custom .os-scrollbar-handle {
    background: var(--os-handle-bg);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.os-theme-custom .os-scrollbar-handle:hover {
    background: var(--os-handle-bg-hover);
}

.os-theme-custom .os-scrollbar-handle:active {
    background: var(--os-handle-bg-active);
}

.os-theme-custom.os-scrollbar-vertical {
    right: 2px;
}

.os-theme-custom .os-scrollbar-track {
    background: rgba(139, 69, 19, 0.1);
    border-radius: 10px;
}

/* Hide default scrollbar when OverlayScrollbars is active */
body[data-overlayscrollbars-initialize] {
    overflow: hidden;
}

/* Mobile: Hide scrollbar completely or make it minimal */
@media (max-width: 767px) {
    html, body {
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }

    html::-webkit-scrollbar,
    body::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
        width: 0;
        background: transparent;
    }
}

/* Desktop fallback scrollbar */
@media (min-width: 768px) {
    ::-webkit-scrollbar {
        width: 10px;
    }

    ::-webkit-scrollbar-track {
        background: rgba(139, 69, 19, 0.1);
    }

    ::-webkit-scrollbar-thumb {
        background: linear-gradient(180deg, #8B4513 0%, #5D4037 100%);
        border-radius: 10px;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(180deg, #A0522D 0%, #8B4513 100%);
    }
}

/* Animation for hero text */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#hero h1 {
    animation: fadeInUp 1s ease-out;
}

#hero p {
    animation: fadeInUp 1s ease-out 0.2s both;
}

#hero .flex {
    animation: fadeInUp 1s ease-out 0.4s both;
}

/* Particles mask overlay effect */
#particles-js canvas {
    position: relative;
    z-index: 1;
}

/* Deer silhouette animation */
.deer-silhouette {
    animation: deerFloat 6s ease-in-out infinite, deerFadeIn 2s ease-out;
}

@keyframes deerFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

@keyframes deerFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 0.15;
        transform: scale(1);
    }
}

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

#mobile-menu.open {
    display: block;
}

/* Focus styles for accessibility */
a:focus,
button:focus {
    outline: 2px solid #6B7B5F;
    outline-offset: 2px;
}

/* Selection color */
::selection {
    background-color: #8B4513;
    color: #FAF6F1;
}

/* Responsive image containers */
@media (max-width: 768px) {
    #hero h1 {
        font-size: 2.5rem;
    }

    #hero p {
        font-size: 1rem;
    }

    /* Move hero content and deer animation up on mobile */
    #hero {
        align-items: flex-start;
        padding-top: 15vh;
    }

    #hero > .relative.z-10 {
        margin-top: 0;
    }

    #particles-js {
        top: -10%;
    }

    /* Reorder hero content on mobile */
    #hero > .relative.z-10 {
        display: flex;
        flex-direction: column;
    }

    #hero > .relative.z-10 h1 {
        order: 1;
    }

    #hero > .relative.z-10 > p {
        order: 3;
        margin-top: 32vh;
        margin-bottom: 0.5rem;
    }

    /* Keep buttons lower on mobile */
    #hero .flex.flex-col.sm\:flex-row {
        order: 4;
        margin-top: 0;
    }
}

/* Print styles */
@media print {
    #navbar,
    #particles-js,
    .btn-primary,
    .btn-secondary {
        display: none;
    }

    section {
        page-break-inside: avoid;
    }
}
