/* Golank Preview System - Minimal CSS (Respeta CSS de la página) */

/* CONTENEDOR PRINCIPAL - Sin interferencia de estilos */
.golank-preview-inline {
    width: 100%;
    height: 100%;
    position: relative;
}

/* PREVIEW: contenedor con altura dinámica (la ajusta el JS según el scale) */
.golank-preview-display-fullwidth {
    width: 100%;
    background: transparent;
    overflow: hidden;
    position: relative;
    /* Necesario para que los iframes inactivos (position:absolute) no escapen */
}

/* IFRAME - Ancho fijo desktop. El JS aplica transform:scale() para ajustarlo al contenedor */
.golank-preview-iframe {
    width: 1280px;
    height: 900px;
    border: none;
    display: block;
    transform-origin: top left;
    margin: 0;
    padding: 0;
}

/* ===== MODAL PARA TEXTO ===== */
.golank-editor-modal {
    position: fixed;
    z-index: 10000;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 20px;
    min-width: 320px;
    max-width: 500px;
    animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.golank-editor-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.golank-editor-label {
    font-size: 12px;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
}

.golank-editor-input {
    padding: 10px 12px;
    border: 2px solid #5865f2;
    border-radius: 6px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    transition: all 0.2s ease;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.golank-editor-input:focus {
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.1);
    background: rgba(88, 101, 242, 0.02);
}

.golank-editor-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.golank-editor-btn {
    padding: 8px 14px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.golank-editor-btn-accept {
    background: #5865f2;
    color: white;
}

.golank-editor-btn-accept:hover {
    background: #4752c4;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.3);
}

.golank-editor-btn-cancel {
    background: #f0f0f0;
    color: #333;
}

.golank-editor-btn-cancel:hover {
    background: #e0e0e0;
}

/* ===== MODAL PARA UPLOAD DE IMÁGENES ===== */
.golank-image-upload-modal {
    position: fixed;
    z-index: 10000;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 20px;
    min-width: 340px;
    max-width: 500px;
    animation: slideIn 0.2s ease-out;
}

.golank-upload-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.golank-upload-label {
    font-size: 12px;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.golank-upload-zone {
    border: 2px dashed #5865f2;
    border-radius: 6px;
    padding: 30px;
    text-align: center;
    background: rgba(88, 101, 242, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

.golank-upload-zone:hover {
    background: rgba(88, 101, 242, 0.1);
    border-color: #4752c4;
}

.golank-upload-zone input[type="file"] {
    display: none;
}

.golank-upload-zone p {
    margin: 0;
    color: #666;
    font-size: 13px;
    line-height: 1.5;
}

.golank-upload-zone p strong {
    color: #5865f2;
    display: block;
    margin-bottom: 5px;
}

.golank-upload-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.golank-upload-btn {
    padding: 8px 14px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.golank-upload-btn-accept {
    background: #5865f2;
    color: white;
}

.golank-upload-btn-accept:hover:not(:disabled) {
    background: #4752c4;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.3);
}

.golank-upload-btn-accept:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.golank-upload-btn-cancel {
    background: #f0f0f0;
    color: #333;
}

.golank-upload-btn-cancel:hover {
    background: #e0e0e0;
}

.golank-file-preview {
    margin-top: 10px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
}

.golank-file-preview img {
    max-width: 100%;
    max-height: 150px;
    border-radius: 4px;
    margin-bottom: 8px;
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .golank-preview-display-fullwidth {
        height: 100vh;
    }

    .golank-editor-modal,
    .golank-image-upload-modal {
        min-width: auto;
        max-width: 90vw;
        left: 5vw !important;
        right: 5vw !important;
    }
}

/* ===== MODAL DE ICONOS ===== */
.golank-icon-modal {
    position: fixed;
    z-index: 10001;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(680px, 92vw);
    max-height: min(76vh, 680px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 16px 60px rgba(0,0,0,0.35);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.golank-icon-modal-content {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}
.golank-icon-modal-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}
.golank-icon-modal-title {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    white-space: nowrap;
}
.golank-icon-search {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
}
.golank-icon-search:focus {
    border-color: #06B6D4;
    box-shadow: 0 0 0 3px rgba(6,182,212,0.12);
}
.golank-icon-close {
    background: transparent;
    border: none;
    font-size: 18px;
    color: #888;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    line-height: 1;
}
.golank-icon-close:hover {
    background: #f1f5f9;
    color: #1a1a2e;
}
.golank-icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
    gap: 10px;
    padding: 16px;
    overflow-y: auto;
}
.golank-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 6px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
    font-family: inherit;
}
.golank-icon-item:hover {
    border-color: #06B6D4;
    box-shadow: 0 4px 16px rgba(6,182,212,0.16);
    transform: translateY(-2px);
}
.golank-icon-item svg {
    width: 24px;
    height: 24px;
    fill: #0F172A;
}
.golank-icon-item span {
    font-size: 10px;
    color: #64748B;
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
}

/* ===== BARRA DE ENVÍO ===== */
.golank-submit-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #1e1e2e;
    border-top: 2px solid #5865f2;
    gap: 20px;
}

.golank-submit-info {
    color: #aaa;
    font-size: 13px;
}

.golank-submit-btn {
    position: relative;
    background: #5865f2;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    white-space: nowrap;
}

.golank-submit-btn:hover:not(:disabled) {
    background: #4752c4;
}

.golank-submit-btn:disabled {
    cursor: not-allowed;
}

.golank-submit-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    background: #e74c3c;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ===== TABS DE PÁGINAS (multi-página) ===== */
.golank-page-tabs {
    display: flex;
    background: #16162a;
    border-bottom: 2px solid #5865f2;
    padding: 0 16px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.golank-page-tab {
    padding: 10px 22px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    color: #aaa;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    white-space: nowrap;
    font-family: inherit;
    letter-spacing: 0.3px;
    text-decoration: none;
    display: inline-block;
    line-height: 1.4;
}

.golank-page-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.golank-page-tab.active {
    color: #fff;
    border-bottom-color: #5865f2;
    background: rgba(88, 101, 242, 0.12);
}

/* ===== LAYOUT CON PANEL DE COLORES + BURBUJA DE ANIMACIONES ===== */
.golank-preview-inline {
    display: block;
    position: relative;
}

.golank-preview-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Pila lateral fija (paleta arriba, animaciones abajo) */
.golank-side-stack {
    position: fixed;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    pointer-events: none;
}
.golank-side-stack > * {
    pointer-events: auto;
}

/* ===== PANEL DE COLORES ===== */
.golank-color-panel {
    position: relative;
    width: 246px;
    max-height: min(560px, 60vh);

    /* Frosted glass */
    background: rgba(10, 14, 26, 0.82);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.11);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.45), 0 0 0 1px rgba(6,182,212,0.09);

    display: flex !important;
    flex-direction: column;
    overflow: hidden;

    transition: opacity 0.25s ease, max-height 0.25s ease;
}

/* Panel colapsado */
.golank-color-panel.golank-cp-collapsed {
    overflow: visible;
    max-height: 44px;
}
.golank-color-panel.golank-cp-collapsed .golank-cp-slots { display: none; }

.golank-cp-header {
    padding: 12px 14px 11px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
    background: transparent;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}
.golank-cp-header:hover { color: rgba(255,255,255,0.85); }
/* Icono toggle */
.golank-cp-header::after {
    content: '⊟';
    font-size: 14px;
    opacity: 0.4;
    transition: transform 0.2s;
}
.golank-color-panel.golank-cp-collapsed .golank-cp-header::after { content: '⊞'; transform: none; }

.golank-cp-slots {
    padding: 10px 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    max-height: calc(60vh - 46px);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.28) rgba(255,255,255,0.04);
    position: relative;
}

/* Scrollbar para Chrome/Safari */
.golank-cp-slots::-webkit-scrollbar { width: 5px; }
.golank-cp-slots::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); border-radius: 3px; }
.golank-cp-slots::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.28); border-radius: 3px; }
.golank-cp-slots::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.45); }

