/* --- PROJECT MODAL --- */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.project-modal.active {
    display: flex;
}

.project-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

.project-modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius-lg);
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }

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

.project-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
    z-index: 10;
    color: var(--text-main);
}

.project-modal-close:hover {
    background: var(--primary);
    color: white;
    transform: rotate(90deg);
}

.project-modal-header {
    padding: 50px 60px 30px;
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: relative;
    overflow: hidden;
}

.project-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.1) 0%, transparent 40%);
    pointer-events: none;
}

.project-modal-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: white;
    position: relative;
    z-index: 1;
}

.project-modal-subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.project-modal-body {
    padding: 40px 60px 60px;
}

.project-modal-media {
    width: 100%;
    min-height: 400px;
    height: auto;
    background: white;
    border-radius: var(--radius-md);
    /* overflow: hidden; Removed to prevent clipping */
    margin-bottom: 40px;
    position: relative;
    padding: 20px 0;
    /* Add padding for spacing */
}

.project-modal-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-modal-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.project-modal-info {
    display: grid;
    gap: 35px;
}

.project-modal-section h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.project-description,
.horizontal-project-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-muted);
}

.project-objectives,
.project-services {
    display: grid;
    gap: 12px;
    padding-left: 0;
}

.project-objectives li,
.project-services li {
    padding-left: 30px;
    position: relative;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.project-objectives li::before {
    content: '🎯';
    position: absolute;
    left: 0;
    font-size: 1.1rem;
}

.project-services li::before {
    content: '✓';
    position: absolute;
    left: 0;
    font-size: 1.3rem;
    font-weight: bold;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.project-results {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(245, 87, 108, 0.05) 100%);
    padding: 30px;
    border-radius: var(--radius-md);
    border: 2px solid rgba(102, 126, 234, 0.1);
}

.project-results h3 {
    margin-bottom: 25px;
}

.project-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.result-item {
    text-align: center;
    padding: 25px 20px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
}

.result-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.result-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.result-label {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Modal Responsive */
@media (max-width: 768px) {
    .project-modal-content {
        max-height: 95vh;
        margin: 10px;
    }

    .project-modal-header {
        padding: 40px 30px 25px;
    }

    .project-modal-title {
        font-size: 1.8rem;
    }

    .project-modal-subtitle {
        font-size: 1rem;
    }

    .project-modal-body {
        padding: 30px 25px 40px;
    }

    .project-modal-media {
        height: auto;
        min-height: 250px;
    }

    .project-modal-section h3 {
        font-size: 1.2rem;
    }

    .project-results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .result-value {
        font-size: 2rem;
    }

    .project-modal-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .project-modal-title {
        font-size: 1.5rem;
    }

    .project-results-grid {
        grid-template-columns: 1fr;
    }

    .project-modal-info {
        gap: 25px;
    }
}

/* --- HORIZONTAL CAROUSELS (for multiple galleries stacked vertically) --- */
.horizontal-carousels-stack {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
}

.horizontal-carousel-wrapper {
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

.horizontal-carousel-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center !important;
    width: 100% !important;
    display: block !important;
}

.horizontal-carousel-frame {
    width: 100%;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    position: relative;
}

.horizontal-carousel-container {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.horizontal-carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.horizontal-carousel-slide {
    min-width: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.horizontal-carousel-media {
    width: 100%;
    height: 100%;
    max-height: 500px;
    object-fit: contain;
    display: block;
}

/* Carousel indicators at bottom */
.horizontal-carousel-container .carousel-indicators {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition-base);
    border: 2px solid transparent;
}

.carousel-dot.active {
    background: white;
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.1);
}

/* Responsive for horizontal carousels */
@media (max-width: 768px) {
    .horizontal-carousels-stack {
        gap: 20px;
    }

    .horizontal-carousel-media {
        max-height: 350px;
    }
}

@media (max-width: 480px) {
    .horizontal-carousels-stack {
        gap: 15px;
    }

    .horizontal-carousel-media {
        max-height: 250px;
    }
}

/* Specific style for the moved subtitle in Project Details Modal */
.project-modal-info .project-modal-subtitle {
    font-size: 1.4rem;
    margin-bottom: 5px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    text-align: center;
    font-weight: 700;
    opacity: 1;
    width: 100%;
}