/**
 * LiveDoc Styles
 * Estilos para el modal de edición en vivo de documentos
 */

/* Evitar scroll del body cuando el modal está abierto */
body.livedoc-modal-open {
    overflow: hidden;
}

/* Overlay del modal */
.livedoc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: livedocFadeIn 0.2s ease-out;
}

@keyframes livedocFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Contenedor del modal */
.livedoc-modal {
    width: 95vw;
    height: 92vh;
    max-width: 1800px;
    background: var(--color-bg-primary, #1a1a2e);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    animation: livedocSlideUp 0.25s ease-out;
}

@keyframes livedocSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header del modal */
.livedoc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--color-bg-secondary, #16213e);
    border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.08));
    flex-shrink: 0;
}

.livedoc-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text-primary, #fff);
}

.livedoc-icon {
    width: 22px;
    height: 22px;
    fill: currentColor;
    opacity: 0.8;
}

.livedoc-badge {
    background: linear-gradient(135deg, #34a853, #4285f4);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Acciones del header */
.livedoc-modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.livedoc-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    background: var(--color-bg-tertiary, rgba(255,255,255,0.08));
    color: var(--color-text-secondary, #a0a0a0);
}

.livedoc-btn:hover {
    background: var(--color-bg-hover, rgba(255,255,255,0.12));
    color: var(--color-text-primary, #fff);
}

.livedoc-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.livedoc-btn-sync {
    background: linear-gradient(135deg, #34a853, #2d9649);
    color: white;
}

.livedoc-btn-sync:hover {
    background: linear-gradient(135deg, #3dbd5e, #34a853);
    color: white;
    transform: translateY(-1px);
}

.livedoc-btn-external {
    padding: 8px;
}

.livedoc-btn-close {
    padding: 8px;
    background: rgba(255, 82, 82, 0.15);
    color: #ff5252;
}

.livedoc-btn-close:hover {
    background: rgba(255, 82, 82, 0.25);
    color: #ff6b6b;
}

/* Cuerpo del modal con iframe */
.livedoc-modal-body {
    flex: 1;
    background: #fff;
    position: relative;
    overflow: hidden;
}

.livedoc-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

/* Footer del modal */
.livedoc-modal-footer {
    padding: 10px 20px;
    background: var(--color-bg-secondary, #16213e);
    border-top: 1px solid var(--color-border, rgba(255,255,255,0.08));
    flex-shrink: 0;
}

.livedoc-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--color-text-tertiary, #666);
}

.livedoc-hint svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    opacity: 0.6;
}

/* Botón de edición LiveDoc (para usar en listas de documentos) */
.btn-livedoc {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #34a853, #4285f4);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-livedoc:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 168, 83, 0.3);
}

.btn-livedoc svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* Variante pequeña */
.btn-livedoc-sm {
    padding: 4px 8px;
    font-size: 11px;
}

.btn-livedoc-sm svg {
    width: 12px;
    height: 12px;
}

/* Variante solo icono */
.btn-livedoc-icon {
    padding: 6px;
    border-radius: 6px;
}

.btn-livedoc-icon span {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .livedoc-modal {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .livedoc-modal-header {
        padding: 12px 15px;
    }

    .livedoc-modal-title span {
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .livedoc-btn span {
        display: none;
    }

    .livedoc-btn {
        padding: 8px;
    }

    .livedoc-modal-footer {
        display: none;
    }
}

/* Tema claro (opcional) */
@media (prefers-color-scheme: light) {
    .livedoc-modal {
        background: #f5f5f5;
    }

    .livedoc-modal-header,
    .livedoc-modal-footer {
        background: #fff;
        border-color: rgba(0,0,0,0.08);
    }

    .livedoc-modal-title {
        color: #333;
    }

    .livedoc-btn {
        background: rgba(0,0,0,0.05);
        color: #666;
    }

    .livedoc-btn:hover {
        background: rgba(0,0,0,0.08);
        color: #333;
    }
}

