/* Custom Styles for Koperasi BEST Website */

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

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #d4b068, #b38728);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #b38728, #956e1f);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes fadeInDelay {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    50% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDelay2 {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    66% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.animate-fade-in-delay {
    animation: fadeInDelay 1.5s ease-out;
}

.animate-fade-in-delay-2 {
    animation: fadeInDelay2 2s ease-out;
}

/* Navbar Scroll Effect */
#navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Hover Effects for Navigation Links */
.nav-link {
    position: relative;
    padding-bottom: 4px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #d4b068, #b38728);
    transition: width 0.3s ease;
}

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

/* Mobile Navigation */
#mobile-menu {
    transition: max-height 0.3s ease-in-out;
}

/* Custom Button Styles */
button,
.btn {
    cursor: pointer;
    user-select: none;
}

button:active,
.btn:active {
    transform: scale(0.98);
}

/* Form Input Focus Effects */
input:focus,
select:focus,
textarea:focus {
    outline: none;
}

/* Counter Animation */
.counter {
    transition: all 0.5s ease;
}

/* Card Hover Effects */
.service-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover {
    transform: translateY(-8px);
}

/* Image Overlay Effects */
.image-overlay {
    position: relative;
    overflow: hidden;
}

.image-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.5));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-overlay:hover::before {
    opacity: 1;
}

/* Back to Top Button Animation */
#back-to-top {
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* Loading Animation for Form Submission */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Gradient Text Effect */
.gradient-text {
    background: linear-gradient(135deg, #d4b068, #b38728);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Custom Shadow Effects */
.shadow-gold {
    box-shadow: 0 10px 40px rgba(212, 176, 104, 0.3);
}

.shadow-gold-lg {
    box-shadow: 0 20px 60px rgba(212, 176, 104, 0.4);
}

/* Responsive Typography */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.5rem;
    }
}

/* Print Styles */
@media print {

    nav,
    footer,
    #back-to-top {
        display: none;
    }

    body {
        background: white;
    }

    * {
        color: black !important;
    }
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Visible for Keyboard Navigation */
*:focus-visible {
    outline: 2px solid #d4b068;
    outline-offset: 2px;
}

/* Smooth Transitions for All Interactive Elements */
a,
button,
input,
select,
textarea {
    transition: all 0.3s ease;
}

/* Hero Section Pattern Background */
.pattern-bg {
    background-image:
        linear-gradient(30deg, rgba(255, 255, 255, 0.05) 12%, transparent 12.5%, transparent 87%, rgba(255, 255, 255, 0.05) 87.5%, rgba(255, 255, 255, 0.05)),
        linear-gradient(150deg, rgba(255, 255, 255, 0.05) 12%, transparent 12.5%, transparent 87%, rgba(255, 255, 255, 0.05) 87.5%, rgba(255, 255, 255, 0.05)),
        linear-gradient(30deg, rgba(255, 255, 255, 0.05) 12%, transparent 12.5%, transparent 87%, rgba(255, 255, 255, 0.05) 87.5%, rgba(255, 255, 255, 0.05)),
        linear-gradient(150deg, rgba(255, 255, 255, 0.05) 12%, transparent 12.5%, transparent 87%, rgba(255, 255, 255, 0.05) 87.5%, rgba(255, 255, 255, 0.05));
    background-size: 80px 140px;
    background-position: 0 0, 0 0, 40px 70px, 40px 70px;
}

/* Selection Color */
::selection {
    background-color: #d4b068;
    color: white;
}

::-moz-selection {
    background-color: #d4b068;
    color: white;
}

/* Prevent Text Selection on Buttons */
button,
.btn {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Smooth Image Loading */
img {
    transition: opacity 0.3s ease;
}

img:not([src]) {
    opacity: 0;
}

/* Grid Item Animations */
.grid>* {
    animation: fadeIn 0.6s ease-out backwards;
}

.grid>*:nth-child(1) {
    animation-delay: 0.1s;
}

.grid>*:nth-child(2) {
    animation-delay: 0.2s;
}

.grid>*:nth-child(3) {
    animation-delay: 0.3s;
}

.grid>*:nth-child(4) {
    animation-delay: 0.4s;
}

.grid>*:nth-child(5) {
    animation-delay: 0.5s;
}

.grid>*:nth-child(6) {
    animation-delay: 0.6s;
}

/* Dropdown Menu Styles */
.group .absolute {
    pointer-events: none;
}

.group:hover .absolute {
    pointer-events: auto;
}

/* Submenu Item Hover - Only Active on Direct Hover */
.group .absolute a {
    transition: background-color 0.2s ease, color 0.2s ease;
}

.group .absolute a:hover {
    background-color: #fdfbf7 !important;
    color: #b38728 !important;
}

.group .absolute a.active {
    background-color: #fdfbf7;
    color: #b38728;
}

/* Dropdown Button Hover */
.group button.nav-link::after {
    display: none;
}

.group:hover button.nav-link {
    color: #b38728;
}

/* ===== Main.html Specific Styles ===== */

/* Blob Animation for Background */
@keyframes blob {
    0% {
        transform: translate(0px, 0px) scale(1);
    }

    33% {
        transform: translate(30px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }

    100% {
        transform: translate(0px, 0px) scale(1);
    }
}

.animate-blob {
    animation: blob 7s infinite;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

.animation-delay-500 {
    animation-delay: 0.5s;
}

/* Fade In Up Animation */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* Logo Card Hover Effects */
.logo-card-wrapper {
    text-decoration: none;
}

.logo-card {
    position: relative;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 1.5rem;
    padding: 3px;
    background: linear-gradient(135deg, #d4b068, #b38728, #956e1f);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.logo-card-wrapper:hover .logo-card::before {
    opacity: 1;
}

/* Shadow 3xl Custom */
.shadow-3xl {
    box-shadow: 0 35px 60px -15px rgba(180, 135, 72, 0.3);
}

/* ===== REUSABLE LIGHTBOX GALLERY STYLES ===== */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-info {
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: 12px;
    color: white;
    max-width: 600px;
    text-align: center;
    border: 1px solid rgba(212, 176, 104, 0.2);
}

.lightbox-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #d4b068;
}

.lightbox-description {
    font-size: 14px;
    line-height: 1.6;
    color: #e0e0e0;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: rgba(212, 176, 104, 0.2);
    border: 2px solid #d4b068;
    border-radius: 50%;
    color: #d4b068;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1001;
}

.lightbox-close:hover {
    background: #d4b068;
    color: #1a1a1a;
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(212, 176, 104, 0.2);
    border: 2px solid #d4b068;
    border-radius: 50%;
    color: #d4b068;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1001;
}

.lightbox-nav:hover {
    background: #d4b068;
    color: #1a1a1a;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-counter {
    background: rgba(20, 20, 20, 0.9);
    color: #d4b068;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid rgba(212, 176, 104, 0.3);
}

@media (max-width: 768px) {
    .lightbox-image {
        max-height: 50vh;
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-close {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .lightbox-info {
        padding: 16px;
    }

    .lightbox-title {
        font-size: 20px;
    }

    .lightbox-description {
        font-size: 13px;
    }
}

/* Responsive adjustments for main.html */
@media (max-width: 768px) {
    .logo-card {
        margin-bottom: 1rem;
    }
}