/* --- Projects Carousel --- */
.projects-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
    width: 100%;
    /* Naturally full width now */
}



.projects-carousel {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    gap: 30px;
    padding: 40px 5vw;
    /* Start content with some spacing */
    width: 100%;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

.projects-carousel.centered {
    justify-content: center;
}

.projects-carousel::-webkit-scrollbar {
    display: none;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    /* Keep navigation clickable above expanded/hovered cards (z-index: 50). */
    z-index: 100;
    font-size: 28px;
    color: var(--primary);
    display: none;
    /* Hidden by default, shown via JS if overflow */
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.carousel-btn:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 8px 25px rgba(255, 159, 28, 0.4);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev {
    left: 40px;
}

.carousel-btn.next {
    right: 40px;
}

@media (max-width: 768px) {
    .carousel-btn {
        display: none !important;
    }

    .projects-wrapper::before,
    .projects-wrapper::after {
        width: 50px;
        /* Smaller gradient on mobile */
    }
}

/* --- Project Cards (Redesigned) --- */
.product-card {
    flex: 0 0 340px;
    /* Slightly wider */
    min-width: 320px;
    scroll-snap-align: center;
    background: var(--bg-card);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    height: 500px;
    /* Taller card */
    position: relative;
    box-shadow: var(--shadow-sm);
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 36px -14px rgba(15, 23, 42, 0.2);
    z-index: 2;
}

.product-icon {
    margin-bottom: 30px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    filter: none;
}

.product-card:hover .product-icon {
    transform: translateY(-2px);
}

.product-card h3 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 15px;
    line-height: 1.3;
    font-weight: 800;
    margin-bottom: 15px;
    line-height: 1.3;
    color: var(--text-main);
}

.product-card p {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: auto;
    /* Pushes button to bottom */
    line-height: 1.6;
}

.btn-details {
    margin-top: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 159, 28, 0.3);
}

.product-card:hover .btn-details {
    opacity: 1;
    transform: translateY(0);
}

.card-blue .btn-details {
    background: #0284C7;
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.3);
}

.card-green .btn-details {
    background: #059669;
    box-shadow: 0 4px 15px rgba(5, 150, 105, 0.3);
}

.card-orange .btn-details {
    background: #EA580C;
    box-shadow: 0 4px 15px rgba(234, 88, 12, 0.3);
}

.card-purple .btn-details {
    background: #7C3AED;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.card-cyan .btn-details {
    background: #0891B2;
    box-shadow: 0 4px 15px rgba(8, 145, 178, 0.3);
}

.card-red .btn-details {
    background: #DC2626;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

/* Card Themes */
.card-blue {
    border-top: 4px solid #3B82F6;
}

.card-green {
    border-top: 4px solid #10B981;
}

.card-purple {
    border-top: 4px solid #8B5CF6;
}

.card-orange {
    border-top: 4px solid #F97316;
}

.card-red {
    border-top: 4px solid #DC2626;
}

/* --- Modal Window --- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(15px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    width: 90%;
    max-width: 900px;
    height: auto;
    max-height: 90vh;
    border-radius: 30px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
}

.modal-backdrop.active .modal-content {
    transform: scale(1) translateY(0);
}

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

.modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

[data-theme="dark"] .modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 60px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

@media (max-width: 768px) {
    .modal-body {
        grid-template-columns: 1fr;
        padding: 40px 20px;
    }
}

.modal-img-wrap {
    width: 100%;
    height: 300px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

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

.modal-info h2 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-info p {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.7;
}

.modal-features {
    list-style: none;
    margin-top: 20px;
}

.modal-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--text-main);
}

.modal-features li::before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #10B981;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
}

@media (max-width: 768px) {
    .btn-details {
        opacity: 1 !important;
        transform: translateY(0) !important;
        margin-top: 20px;
    }

    /* Left align contacts on mobile */
    .contact-info,
    .contact-info h2,
    .contact-info p {
        text-align: left !important;
        align-items: flex-start !important;
    }
}

/* Contact Links */
.ci-link {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}

.ci-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.map-link {
    cursor: pointer;
    color: inherit;
    font-weight: inherit;
    text-decoration: none;
    transition: color 0.3s;
}

.map-link:hover {
    color: var(--primary);
    text-decoration: underline;
}
