/* ================================
   EC Instagram Feed – FRONTEND CSS
   Premium – Estúdio Criar
================================ */

/* -------------------------------
   HEADER DO PERFIL
-------------------------------- */
.ec-instagram-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    margin-bottom: 20px;
    background: transparent;
}

.ec-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ec-profile-picture {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    padding: 3px;
    flex-shrink: 0;
}

.ec-profile-picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #fff;
}

.ec-profile-picture.ec-profile-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.ec-profile-placeholder svg {
    width: 32px;
    height: 32px;
}

.ec-profile-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ec-username {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #262626;
}

.ec-stats {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: #8e8e8e;
}

.ec-stat strong {
    color: #262626;
    font-weight: 600;
}

.ec-header-right {
    flex-shrink: 0;
}

.ec-follow-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: #0095f6;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s;
}

.ec-follow-button:hover {
    background: #1877f2;
    color: #fff;
}

.ec-follow-button svg {
    width: 16px;
    height: 16px;
}

/* Header responsivo */
@media (max-width: 600px) {
    .ec-instagram-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        padding: 16px;
    }
    
    .ec-header-left {
        flex-direction: column;
        gap: 12px;
    }
    
    .ec-stats {
        justify-content: center;
    }
    
    .ec-profile-picture {
        width: 80px;
        height: 80px;
    }
}

/* Layout geral */
.ec-instagram-feed {
    width: 100%;
    display: block;
    position: relative;
    box-sizing: border-box;
}

/* Mensagem de erro */
.ecif-error {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 15px;
    border-radius: 5px;
    font-size: 14px;
}

.ecif-error a {
    color: #533f03;
    text-decoration: underline;
}

/* -------------------------------
   GRID
-------------------------------- */
.ec-instagram-feed.ec-grid {
    display: grid;
    grid-template-columns: repeat(var(--ec-columns, 3), 1fr);
    gap: var(--ec-gap, 10px);
}

.ec-instagram-feed.ec-grid .ec-item {
    display: block;
    overflow: hidden;
    border-radius: var(--ec-radius, 8px);
    position: relative;
    aspect-ratio: 4/5; /* Proporção do Instagram (retrato) */
}

.ec-instagram-feed.ec-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: var(--ec-radius, 8px);
    transition: transform .4s ease, opacity .3s;
}

/* Ícones de tipo de mídia */
.ec-media-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 4px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.ec-media-icon svg {
    width: 18px;
    height: 18px;
}

/* Overlay de hover */
.ec-hover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background .3s ease;
    pointer-events: none;
    border-radius: var(--ec-radius, 8px);
}

/* Hover: zoom */
.ec-item.ec-hover-zoom:hover img {
    transform: scale(1.08);
}

/* Hover: dark */
.ec-item.ec-hover-dark:hover .ec-hover-overlay {
    background: rgba(0, 0, 0, 0.35);
}

/* Hover: ícone */
.ec-icon-overlay {
    position: absolute;
    inset: 0;
    opacity: 0;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .3s;
    background: rgba(0, 0, 0, 0.4);
    border-radius: var(--ec-radius, 8px);
    z-index: 10;
}

.ec-icon-overlay svg {
    width: 32px;
    height: 32px;
}

.ec-item.ec-hover-icon:hover .ec-icon-overlay {
    opacity: 1;
}

/* -------------------------------
   MASONRY
-------------------------------- */
.ec-instagram-feed.ec-masonry {
    column-count: var(--ec-columns, 3);
    column-gap: var(--ec-gap, 10px);
}

.ec-instagram-feed.ec-masonry .ec-masonry-item {
    break-inside: avoid;
    margin-bottom: var(--ec-gap, 10px);
}

.ec-instagram-feed.ec-masonry img {
    width: 100%;
    border-radius: var(--ec-radius, 8px);
    display: block;
    transition: transform .4s ease;
}

/* Hover nos masonry */
.ec-masonry-item a:hover img {
    transform: scale(1.05);
}

/* -------------------------------
   SLIDER
-------------------------------- */
.ec-slider-wrapper {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.ec-slider-container {
    display: flex;
    gap: var(--ec-gap, 10px);
    transition: transform .45s ease;
}

.ec-slide {
    flex: 0 0 auto;
    width: calc((100% - var(--ec-gap, 10px) * (var(--ec-columns, 3) - 1)) / var(--ec-columns, 3));
    position: relative;
    overflow: hidden;
    border-radius: var(--ec-radius, 8px);
}

.ec-slide a {
    display: block;
    position: relative;
}

.ec-slide img {
    width: 100%;
    aspect-ratio: 4/5;
    object-fit: cover;
    display: block;
    border-radius: var(--ec-radius, 8px);
    transition: transform .4s ease, opacity .3s;
}

/* Overlay de hover no slider */
.ec-slide .ec-hover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background .3s ease;
    pointer-events: none;
    border-radius: var(--ec-radius, 8px);
}

/* Hover: zoom no slider */
.ec-slide.ec-hover-zoom:hover img {
    transform: scale(1.08);
}

/* Hover: dark no slider */
.ec-slide.ec-hover-dark:hover .ec-hover-overlay {
    background: rgba(0, 0, 0, 0.35);
}

/* Hover: icon no slider */
.ec-slide.ec-hover-icon .ec-hover-icon-svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform .3s, opacity .3s;
    pointer-events: none;
    z-index: 10;
}

.ec-slide.ec-hover-icon:hover .ec-hover-icon-svg {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* Ícones de tipo de mídia no slider */
.ec-slide .ec-media-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 4px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.ec-slide .ec-media-icon svg {
    width: 18px;
    height: 18px;
}

.ec-slider-prev,
.ec-slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: none;
    font-size: 24px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    border-radius: 50%;
    opacity: .85;
    transition: opacity .3s;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.ec-slider-prev:hover,
.ec-slider-next:hover {
    opacity: 1;
}

.ec-slider-prev {
    left: 10px;
}

.ec-slider-next {
    right: 10px;
}

/* -------------------------------
   STORIES
-------------------------------- */
.ec-stories {
    display: flex;
    gap: var(--ec-gap, 10px);
    overflow-x: auto;
    padding-bottom: 5px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.ec-stories::-webkit-scrollbar {
    display: none;
}

.ec-story-item {
    display: block;
    flex: 0 0 auto;
}

.ec-story-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid transparent;
    overflow: hidden;
    box-sizing: border-box;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    padding: 3px;
}

.ec-story-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: transform .3s ease;
}

.ec-story-image:hover img {
    transform: scale(1.08);
}

/* -------------------------------
   RESPONSIVO
-------------------------------- */

@media (max-width: 992px) {
    .ec-instagram-feed.ec-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .ec-instagram-feed.ec-masonry {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .ec-instagram-feed.ec-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ec-instagram-feed.ec-masonry {
        column-count: 2;
    }
    
    .ec-slide {
        width: calc((100% - var(--ec-gap, 10px)) / 2);
    }
}

@media (max-width: 480px) {
    .ec-instagram-feed.ec-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }
    
    .ec-instagram-feed.ec-masonry {
        column-count: 2;
        column-gap: 5px;
    }
}
