/* Animals Grid */
/* Animals Grid Layout */

/* Section Wrapper with backgrounds */
.animals-section {
    position: relative;
    width: 100vw;
    margin-left: -50vw;
    left: 50%;
    /* Layered Backgrounds: Top Wave repeat-x, then Gray Cover */
    background-image: url('/assets/front/images/bg-wave-bg.jpg'), url('/assets/front/images/bg-gray.jpg');
    background-position: top center, top left;
    background-repeat: repeat-x, repeat;
    background-size: auto;
    /* Space for wave */
    padding-bottom: 60px;
    margin-top: 4rem;
}

.animals-section-bottom-wave {
    background-image: url('/assets/front/images/bg-wave-bg-bottom.jpg');
    background-position: top center, top left;
    background-repeat: repeat-x, repeat;
    background-size: auto;
}

.opentime {
    display: inline-block;
    margin:auto;
    background-color: #fff;
    color: #000;
    font-size: 40px;
    padding: 40px 80px;
    box-sizing: border-box;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    outline: none;
    cursor: default;
    position: relative;
}

/* Dark Mode for opentime - High Contrast Accessibility */
html.dark .opentime {
    background-color: #000;
    color: #feff04;
    border: 3px solid #feff04;
    box-shadow: 0 10px 40px rgba(254, 255, 4, 0.3);
}

/* Focus state base styles (JS will enhance these) */
.opentime:focus {
    outline: 4px solid #819D30;
    outline-offset: 6px;
}

html.dark .opentime:focus {
    outline-color: #feff04;
}

.opentime p {
    line-height: 70% !important;
}

.opentime p span {
    font-size: 1rem !important;
    line-height: inherit !important;
    font-weight: 700;
    color: #666;
}

html.dark .opentime p span {
    color: #e0e0e0;
    font-weight: 700;
}

.opentime strong span {
    font-size: 1.1rem;
    font-weight: 700;
    color: #393939;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: inherit !important;
}

html.dark .opentime strong span {
    color: #feff04;
    font-weight: 700;
}

.opentime .infobar-main-text {
    font-size: 1.75rem !important;
    font-weight: 700;
    color: #819D30;
    line-height: 1.2;
}

html.dark .opentime .infobar-main-text {
    color: #feff04;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(254, 255, 4, 0.5);
}

/* Title Area */
.animals-title-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

.animals-title {
    /* Utilizing existing font */
    color: #417C85;
    /* Secondary Color */
    font-size: 2rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 20px;
}

.wave-line {
    width: 120px;
    height: 6px;
    background-image: url('/assets/front/images/line-wave.png');
    background-repeat: repeat-x;
    background-position: center;
    background-size: contain;
    opacity: 0.7;
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.7;
        filter: brightness(1);
    }
    50% {
        opacity: 1;
        filter: brightness(1.2);
    }
}

.animals-title {
    transition: all 0.3s ease;
}

.animals-title:hover {
    letter-spacing: 0.15em;
    transform: scale(1.05);
}

/* Grid itself - backgrounds moved to section */
.animals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 180px);
    gap: 100px;
    /* margin-top managed by section padding */
    margin-top: 0;
    padding: 0 50px;
    /* Small margin from edge */
    justify-content: center;
    width: 120%;
    /* Force wider grid to generate extra column */
    margin-left: -10%;
    /* Center the wider grid */
}

.animal-item {
    position: relative;
    width: 180px;
    height: 180px;
    text-decoration: none;
    display: block;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease-out forwards;
}

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

/* Staggered animation delays for each item */
.animal-item:nth-child(1) {
    animation-delay: 0.1s;
}

.animal-item:nth-child(2) {
    animation-delay: 0.15s;
}

.animal-item:nth-child(3) {
    animation-delay: 0.2s;
}

.animal-item:nth-child(4) {
    animation-delay: 0.25s;
}

.animal-item:nth-child(5) {
    animation-delay: 0.3s;
}

.animal-item:nth-child(6) {
    animation-delay: 0.35s;
}

.animal-item:nth-child(7) {
    animation-delay: 0.4s;
}

.animal-item:nth-child(8) {
    animation-delay: 0.45s;
}

.animal-item:nth-child(9) {
    animation-delay: 0.5s;
}

.animal-item:nth-child(10) {
    animation-delay: 0.55s;
}

.animal-item:nth-child(11) {
    animation-delay: 0.6s;
}

.animal-item:nth-child(12) {
    animation-delay: 0.65s;
}

.animal-item:nth-child(n+13) {
    animation-delay: 0.7s;
}

.animal-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(45deg);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 25px;
    animation: floatAnimation 3s ease-in-out infinite;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

html.dark .animal-image-wrapper {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

@keyframes floatAnimation {
    0%, 100% {
        transform: rotate(45deg) translateY(0px);
    }
    50% {
        transform: rotate(45deg) translateY(-8px);
    }
}

/* Different float timing for variety */
.animal-item:nth-child(2n) .animal-image-wrapper {
    animation-delay: 0.5s;
}

.animal-item:nth-child(3n) .animal-image-wrapper {
    animation-delay: 1s;
}

.animal-item:hover .animal-image-wrapper {
    transform: rotate(45deg) scale(1.05);
    animation-play-state: paused;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

html.dark .animal-item:hover .animal-image-wrapper {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

.animal-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: rotate(-45deg) scale(1.5);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.animal-item:hover .animal-image {
    transform: rotate(-45deg) scale(1.6);
}

.animal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: rotate(-45deg) scale(1.5);
}

.animal-item:hover .animal-overlay {
    background: rgba(0, 0, 0, 0.7);
}

.animal-name {
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    padding: 0 0.2rem;
    line-height: 1.1;
}

.animal-item:hover .animal-name {
    opacity: 1;
    transform: translateY(0);
}

html.dark .animal-overlay {
    background: rgba(0, 0, 0, 0);
}

html.dark .animal-item:hover .animal-overlay {
    background: rgba(0, 0, 0, 0.8);
}

html.dark .animal-name {
    color: #feff04;
}


@media screen and (max-width: 1024px) {
    .animals-grid {
        grid-template-columns: repeat(auto-fit, 150px);
        gap: 80px;
    }

    .animal-item {
        width: 150px;
        height: 150px;
    }

    .animal-image-wrapper {
        border-radius: 20px;
    }
}

@media screen and (max-width: 768px) {
    .animals-grid {
        grid-template-columns: repeat(auto-fill, 120px);
        gap: 60px;
        width: 160%;
        margin-left: -30%;
        padding: 2rem 0;
    }

    .animal-item {
        width: 120px;
        height: 120px;
    }

    .animal-name {
        font-size: 0.5rem;
    }

    .animal-image-wrapper {
        border-radius: 18px;
    }
}