/* ============================================
   Alfa Havuz Kapama - Custom Styles
   Shadcn UI inspired design system
   ============================================ */

/* --- Scroll-reveal animation helpers --- */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}
.scroll-reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.scroll-reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}
.scroll-reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.scroll-reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* Staggered children */
.scroll-reveal [data-delay="1"] { transition-delay: 0.1s; }
.scroll-reveal [data-delay="2"] { transition-delay: 0.2s; }
.scroll-reveal [data-delay="3"] { transition-delay: 0.3s; }
.scroll-reveal [data-delay="4"] { transition-delay: 0.4s; }

/* --- Header states --- */
#site-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
#site-header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
}

/* --- Hero section --- */
.hero-gradient {
    background: linear-gradient(135deg, #0F172A 0%, #0c4a6e 40%, #0369A1 100%);
}
.hero-overlay {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.7) 0%, rgba(15, 23, 42, 0.4) 50%, rgba(15, 23, 42, 0.8) 100%);
}

/* --- Modern Before/After Slider --- */
#ba-slider {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}
#ba-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 56px;
    height: 100vh;
    background: transparent;
    cursor: ew-resize;
}
#ba-slider::-moz-range-thumb {
    width: 56px;
    height: 100vh;
    background: transparent;
    cursor: ew-resize;
    border: none;
}

/* --- Lightbox --- */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}
.lightbox-overlay img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 0.75rem;
    object-fit: contain;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}
.lightbox-overlay.active img {
    transform: scale(1);
}
.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 0.5rem;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    z-index: 101;
}
.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 0.5rem;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    z-index: 101;
}
.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}
.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

/* --- Accordion (SSS) --- */
.accordion-item {
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.accordion-item:hover {
    border-color: #93c5fd;
}
.accordion-item.active {
    border-color: #0369A1;
    box-shadow: 0 0 0 1px #0369A1;
}
.accordion-trigger {
    width: 100%;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: #1e293b;
    transition: color 0.2s ease;
}
.accordion-trigger:hover {
    color: #0369A1;
}
.accordion-trigger .chevron {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    color: #94a3b8;
}
.accordion-item.active .accordion-trigger .chevron {
    transform: rotate(180deg);
    color: #0369A1;
}
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
}
.accordion-item.active .accordion-content {
    max-height: 500px;
}
.accordion-body {
    padding: 0 1.5rem 1.25rem 1.5rem;
    color: #475569;
    line-height: 1.7;
    font-size: 0.938rem;
}

/* --- Gallery grid --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}
@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    cursor: pointer;
    aspect-ratio: 4/3;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.gallery-item:hover img {
    transform: scale(1.05);
}
.gallery-item .gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(15, 23, 42, 0.6) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 1.25rem;
}
.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* --- Filter buttons --- */
.filter-btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    background: white;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}
.filter-btn:hover {
    border-color: #0369A1;
    color: #0369A1;
}
.filter-btn.active {
    background: #0369A1;
    border-color: #0369A1;
    color: white;
}

/* --- Contact form --- */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.938rem;
    color: #1e293b;
    background: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}
.form-input:focus {
    border-color: #0369A1;
    box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.1);
}
.form-input::placeholder {
    color: #94a3b8;
}

/* --- Feature cards --- */
.feature-card {
    background: white;
    border: 1px solid #f1f5f9;
    border-radius: 1rem;
    padding: 2rem;
    transition: all 0.3s ease;
}
.feature-card:hover {
    border-color: #bfdbfe;
    box-shadow: 0 4px 24px rgba(3, 105, 161, 0.08);
    transform: translateY(-2px);
}
.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Section divider --- */
.section-divider {
    width: 64px;
    height: 4px;
    background: linear-gradient(90deg, #0369A1, #0ea5e9);
    border-radius: 2px;
}

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

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .scroll-reveal, .scroll-reveal-left, .scroll-reveal-right {
        opacity: 1;
        transform: none;
    }
}

/* --- Page Header Banner --- */
.page-banner {
    background: linear-gradient(135deg, #0F172A 0%, #075985 50%, #0369A1 100%);
    position: relative;
    overflow: hidden;
}
.page-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}
.page-banner::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

/* --- Stat counter animation --- */
.stat-number {
    font-variant-numeric: tabular-nums;
}

/* --- System card --- */
.system-card {
    background: white;
    border: 1px solid #f1f5f9;
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}
.system-card:hover {
    border-color: #bfdbfe;
    box-shadow: 0 8px 32px rgba(3, 105, 161, 0.1);
}
