/* ========================================================================
   Comment Image Boost CSS (Frontend)
   ======================================================================== */

/* Container do campo de imagem */
.ciboost-comment-form-image {
    position: relative;
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 2px dashed #ddd;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.ciboost-comment-form-image:hover {
    border-color: #999;
    background: #f5f5f5;
}

/* Estado de drag over */
.ciboost-comment-form-image.ciboost-dragenter {
    border-color: #4CAF50;
    background: #e8f5e9;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

/* Label */
.ciboost-comment-form-image label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

.ciboost-comment-form-image label .required {
    color: #d32f2f;
}

/* Input file */
.ciboost-comment-image-input {
    display: block;
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

.ciboost-comment-image-input:hover {
    border-color: #999;
}

.ciboost-comment-image-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

/* Avisos */
.ciboost-image-size-notice {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: #666;
}

/* Área de drop */
.ciboost-drop-area {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(76, 175, 80, 0.95);
    border-radius: 8px;
    pointer-events: none;
    z-index: 10;
}

.ciboost-dragenter .ciboost-drop-area {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ciboost-drop-area-inner {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

/* Container de previews */
.ciboost-previews-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--ciboost-preview-size, 120px), 1fr));
    gap: 12px;
    margin-top: 15px;
}

/* Preview da imagem */
.ciboost-image-preview {
    position: relative;
    display: block;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    aspect-ratio: 1;
    transition: all 0.3s ease;
}

.ciboost-image-preview:hover {
    border-color: #999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ciboost-image-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ciboost-preview-caption {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: calc(100% - 16px);
    min-height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.92);
    color: #1f2937;
    font-size: 12px;
    padding: 7px 9px;
    box-sizing: border-box;
}

.ciboost-remove-image {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.ciboost-remove-image svg {
    width: 16px;
    height: 16px;
}

.ciboost-remove-image:hover {
    background: rgba(211, 47, 47, 0.95);
    transform: scale(1.08);
}

.ciboost-remove-image:active {
    transform: scale(0.95);
}

/* Exibição da imagem no comentário */
.ciboost-comment-image-wrapper {
    position: relative;
    display: inline-block;
    margin: 10px 10px 10px 0;
    text-align: left;
    vertical-align: top;
}

.ciboost-comment-image-link {
    display: inline-block;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s ease;
    aspect-ratio: 1;
}

.ciboost-comment-image-link:hover {
    border-color: #999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.ciboost-comment-image {
    display: block;
    width: 100%;
    height: 100%!important;
    object-fit: cover;
}

.ciboost-comment-image-caption {
    margin: 6px 0 0;
    max-width: 300px;
    color: #4b5563;
    font-size: 13px;
    line-height: 1.4;
}

.ciboost-photo-comment-badge {
    position: absolute;
    left: 8px;
    top: 8px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.82);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    pointer-events: none;
}

.ciboost-global-gallery {
    display: grid;
    grid-template-columns: repeat(var(--ciboost-gallery-columns, 4), minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.ciboost-carousel-wrapper {
    position: relative;
}

.ciboost-global-gallery.ciboost-gallery-layout-carousel {
    display: flex;
    gap: 14px;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

.ciboost-global-gallery.ciboost-gallery-layout-carousel .ciboost-gallery-item {
    flex: 0 0 min(78vw, 280px);
}

.ciboost-carousel-prev,
.ciboost-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.7);
    color: #fff;
    font-size: 22px;
    line-height: 38px;
    text-align: center;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.ciboost-carousel-prev:hover,
.ciboost-carousel-next:hover {
    background: rgba(15, 23, 42, 0.9);
}

.ciboost-carousel-prev:disabled,
.ciboost-carousel-next:disabled {
    opacity: 0.3;
    cursor: default;
}

.ciboost-carousel-prev {
    left: -14px;
}

.ciboost-carousel-next {
    right: -14px;
}

.ciboost-global-gallery .ciboost-gallery-item {
    display: block;
    margin: 0;
}

.ciboost-global-gallery .ciboost-comment-image-link {
    width: 100%;
    max-width: none !important;
}

.ciboost-global-gallery .ciboost-comment-image-caption {
    max-width: none;
}

body.ciboost-lightbox-open {
    overflow: hidden;
}

.ciboost-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 48px 72px;
    background: rgba(15, 23, 42, 0.88);
    box-sizing: border-box;
}

.ciboost-lightbox.is-open {
    display: flex;
}

.ciboost-lightbox-figure {
    margin: 0;
    max-width: min(100%, 1100px);
    max-height: 100%;
    color: #fff;
    text-align: center;
}

.ciboost-lightbox-figure img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 150px);
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
    object-fit: contain;
}

