/**
 * GSAP Custom Code Editor Styles
 * Estilos para el widget de código personalizado GSAP
 */

/* Container principal del editor */
.gsap-custom-code-editor {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    position: relative;
}

/* Área de código */
.gsap-custom-code-textarea {
    background: #1e1e1e !important;
    color: #d4d4d4 !important;
    border: none !important;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    padding: 15px !important;
    resize: vertical !important;
    min-height: 300px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    outline: none !important;
}

.gsap-custom-code-textarea:focus {
    box-shadow: 0 0 0 2px #007cba !important;
}

/* Selector de templates */
.gsap-template-selector {
    margin-bottom: 10px;
}

.gsap-template-selector select {
    width: 100%;
    padding: 8px 12px;
    background: #2d2d30;
    color: #cccccc;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    font-size: 14px;
}

.gsap-template-selector select:focus {
    outline: none;
    border-color: #007acc;
    box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2);
}

/* Botones del editor */
.gsap-code-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.gsap-code-btn {
    padding: 6px 12px;
    background: #0e639c;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
}

.gsap-code-btn:hover {
    background: #1177bb;
}

.gsap-code-btn.secondary {
    background: #5a5a5a;
}

.gsap-code-btn.secondary:hover {
    background: #6a6a6a;
}

.gsap-code-btn.danger {
    background: #d73a49;
}

.gsap-code-btn.danger:hover {
    background: #e53e3e;
}

/* Resultados de validación */
.gsap-validation-results {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.4;
    display: none;
}

.gsap-validation-results.show {
    display: block;
}

.gsap-validation-results.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.gsap-validation-results.warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.gsap-validation-results.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.gsap-validation-results.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Lista de errores/warnings */
.gsap-validation-list {
    margin: 0;
    padding-left: 20px;
}

.gsap-validation-list li {
    margin-bottom: 4px;
}

/* Indicador de estado */
.gsap-validation-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #6c757d;
    transition: background-color 0.3s;
}

.gsap-validation-indicator.valid {
    background: #28a745;
}

.gsap-validation-indicator.invalid {
    background: #dc3545;
}

.gsap-validation-indicator.warning {
    background: #ffc107;
}

/* Información de ayuda */
.gsap-code-help {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #495057;
}

.gsap-code-help h4 {
    margin: 0 0 8px 0;
    color: #212529;
    font-size: 14px;
}

.gsap-code-help ul {
    margin: 0;
    padding-left: 20px;
}

.gsap-code-help li {
    margin-bottom: 4px;
}

/* Variables disponibles */
.gsap-available-vars {
    background: #e9ecef;
    border-radius: 3px;
    padding: 8px;
    margin-top: 8px;
    font-family: monospace;
    font-size: 12px;
}

.gsap-available-vars code {
    background: transparent;
    color: #495057;
    font-weight: bold;
}

/* Responsive */
@media (max-width: 768px) {
    .gsap-code-actions {
        flex-direction: column;
    }
    
    .gsap-code-btn {
        width: 100%;
        text-align: center;
    }
    
    .gsap-custom-code-textarea {
        font-size: 12px !important;
        min-height: 250px !important;
    }
}

/* Elementor específico */
.elementor-control-gsap_custom_code .elementor-control-input-wrapper {
    position: relative;
}

.elementor-control-gsap_template_selector .elementor-control-input-wrapper select {
    background: #2d2d30;
    color: #cccccc;
    border-color: #3e3e42;
}

/* Animaciones */
@keyframes gsap-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.gsap-validating .gsap-validation-indicator {
    animation: gsap-pulse 1s infinite;
}

/* Syntax highlighting básico */
.gsap-custom-code-textarea {
    tab-size: 2;
    -moz-tab-size: 2;
}

/* Scrollbar personalizado para el textarea */
.gsap-custom-code-textarea::-webkit-scrollbar {
    width: 8px;
}

.gsap-custom-code-textarea::-webkit-scrollbar-track {
    background: #2d2d30;
}

.gsap-custom-code-textarea::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.gsap-custom-code-textarea::-webkit-scrollbar-thumb:hover {
    background: #777;
}