/* ============================================
   Bunyad Properties Ltd. - Custom Styles
   ============================================ */

/* Smooth scroll for entire page */
html {
    scroll-behavior: smooth;
}

/* ---- Scroll Progress Bar ---- */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #6B21A8, #D4A017);
    z-index: 9999;
    width: 0%;
    transition: width 0.1s linear;
}

/* ---- Back-to-Top Button ---- */
#back-to-top {
    position: fixed;
    bottom: 6rem;
    right: 1.5rem;
    z-index: 50;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #6B21A8;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(107, 33, 168, 0.4);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s, background 0.3s;
    pointer-events: none;
}

#back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#back-to-top:hover {
    background: #D4A017;
    box-shadow: 0 6px 20px rgba(212, 160, 23, 0.5);
}

/* ---- Hero Slider ---- */
.hero-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 4;
    min-height: 200px;
    max-height: 100vh;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.hero-slide.active {
    opacity: 1;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(107, 33, 168, 0.85) 0%, rgba(91, 26, 138, 0.7) 50%, rgba(0, 0, 0, 0.5) 100%);
}

/* Hero text stronger shadows */
.hero-text-shadow {
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hero-subtitle-shadow {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

/* Hero CTA buttons */
.hero-cta {
    transition: all 0.3s ease;
}

.hero-cta:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.slider-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.slider-dot.active {
    background: #D4A017;
    transform: scale(1.4);
    box-shadow: 0 0 12px rgba(212, 160, 23, 0.6);
}

/* ---- Navigation ---- */
.nav-scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Desktop nav animated underline */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #6B21A8;
    transition: width 0.3s ease;
    border-radius: 1px;
}

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

/* Contact button shadow */
.nav-contact-btn {
    box-shadow: 0 2px 8px rgba(107, 33, 168, 0.15);
}

.nav-contact-btn:hover {
    box-shadow: 0 4px 15px rgba(107, 33, 168, 0.3);
}

/* Mobile menu slide animation */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 0;
}

#mobile-menu.menu-open {
    max-height: 400px;
    opacity: 1;
}

/* ---- Service Cards ---- */
.service-card {
    border-left: 4px solid #6B21A8;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(107, 33, 168, 0.04), transparent);
    transition: left 0.6s ease;
}

.service-card:hover::before {
    left: 100%;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(212, 160, 23, 0.2);
    border-left-color: #D4A017;
}

/* Service card icon hover */
.service-icon-wrap {
    transition: all 0.3s ease;
}

.service-card:hover .service-icon-wrap {
    background: #6B21A8;
}

.service-card:hover .service-icon-wrap i {
    color: #fff;
}

/* ---- Project Cards ---- */
.project-card {
    overflow: hidden;
    border-radius: 0.75rem;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.project-card .project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(107, 33, 168, 0.9) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(2px);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-card .project-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.project-card:hover .project-info {
    transform: translateY(0);
    opacity: 1;
}

/* ---- Filter Tabs ---- */
.filter-btn {
    padding: 0.5rem 1.5rem;
    border-radius: 9999px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.3s;
    border: 2px solid #e5e7eb;
    color: #6b7280;
    background: white;
    cursor: pointer;
}

.filter-btn:hover {
    border-color: #6B21A8;
    color: #6B21A8;
}

.filter-btn.active {
    background: #6B21A8;
    border-color: #6B21A8;
    color: white;
}

/* ---- Team Cards ---- */
.team-card {
    transition: all 0.3s ease;
}

.team-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(107, 33, 168, 0.2);
    border-color: rgba(107, 33, 168, 0.1);
}

/* Director card gradient overlay pulse */
.director-gradient {
    position: relative;
    overflow: hidden;
}

.director-gradient::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.director-gradient:hover::after {
    opacity: 1;
}

/* Engineer card icon animation */
.engineer-card:hover .engineer-icon {
    transform: rotateY(180deg);
}

.engineer-icon {
    transition: transform 0.6s ease;
}

/* ---- Stats Counter ---- */
.stat-item {
    text-align: center;
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(107, 33, 168, 0.15);
    background: linear-gradient(135deg, #f3e8ff, #faf5ff);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: #6B21A8;
    line-height: 1;
}

/* ---- Vision/Mission Card Hover ---- */
.vision-mission-card {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.vision-mission-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(107, 33, 168, 0.12);
    border-color: rgba(107, 33, 168, 0.1);
}

/* ---- Scroll Animations ---- */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ---- Section Divider ---- */
.section-line {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, transparent, #D4A017, transparent);
    margin: 0 auto;
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(212, 160, 23, 0.3);
}

/* ---- Contact Form ---- */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    outline: none;
    font-size: 0.95rem;
}

.form-input:hover {
    border-color: #d1d5db;
}

.form-input:focus {
    border-color: #6B21A8;
    box-shadow: 0 0 0 4px rgba(107, 33, 168, 0.1);
    transform: translateY(-2px);
}

/* Label color on focus-within */
.form-group:focus-within label {
    color: #6B21A8;
}

/* Submit button hover */
.submit-btn {
    transition: all 0.3s ease;
}

.submit-btn:hover {
    transform: scale(1.02);
}

/* ---- Gallery ---- */
.gallery-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 0.75rem;
}

.gallery-item .gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(107, 33, 168, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

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

/* ---- Lightbox ---- */
#lightbox {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

#lightbox img {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 0.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

#lightbox.active img {
    transform: scale(1);
}

#lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

#lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ---- Footer hover effects ---- */
.footer-link {
    transition: all 0.3s ease;
}

.footer-link:hover {
    padding-left: 4px;
}

.footer-social {
    transition: all 0.3s ease;
}

.footer-social:hover {
    transform: translateY(-3px);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .hero-slider {
        aspect-ratio: 16 / 4;
        min-height: 150px;
        max-height: 100vh;
    }

    .stat-number {
        font-size: 2rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .hero-slider {
        aspect-ratio: 16 / 4;
        min-height: 120px;
        max-height: 100vh;
    }

    h1 {
        font-size: 1.75rem;
    }
}

/* ---- Utility Classes ---- */

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #6B21A8, #D4A017);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Shadow system */
.shadow-soft {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.shadow-medium {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.shadow-deep {
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
}

/* Parallax background */
.parallax-bg {
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
}

@media (prefers-reduced-motion: reduce) {
    .parallax-bg {
        background-attachment: scroll;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.bg-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%236B21A8' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}