main {
    background: url('../assets/images/imgs_web/backgrounds/background_projects.png') no-repeat center center fixed;
    background-size: cover;
    width: 100%;
    display: flex !important;
    flex-direction: column;
    grid-template-rows: none !important;
}

.projects-container {
    width: 100%;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 2rem);
}

.hero-content {
    padding: clamp(1rem, 4vw, 2rem) 0;
    /*text-align: center;*/
}

.hero-content h1 {
    font-family: 'Raleway', sans-serif;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    color: #0388a6;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero-content p {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    font-weight: 400;
    color: #01303a;
    line-height: 1.6;
    margin: 0 auto;
}

/* Desktop mode: limit description width to 50% */
@media (min-width: 1024px) {
    .hero-content p {
        max-width: 50%;
        margin: 0;
    }
}

.projects-cards {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(1.5rem, 4vw, 2rem);
    margin: clamp(1.5rem, 4vw, 2rem) 0;
}

.project-card {
    background: #ffffff;
    border-radius: clamp(16px, 4vw, 24px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: clamp(1.5rem, 4vw, 4rem);
    display: flex;
    align-items: flex-start;
    gap: clamp(1.5rem, 4vw, 4rem);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    width: 100%;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.project-image {
    flex-shrink: 0;
    width: clamp(200px, 25vw, 250px);
    height: clamp(280px, 35vw, 355px);
    border-radius: 16px;
    margin: 0;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}

.project-image .default-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.4s ease;
    opacity: 1;
    z-index: 1;
}

.project-card.expanded .default-image {
    opacity: 0;
    pointer-events: none;
}

.carousel {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 2;
}

.project-card.expanded .carousel {
    opacity: 1;
}

.carousel-container {
    display: flex;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
}

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

.project-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.project-header h3 {
    font-family: 'Raleway', sans-serif;
    font-size: clamp(1.5rem, 4vw, 2.75rem);
    font-weight: 700;
    color: #0388a6;
    margin: 0;
    line-height: 1.3;
    flex: 1;
}

.toggle-button {
    background-color: #fbf4e6;
    border: none;
    border-radius: 50%;
    width: clamp(48px, 12vw, 64px);
    height: clamp(48px, 12vw, 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #0388a6;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 4px;
    padding: 0;
}

.toggle-button:hover {
    background: #0388a6;
    color: white;
    transform: scale(1.1);
}

.toggle-button svg {
    transition: transform 0.3s ease;
    width: clamp(20px, 5vw, 24px);
    height: clamp(20px, 5vw, 24px);
}

.project-description {
    position: relative;
}

.project-description .short-description {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1rem, 2.5vw, 1.75rem);
    font-weight: 600;
    color: #01303a;
    line-height: 1.6;
    text-align: justify;
    margin: 0;
    opacity: 1;
    max-height: 500px;
    transition: opacity 0.3s ease-out, max-height 0.5s ease-out;
}

.project-description .long-description {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1rem, 2.5vw, 1.75rem);
    font-weight: 600;
    color: #01303a;
    line-height: 1.6;
    text-align: justify;
    margin: 0;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.5s ease-in, max-height 0.5s ease-in;
}

.project-card.expanded .project-description .short-description {
    opacity: 0;
    max-height: 0;
    pointer-events: none;
}

.project-card.expanded .project-description .long-description {
    opacity: 1;
    max-height: 800px;
}

.carousel-controls {
    position: absolute;
    bottom: clamp(0.5rem, 2vw, 1rem);
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    z-index: 2;
}

.carousel-dot {
    width: clamp(6px, 2vw, 8px);
    height: clamp(6px, 2vw, 8px);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s ease;
    border: none;
}

.carousel-dot.active {
    background: white;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: clamp(32px, 8vw, 40px);
    height: clamp(32px, 8vw, 40px);
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: all 0.3s ease;
}

.carousel-arrow:hover {
    background: white;
}

.carousel-arrow.prev {
    left: clamp(0.5rem, 2vw, 1rem);
}

.carousel-arrow.next {
    right: clamp(0.5rem, 2vw, 1rem);
}

.carousel-arrow svg {
    width: clamp(16px, 4vw, 20px);
    height: clamp(16px, 4vw, 20px);
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.project-features {
    margin-top: 1rem;
    padding-left: 1.5rem;
}

.project-features li {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    color: #01303a;
    margin-bottom: 0.5rem;
    position: relative;
    line-height: 1.5;
}

.project-features li::before {
    content: "•";
    position: absolute;
    left: -1.5rem;
    color: #0388a6;
}

/* Dark mode styles for projects */
body.dark-mode .project-card {
    background: #1e1e1e;
}

body.dark-mode .project-header h3 {
    color: #4db6cd;
}

body.dark-mode .project-description p {
    color: #e0e0e0;
}

body.dark-mode .toggle-button {
    background: #2a2a2a;
    color: #4db6cd;
}

body.dark-mode .toggle-button:hover {
    background: #4db6cd;
    color: #1e1e1e;
}

/* Responsive styles for projects */
@media (max-width: 1024px) {
    .project-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: clamp(1rem, 3vw, 2rem);
    }

    .project-image {
        width: 100%;
        max-width: 400px;
        height: clamp(250px, 30vw, 300px);
        align-self: center;
    }

    .project-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .toggle-button {
        margin-top: 1rem;
    }

    .project-description .short-description,
    .project-description .long-description {
        text-align: center;
    }

    .project-features {
        text-align: left;
        max-width: 600px;
        margin: 1rem auto 0;
    }
}

@media (max-width: 768px) {
    .projects-container {
        padding: 0 0.5rem;
    }

    .project-card {
        padding: clamp(1rem, 4vw, 2rem);
        gap: 1.5rem;
    }

    .project-image {
        height: 250px;
        max-width: 100%;
    }

    .project-header h3 {
        font-size: clamp(1.3rem, 5vw, 2rem);
    }

    .project-description .short-description,
    .project-description .long-description {
        font-size: clamp(0.9rem, 3vw, 1.2rem);
    }

    .project-features {
        padding-left: 1rem;
    }

    .project-features li {
        font-size: clamp(0.8rem, 3vw, 1rem);
    }

    .project-features li::before {
        left: -1rem;
    }
}

@media (max-width: 480px) {
    .project-card {
        padding: 1rem;
        gap: 1rem;
        margin: 0 0.5rem;
    }

    .project-image {
        height: 200px;
    }

    .hero-content {
        padding: 1rem 0;
    }

    .projects-container {
        padding: 0 0.5rem;
    }

    .toggle-button {
        width: 40px;
        height: 40px;
    }

    .toggle-button svg {
        width: 16px;
        height: 16px;
    }

    .carousel-arrow {
        width: 28px;
        height: 28px;
    }

    .carousel-arrow svg {
        width: 14px;
        height: 14px;
    }
}