/* Custom Styles for TEFA Peternakan Website */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    scroll-behavior: smooth;
    overflow-x: hidden; /* Prevent horizontal scroll */
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Loading Screen */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #15803d; /* Green-700 */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Navbar Dropdown */
.dropdown-container {
    position: relative;
}

.dropdown-container:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu {
    transform: translateY(-10px);
}

.dropdown-container:hover button svg {
    transform: rotate(180deg);
}

/* Mobile Dropdown */
.mobile-dropdown-content.active {
    display: block !important;
}

.mobile-dropdown-btn.active svg {
    transform: rotate(180deg);
}

/* Smooth Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.animate-fade-in { animation: fadeIn 1s ease-out; }
.animate-fade-left { animation: fadeLeft 1s ease-out; }
.animate-fade-right { animation: fadeRight 1s ease-out; }
.animate-zoom-in { animation: zoomIn 0.8s ease-out; }

/* Scroll Animations */
.scroll-animate {
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.scroll-animate.fade-up { transform: translateY(50px); }
.scroll-animate.fade-left { transform: translateX(-50px); }
.scroll-animate.fade-right { transform: translateX(50px); }
.scroll-animate.zoom-in { transform: scale(0.9); }

.scroll-animate.visible {
    opacity: 1;
    transform: translate(0) scale(1);
}

/* Card Hover Effects */
.product-card,
.service-card,
.testimonial-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Bouncy effect */
}

.product-card:hover,
.service-card:hover,
.testimonial-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* FAQ Accordion */
.faq-question.active svg {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-answer.active {
    display: block !important;
    max-height: 500px;
    padding-top: 0;
}

/* Button Hover Effects */
button, a {
    transition: all 0.3s ease;
}

/* Form Focus States */
input:focus, textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.3); /* Green ring */
}

/* Mobile Menu */
#mobile-menu {
    transition: all 0.3s ease;
}

#mobile-menu.active {
    display: block !important;
}

/* Hero Section */
#beranda {
    position: relative;
    overflow: hidden;
}

#beranda::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.4)); /* Slightly darker overlay */
    z-index: 1;
}

#beranda > * {
    position: relative;
    z-index: 2;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .nav-link { font-size: 0.95rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.75rem; }
}

/* Active Navigation Link */
.nav-link.active {
    color: #15803d;
    font-weight: 600;
}

/* Smooth transitions for all interactive elements */
.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #15803d;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #166534;
}