/* Estilos para el carrusel de imágenes de proyectos */

.project-image-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.project-carousel {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-images {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: 12px;
}

.carousel-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    z-index: 1;
}

.carousel-image.active {
    opacity: 1;
    z-index: 2;
}

.carousel-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.carousel-image:hover img {
    transform: scale(1.05);
}

/* Indicadores del carrusel */
.carousel-indicators {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.carousel-indicators .indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-indicators .indicator.active {
    background: #007bff;
    transform: scale(1.2);
}

.carousel-indicators .indicator:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* Navegación del carrusel */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
    font-size: 16px;
}

.project-carousel:hover .carousel-nav {
    opacity: 1;
}

.carousel-nav:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav.prev {
    left: 10px;
}

.carousel-nav.next {
    right: 10px;
}

/* Contador de imágenes */
.image-counter {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    z-index: 10;
}

/* Responsive */
@media (max-width: 768px) {
    .carousel-images {
        height: 200px;
    }
    
    .carousel-nav {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .carousel-nav.prev {
        left: 5px;
    }
    
    .carousel-nav.next {
        right: 5px;
    }
    
    .carousel-indicators {
        bottom: 10px;
    }
    
    .carousel-indicators .indicator {
        width: 6px;
        height: 6px;
    }
}

/* Animación de carga */
.carousel-image img {
    opacity: 0;
    animation: fadeInImage 0.5s ease-in-out forwards;
}

@keyframes fadeInImage {
    to {
        opacity: 1;
    }
}

/* Efecto hover en el proyecto completo */
.project-item:hover .carousel-nav {
    opacity: 1;
}

/* Indicador visual de múltiples imágenes */
.project-item .ri-image-line {
    color: #007bff;
}

/* Auto-play indicator */
.carousel-autoplay-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 123, 255, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 500;
    z-index: 10;
    display: none;
}

.project-carousel[data-autoplay="true"] .carousel-autoplay-indicator {
    display: block;
}

/* ========================================
   ESTILOS PARA WORK-SINGLE CAROUSEL
   ======================================== */

.work-single-carousel {
    position: relative;
    width: 100%;
    margin-bottom: 2rem;
}

.work-single-carousel .carousel-images {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    border-radius: 12px;
}

.work-single-carousel .carousel-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.work-single-carousel .carousel-image.active {
    opacity: 1;
}

.work-single-carousel .carousel-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

/* Navegación para work-single */
.work-single-carousel .carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.work-single-carousel .carousel-nav:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.work-single-carousel .carousel-nav.prev {
    left: 20px;
}

.work-single-carousel .carousel-nav.next {
    right: 20px;
}

/* Indicadores para work-single */
.work-single-carousel .carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.work-single-carousel .indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.7);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.work-single-carousel .indicator.active,
.work-single-carousel .indicator:hover {
    background: white;
    border-color: white;
}

/* Contador de imágenes */
.work-single-carousel .image-counter {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10;
}

/* Responsive para work-single */

/* Pantallas grandes (Desktop) */
@media (min-width: 1200px) {
    .work-single-carousel .carousel-images {
        height: 600px;
    }
}

/* Pantallas medianas (Tablet landscape) */
@media (max-width: 1199px) and (min-width: 992px) {
    .work-single-carousel .carousel-images {
        height: 450px;
    }
}

/* Pantallas pequeñas (Tablet portrait) */
@media (max-width: 991px) and (min-width: 769px) {
    .work-single-carousel .carousel-images {
        height: 400px;
    }
}

/* Móviles */
@media (max-width: 768px) {
    .work-single-carousel .carousel-images {
        height: 280px;
    }
    
    .work-single-carousel .carousel-nav {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .work-single-carousel .carousel-nav.prev {
        left: 10px;
    }
    
    .work-single-carousel .carousel-nav.next {
        right: 10px;
    }
    
    .work-single-carousel .image-counter {
        top: 10px;
        right: 10px;
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .work-single-carousel .carousel-images {
        height: 250px;
    }
}

/* ========================================
   ESTILOS PARA CONTENIDO DE PROYECTOS
   ======================================== */

.project-content {
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.project-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.project-content br {
    line-height: 1.5;
    display: block !important;
    content: "";
    margin-bottom: 0.5em;
}

/* Estilos específicos para la descripción del proyecto */
.project-description {
    text-align: justify;
    text-justify: inter-word;
    white-space: pre-line; /* Preserva saltos de línea y espacios */
}

/* Mejorar espaciado de emojis */
.project-description {
    font-feature-settings: "liga" 1, "kern" 1;
}

.project-description br + * {
    margin-top: 0.5em;
}

/* Desktop - mantener formato cuando hay sidebar */
@media (min-width: 992px) {
    .project-description {
        max-width: 100%;
        padding-right: 2rem;
    }
}

/* Controlar ancho del contenido en diferentes breakpoints */
@media (max-width: 991px) and (min-width: 769px) {
    /* Tablet - mantener un ancho controlado */
    .project-content {
        max-width: 85%;
        line-height: 1.7;
    }
    
    .project-content p {
        margin-bottom: 1.1rem;
        line-height: 1.7;
        text-align: justify;
    }
    
    .project-description {
        max-width: 80%;
        margin: 0 auto;
    }
}

/* Mejorar legibilidad en móviles */
@media (max-width: 768px) {
    .project-content {
        line-height: 1.8;
        font-size: 16px;
        max-width: 100%;
    }
    
    .project-content p {
        margin-bottom: 1.2rem;
        line-height: 1.8;
        text-align: justify;
        hyphens: auto;
        -webkit-hyphens: auto;
        -ms-hyphens: auto;
    }
    
    .project-content br {
        line-height: 1.6;
        display: block !important;
        margin-bottom: 0.8em;
    }
    
    .project-description {
        white-space: pre-line !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* Móviles medianos - controlar ancho para mejor legibilidad */
@media (max-width: 768px) and (min-width: 481px) {
    .project-content {
        max-width: 95%;
        margin: 0 auto;
    }
    
    .project-description {
        max-width: 90%;
        margin: 0 auto;
    }
}

/* Móviles pequeños - ancho completo pero con padding */
@media (max-width: 480px) {
    .project-content {
        max-width: 100%;
        padding: 0 10px;
    }
}

/* Estilos para tarjetas de proyecto en la lista */
.project-card-content p {
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@media (max-width: 768px) {
    .project-card-content p {
        line-height: 1.7;
        font-size: 14px;
        text-align: left;
        hyphens: auto;
        -webkit-hyphens: auto;
        -ms-hyphens: auto;
    }
}