.ciboost-lightbox-figure figcaption {
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.5;
}

.ciboost-lightbox-close,
.ciboost-lightbox-prev,
.ciboost-lightbox-next {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 400;
    line-height: 1;
    text-align: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.ciboost-lightbox-close:hover,
.ciboost-lightbox-prev:hover,
.ciboost-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.22);
}

.ciboost-lightbox-close {
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    font-size: 30px;
}

.ciboost-lightbox-prev,
.ciboost-lightbox-next {
    top: 50%;
    width: 46px;
    height: 64px;
    font-size: 44px;
    transform: translateY(-50%);
}

.ciboost-lightbox-prev {
    left: 18px;
}

.ciboost-lightbox-next {
    right: 18px;
}

/* Galeria de múltiplas imagens */
.ciboost-comment-images-gallery {
    margin: 15px 0;
}

/* Layout: Vertical (1 por linha) */
.ciboost-comment-images-gallery.ciboost-layout-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ciboost-comment-images-gallery.ciboost-layout-vertical .ciboost-comment-image-wrapper {
    margin: 0;
    display: block;
    width: 100%;
}

/* Layout: Horizontal (grid 4 colunas) */
.ciboost-comment-images-gallery.ciboost-layout-horizontal {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.ciboost-comment-images-gallery.ciboost-layout-horizontal .ciboost-comment-image-wrapper {
    margin: 0;
}

/* Responsivo */
@media (max-width: 768px) {
    .ciboost-comment-form-image {
        padding: 15px;
    }

    .ciboost-drop-area-inner {
        font-size: 16px;
    }

    .ciboost-image-preview img {
        max-width: 100%;
        max-height: 200px;
    }

    /* Ajuste horizontal para mobile - mantém 2 colunas */
    .ciboost-comment-images-gallery.ciboost-layout-horizontal {
        grid-template-columns: repeat(2, 1fr);
    }

    .ciboost-global-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ciboost-lightbox {
        padding: 42px 16px;
    }

    .ciboost-lightbox-prev,
    .ciboost-lightbox-next {
        width: 38px;
        height: 52px;
        font-size: 34px;
    }
}

/* ========================================================================
   Comment Image Boost Admin CSS
   ======================================================================== */

/* Container de imagens no admin */
.ciboost-admin-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #dcdcde;
}

/* Link da imagem no admin */
.ciboost-admin-image-link {
    display: block;
    border: 2px solid #dcdcde;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.2s ease;
    width: 60px;
    height: 60px;
}

.ciboost-admin-image-link.ciboost-status-pending {
    border-color: #dba617;
}

.ciboost-admin-image-link.ciboost-status-rejected {
    border-color: #b32d2e;
    opacity: 0.5;
}


.ciboost-admin-image-link:hover {
    border-color: #2271b1;
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.2);
    transform: scale(1.05);
}

.ciboost-admin-image-link:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: 2px solid transparent;
}

/* Imagem no admin */
.ciboost-admin-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsivo para telas menores */
@media (max-width: 782px) {
    .ciboost-admin-image-link {
        width: 50px;
        height: 50px;
    }

    .ciboost-admin-images {
        gap: 6px;
    }
}

