/* Background image layer */
.projects-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('/Construction/LuxuryHouse.jpg');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    z-index: 0;
}

/* Dark overlay for better readability - Lighter to let image show through */
.projects-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 1;
}

/* Section positioning */
#our-projects {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    min-height: 100vh;
    padding: 40px 0;
}

/* Description container */
.description-container {
    padding-bottom: 30px !important;
}

/* Projects badge - Transparent version */
.projects-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(43, 108, 176, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 0.6rem 1.8rem;
    border-radius: 50px;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.projects-badge i {
    font-size: 1rem;
    color: rgb(43, 108, 176);
}

/* Projects description */
.projects-description {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.2rem;
    line-height: 1.6;
    max-width: 600px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.text-highlight {
    color: rgb(43, 108, 176);
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Cards Grid - Professional Spacing */
.row.g-4 {
    --bs-gutter-y: 1.5rem;
}

/* TRANSPARENT PROJECT CARDS - WITH LONGER IMAGES */
.project-card {
    background: rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.2, 0.9, 0.3, 1);
    cursor: pointer;
    height: 100%;
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
    color: white;
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    background: rgba(255, 255, 255, 0.18) !important;
}

/* Image wrapper - FORCED LONGER with !important */
.project-img-wrapper {
    overflow: hidden;
    height: 280px !important; /* FORCED to 280px */
    min-height: 280px !important; /* Backup property */
    max-height: 280px !important; /* Backup property */
    position: relative;
    display: block; /* Ensure block display */
    width: 100% !important;
}

/* Blue line at the bottom of the image */
.project-img-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgb(43, 108, 176);
    box-shadow: 0 0 10px rgba(43, 108, 176, 0.5);
    z-index: 10;
    pointer-events: none; /* So it doesn't interfere with clicks */
}

.project-card img {
    width: 100% !important;
    height: 100% !important; /* Force image to fill wrapper */
    object-fit: cover !important;
    transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.3, 1);
    display: block; /* Remove any extra spacing */
}

.project-card:hover img {
    transform: scale(1.05);
}

/* Card body - REDUCED top padding to bring title CLOSER to image */
.project-card .card-body {
    padding: 0.5rem 1.2rem 1.5rem 1.2rem !important; /* Top padding reduced from 1.5rem to 0.5rem */
}

.project-title {
    color: white !important;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: color 0.3s ease;
    margin-top: 0 !important; /* Remove any top margin */
    line-height: 1.3;
}

.project-card:hover .project-title {
    color: rgba(255, 255, 255, 1) !important;
}

.project-description {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1.2rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: color 0.3s ease;
}

.project-card:hover .project-description {
    color: rgba(255, 255, 255, 1) !important;
}

/* Professional Project Button - THIN LIGHT WHITE BORDER */
.project-btn {
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 8px;
    padding: 8px 24px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.4s cubic-bezier(0.2, 0.9, 0.3, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

/* ========================================= */
/* MODAL STYLES - WITH LARGER IMAGES */
/* ========================================= */

.manual-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.manual-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1;
}

.manual-modal-dialog {
    position: relative;
    margin: 0 auto;
    top: 50%;
    transform: translateY(-50%);
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
    z-index: 2;
    animation: none;
}

.manual-fullscreen {
    max-width: 100%;
    width: 100%;
    height: 100vh;
    top: 0;
    transform: none;
    margin: 0;
}

.manual-modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.manual-bg-black {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 0;
    height: 100vh;
}

.manual-modal-header {
    background: rgb(43, 108, 176);
    color: white;
    padding: 1.2rem 1.8rem;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.manual-border-0 {
    border: none;
    justify-content: flex-end;
    background: transparent;
}

.manual-modal-title {
    font-weight: 700;
    margin: 0;
    font-size: 1.3rem;
}

.manual-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex-grow: 1;
    max-height: calc(90vh - 130px);
}

.manual-flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 0;
}

.manual-modal-footer {
    padding: 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    flex-shrink: 0;
}