/* ===== BURBUJA DE ANIMACIONES (burbuja propia debajo de la paleta) ===== */
.golank-anim-panel {
    width: 246px;
    background: rgba(10, 14, 26, 0.82);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.11);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.45), 0 0 0 1px rgba(6,182,212,0.09);
    overflow: hidden;
}

.golank-anim-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
}
.golank-anim-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
    flex: 1;
}
.golank-anim-state {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #06B6D4;
    min-width: 30px;
    text-align: right;
}
.golank-anim-switch {
    position: relative;
    width: 40px;
    height: 22px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    padding: 0;
    flex-shrink: 0;
}
.golank-anim-knob {
    position: absolute;
    top: 1px;
    left: 1px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.35);
    transition: transform 0.2s;
}
.golank-anim-switch.is-on {
    background: #06B6D4;
    border-color: #06B6D4;
}
.golank-anim-switch.is-on .golank-anim-knob {
    transform: translateX(18px);
}

/* Indicador de overflow: degradado sutil en el borde inferior */
.golank-cp-slots--overflow {
    -webkit-mask-image: linear-gradient(to bottom, #000 88%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 88%, transparent 100%);
}

/* Flecha indicadora de "hay más abajo" */
.golank-cp-overflow-hint {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 18px;
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
    animation: golankHintBounce 1.8s ease-in-out infinite;
}
.golank-cp-overflow-hint::after {
    content: '↓';
    font-size: 12px;
    color: rgba(255,255,255,0.5);
}
@keyframes golankHintBounce {
    0%, 100% { opacity: 0.35; transform: translateX(-50%) translateY(0); }
    50%      { opacity: 0.85; transform: translateX(-50%) translateY(3px); }
}

.golank-cp-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.golank-cp-group-title {
    font-size: 9px;
    font-weight: 600;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 4px 4px 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: color 0.15s;
    user-select: none;
}
.golank-cp-group-title:hover { color: rgba(255,255,255,0.7); }
.golank-cp-group-title::after {
    content: '▾';
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.2s;
    opacity: 0.4;
}
/* Grupo colapsado */
.golank-cp-group--collapsed .golank-cp-group-title::after { transform: rotate(-90deg); }
.golank-cp-group--collapsed .golank-cp-row { display: none; }

.golank-cp-icon {
    font-size: 12px;
}

.golank-cp-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 6px;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: background 0.18s, border-color 0.18s;
    cursor: default;
}

.golank-cp-row:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(6,182,212,0.3);
}

.golank-cp-row--changed {
    border-color: rgba(46, 204, 113, 0.4) !important;
    background: rgba(46, 204, 113, 0.05) !important;
}

.golank-cp-swatch {
    width: 28px;
    height: 28px;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.15);
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: border-color 0.15s, transform 0.1s;
    outline: none;
}

.golank-cp-swatch:hover {
    border-color: #06B6D4;
    transform: scale(1.1);
}

.golank-cp-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.golank-cp-hex {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    color: rgba(255,255,255,0.65);
    font-size: 11px;
    font-family: 'Inter', monospace;
    padding: 3px 6px;
    box-sizing: border-box;
    transition: border-color 0.15s;
    letter-spacing: 0.5px;
}

.golank-cp-hex:focus {
    outline: none;
    border-color: #06B6D4;
    background: rgba(6,182,212,0.08);
    color: #fff;
}

.golank-cp-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.golank-cp-count {
    font-size: 10px;
    color: #555;
    white-space: nowrap;
}

.golank-cp-row-label {
    font-size: 10px;
    color: #888;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-bottom: 1px;
}

.golank-cp-changed {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2ecc71;
    flex-shrink: 0;
}

.golank-cp-native {
    display: none;
}