/* ==========================================================================
   PORTFOLIO GALLERY SECTION
   ========================================================================== */
.portfolio-section {
    padding: 120px 0;
    background: var(--bg-white);
}

.portfolio-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 26px;
    background: var(--bg-light-gray);
    border: 1px solid var(--glass-border);
    color: var(--dark);
    border-radius: 30px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 600;
    transition: var(--transition);
}

.filter-btn.active, 
.filter-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg-white);
    box-shadow: 0 4px 15px rgba(255, 102, 51, 0.3);
}

/* Portfolio Layout Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.portfolio-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    cursor: pointer;
}

.portfolio-img-container {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: var(--bg-light-gray);
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* Card Hover Effects & Overlays */
.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(26, 26, 26, 0.95) 0%, rgba(26, 26, 26, 0.3) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 30px;
    opacity: 0;
    transition: var(--transition);
}

.portfolio-item:hover img {
    transform: scale(1.1);
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-overlay h4 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--bg-white);
    margin-bottom: 5px;
}

.portfolio-overlay span {
    color: var(--primary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

/* ==========================================================================
   GLOBAL FORM MODAL (REQUEST QUOTE POPUP)
   ========================================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 26, 0.6);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    max-width: 600px;
    width: 100%;
    position: relative;
    background: var(--bg-white);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.modal-content h3 span {
    color: var(--primary);
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: var(--bg-white);
    font-size: 2rem;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--primary);
}

/* Form Fields Components */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 14px 20px;
    background: var(--bg-light-gray);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--dark);
    font-family: var(--font-main);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-white);
}

/* ==========================================================================
   PORTFOLIO LIGHTBOX MODAL (VIEW IMAGE CAROUSEL)
   ========================================================================== */
.portfolio-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999; /* Pure interface me top par rakhne ke liye */
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: opacity 0.3s ease;
}

.portfolio-lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 85%;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.portfolio-lightbox.active .lightbox-img {
    transform: scale(1);
}

/* Close & Top Bar Elements */
.lightbox-close {
    position: absolute;
    top: 25px;
    right: 35px;
    color: #ffffff;
    font-size: 3rem;
    font-weight: 300;
    cursor: pointer;
    z-index: 10002;
    transition: var(--transition);
    line-height: 1;
}

.lightbox-close:hover {
    color: var(--primary);
    transform: scale(1.1);
}

/* Dynamic Live Counter */
.lightbox-counter {
    position: absolute;
    top: 25px;
    left: 35px;
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 22px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 10001;
    letter-spacing: 0.5px;
}

/* Navigation Slider Buttons */
.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 26px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.lightbox-arrow:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-50%) scale(1.08);
}

.arrow-left { left: 40px; }
.arrow-right { right: 40px; }

/* ==========================================================================
   MOBILE & TABLET VIEW RESPONSIVE SYSTEM
   ========================================================================== */
@media (max-width: 768px) {
    .portfolio-section {
        padding: 80px 0;
    }
    
    .lightbox-content {
        max-width: 95%;
    }

    .lightbox-img {
        max-height: 70vh;
    }

    /* Top positioning optimized to prevent touch collision */
    .lightbox-counter {
        left: 20px;
        top: 20px;
        font-size: 0.95rem;
        padding: 6px 14px;
    }

    .lightbox-close {
        right: 20px;
        top: 15px;
        font-size: 2.5rem;
    }

    /* Optimized Touch Safe Targets for Mobile Devices */
    .lightbox-arrow {
        width: 46px;
        height: 46px;
        font-size: 18px;
        background: rgba(0, 0, 0, 0.6); /* High contrast backdrop overlay */
        border: none;
    }

    .arrow-left { left: 15px; }
    .arrow-right { right: 15px; }
}