/* Close buttons */
.manual-close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 2.2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    opacity: 0.9;
}

.manual-close-btn:hover {
    opacity: 1;
}

.manual-close-white {
    color: white;
    font-size: 2.8rem;
}

.manual-close-footer-btn {
    border: 2px solid rgb(43, 108, 176);
    color: rgb(43, 108, 176);
    background: transparent;
    border-radius: 8px;
    padding: 8px 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.manual-close-footer-btn:hover {
    background-color: rgb(43, 108, 176);
    color: white;
}

/* ========================================= */
/* IMPROVED MODAL GRID - 2 COLUMNS WITH LARGER IMAGES */
/* ========================================= */

.modal-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    padding: 10px;
}

.modal-grid-item {
    break-inside: avoid;
    margin-bottom: 0;
}

.modal-image-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.2, 0.9, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.modal-image-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.3);
    border-color: rgb(43, 108, 176);
}

.modal-image-wrapper {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
}

.modal-grid-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.modal-image-card:hover .modal-grid-image {
    transform: scale(1.03);
}

.modal-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    color: white;
}

.modal-image-overlay i {
    color: white;
    font-size: 2.5rem;
    background: rgba(43, 108, 176, 0.9);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.modal-image-overlay span {
    font-size: 1rem;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.modal-image-card:hover .modal-image-overlay {
    opacity: 1;
}

.modal-image-caption {
    padding: 15px;
    margin: 0;
    color: #333;
    font-size: 1rem;
    text-align: center;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-weight: 500;
}

.manual-preview-image {
    max-height: 90vh;
    max-width: 90vw;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transition: none;
}

/* Empty state - Transparent version */
.empty-state {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.empty-icon {
    font-size: 3.5rem;
    color: rgb(43, 108, 176);
    margin-bottom: 1rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.empty-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin-bottom: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* All animations removed except hover */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Removed all animation delays */
.projects-badge, .projects-description, .stat-pill, .project-card {
    animation: none;
    opacity: 1;
}

/* Responsive - ENSURE IMAGES RESIZE ON ALL SCREENS */
@media (max-width: 991px) {
    .project-card {
        max-width: 350px;
    }
    
    .project-img-wrapper {
        height: 260px !important;
        min-height: 260px !important;
        max-height: 260px !important;
    }
    
    .modal-image-wrapper {
        height: 250px;
    }
}

@media (max-width: 768px) {
    .projects-background {
        background-attachment: scroll;
    }
    
    .description-container {
        padding-bottom: 25px !important;
    }
    
    .projects-description {
        font-size: 1.1rem;
    }
    
    .project-card {
        max-width: 320px;
    }
    
    .project-img-wrapper {
        height: 240px !important;
        min-height: 240px !important;
        max-height: 240px !important;
    }
    
    .project-title {
        font-size: 1.1rem;
    }
    
    .project-card:hover {
        transform: translateY(-4px);
    }
    
    .project-btn {
        border-width: 1px !important;
    }
    
    .manual-modal-dialog {
        width: 95%;
    }
    
    .modal-grid-2col {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .modal-image-wrapper {
        height: 200px;
    }
    
    .modal-image-caption {
        font-size: 0.9rem;
        padding: 12px;
    }
    
    .modal-image-overlay i {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }
    
    .modal-image-overlay span {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    #our-projects {
        padding: 30px 0;
    }
    
    .projects-description {
        font-size: 1rem;
    }
    
    .project-card {
        max-width: 300px;
    }
    
    .project-img-wrapper {
        height: 220px !important;
        min-height: 220px !important;
        max-height: 220px !important;
    }
    
    .project-title {
        font-size: 1rem;
    }
    
    .project-description {
        font-size: 0.85rem;
    }
    
    .project-btn {
        padding: 6px 20px;
        font-size: 0.85rem;
        border-width: 1px !important;
    }
    
    .project-card:hover {
        transform: translateY(-3px);
    }
    
    .modal-grid-2col {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .modal-image-wrapper {
        height: 250px;
    }
}