/* FORMULARIOS */
.slim-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.slim-form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.slim-1col-form {
    display: flex;
    gap: 15px;
    flex-direction: column;
}

.slim-form-row.full-row {
    grid-template-columns: repeat(1, 1fr);}

.slim-row-group {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.checkbox-group {
    display: flex;
    flex-direction: row-reverse;
    gap: 1em;
}

.row-action {
    display: flex;
    padding-top: 2px;
}

.row-action input {
    height: 18px;
    width: 18px;
}

.slim-row-group > .slim-inner-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.slim-row-group.align-right {
    align-items: flex-end;
}

.slim-2col-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.dropzone-container {
    align-items: center;
    min-height: 100px;
    padding: 20px 10px;
    display: flex;
    position: relative;
    border: 2px dashed var(--slim-main-dark-trans);
    border-radius: 5px;
    background-color: var(--slim-gray);
    margin: 4px 0;
}

.dropzone-input {
    opacity: 0;
    cursor: pointer;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

.dropzone-placeholder {
    text-align: center;
    color: var(--slim-main-dark-trans);
    flex-grow: 1;
}

.dropzone-preview {
    align-items: center;
    max-width: 100%;
    display: flex;
}

.dropzone-preview-button {
    z-index: 1;
    width: auto;
    color: inherit;
    font: inherit;
    -webkit-font-smoothing: inherit;
    -moz-osx-font-smoothing: inherit;
    -webkit-appearance: none;
    background: 0 0;
    border: none;
    margin: 0;
    padding: 0;
    line-height: normal;
    position: absolute;
    top: 0;
    right: 0;
    overflow: visible;
}

.dropzone-preview-button::before {
    content: '×';
    padding: 3px 7px;
    cursor: pointer;
}

.dropzone-preview-image {
    background-position: 50%;
    background-repeat: no-repeat;
    background-size: contain;
    flex-basis: 0;
    min-width: 50px;
    max-width: 50px;
    height: 50px;
    margin-right: 10px;
}

.slim-form-row.slim-form-action-buttons {
    display: flex;
    flex-direction: row;
    justify-content: center;
    margin-top: 15px;
}

.quill-small .ql-editor {
    height: fit-content;
    min-height: fit-content;
}

.ql-toolbar.ql-snow {
    margin-top: 4px;
    border: 1px solid var(--slim-main-dark-trans);
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}

.ql-container.ql-snow {
    border: 1px solid var(--slim-main-dark-trans);
    border-top: 0;
}

.ql-container.ql-snow.is-invalid {
    border: 1px solid var(--slim-alert-button);
}

.ql-editor {
    height: 350px;
    max-width: 100%;
    min-height: 150px;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: #EEEEEE;
    padding: 12px;
    width: 100%;
    word-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
}

.slim-form-row.slim-button-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.dropzone {
    background-color: var(--slim-gray);
    border-radius: 5px;
    border: 2px dashed var(--slim-main-dark-trans);
    min-height: 75%;
    margin: 5px 0;
}

.dropzone .dz-preview.dz-image-preview {
    background-color: var(--slim-gray);
}

.dropzone .dz-message .dz-button {
    color: var(--slim-main-dark-trans);
}

.dz-progress {
    display: none !important;
}

.dropzone .dz-preview .dz-remove {
    position: absolute;
    top: 10px;
    z-index: 33;
    right: 10px;
    background-color: var(--danger);
    font-size: 14px;
    font-weight: bold;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.dropzone.dz-clickable * {
    cursor: zoom-in;
}

.dropzone .dz-preview .dz-remove span {
    font-size: 1.2em;
    color: white;
    font-weight: 600;
    cursor: pointer;
    margin-top: 3px;
}

.dropzone .dz-preview .dz-remove:hover {
    background-color: var(--slim-alert-button);;
    text-decoration: none;
}

.dropzone-container.is-invalid {
    border: 2px dashed var(--slim-alert-button);
}

.slim-form-preview {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.slim-form-preview ol, .slim-form-preview ul {
    list-style-position: inside;
    padding-left: 30px;
}

.preview-footer {
    display: flex;
    justify-content: flex-end;
}

/* PANEL DE PREVISUALIZACIÓN DE IMÁGENES INTERACTIVO */

.main-image-container {
    position: relative;
    width: 100%;
    height: 400px;
    background: #e9ecef;
    border: 2px dashed #adb5bd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.main-image-placeholder {
    text-align: center;
    color: #6c757d;
}

.main-image-placeholder i {
    font-size: 48px;
    margin-bottom: 10px;
    display: block;
}

/* Segunda fila - Galería */

.gallery-title {
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: 600;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 15px;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 24px;
}

.gallery-item .hover-icon {
    position: absolute;
    top: 8px;
    right: 8px;
}

/* Botón de eliminar */
.delete-btn {

    width: 28px;
    height: 28px;
    background: var(--slim-alert-button);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s ease;
    opacity: 0;
    transform: scale(0.8);
}

.gallery-item:hover .delete-btn {
    opacity: 1;
    transform: scale(1);
}

.delete-btn:hover {
    background: #6e1010;
    transform: scale(1.1);
}

/* Botón para añadir imágenes */
.add-image-btn {
    background: #007bff;
    color: white;
    border: 2px dashed #007bff;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    font-size: 14px;
    transition: all 0.2s ease;
    aspect-ratio: 1;
}

.add-image-btn:hover {
    background: #0056b3;
    border-color: #0056b3;
    transform: translateY(-2px);
}

.add-image-btn i {
    font-size: 24px;
    margin-bottom: 5px;
}

/* Input file oculto */
.file-input {
    display: none;
}

.preview-body {
    background-color: var(--slim-gray);
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.translations-preview .preview-body {
    background-color: transparent;
    box-shadow: none;
}


.slim-card.translation-card {
    background: var(--slim-gray);
    box-shadow: none;
}

.slim-card.translation-card .slim-card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* URL GRID */

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.link-preview-item {
    position: relative;
    background: #f2f2f2;
    border: 1px solid #ddd;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0.5rem;
    text-align: center;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.link-preview-item p {
    margin: 0.25rem 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-preview-item p:nth-child(2) {
    font-size: 0.8rem;
    opacity: 0.75;
}

.link-preview-item:hover {
    background: #e9e9e9;
    border-color: var(--slim-main-dark-trans);
}

.link-preview-item.add-new {
    background: #fff;
    border: 2px dashed var(--slim-main-dark-trans);
    font-size: 2rem;
    font-weight: bold;
    color: #999;
}

.link-preview-item.add-new:hover {
    border-color: #666;
    color: #666;
}

.link-preview-item .link-remove-btn {
    text-decoration: none;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 33;

    color: #fff;
    background-color: var(--danger);

    font-size: 14px;
    font-weight: bold;

    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: background-color 0.2s ease, transform 0.1s ease;
}

.link-preview-item .link-remove-btn span {
    font-size: 1.2em;
    color: white;
    font-weight: 600;
}

.link-preview-item .link-remove-btn:hover {
    background-color: var(--slim-alert-button);;
}

.u-form div:last-of-type {
    display: flex;
    justify-content: flex-end;
}

/* Responsive */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .panel {
        margin: 10px;
    }

    .main-image-section,
    .gallery-section {
        padding: 20px;
    }

    .main-image-container {
        height: 250px;
    }
}

@media screen and (max-width: 850px) {
    .slim-form-row {
        grid-template-columns: unset;
        grid-template-rows: auto;
    }
}