/* 🔧 ENHANCED ADMIN PANEL STYLES */

/* Botón flotante de admin */
#admin-trigger {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    user-select: none;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

#admin-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.4);
}

/* Panel principal mejorado */
.enhanced-admin-panel {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Paleta de colores */
#color-palette {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

#color-palette button {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 2px solid #d1d5db;
    cursor: pointer;
    transition: all 0.2s ease;
}

#color-palette button:hover {
    border-color: #6b7280;
    transform: scale(1.1);
}

#color-palette button.selected {
    border-color: #1f2937;
    border-width: 3px;
    transform: scale(1.1);
}

/* Canvas del editor */
#image-editor-container canvas {
    max-width: 100%;
    max-height: 100%;
    cursor: crosshair;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
}

#image-editor-container canvas:hover {
    border-color: #9ca3af;
}

/* Herramientas seleccionadas */
.tool-selected {
    background-color: #1f2937 !important;
    color: white !important;
}

/* Animaciones suaves */
.enhanced-admin-panel * {
    transition: all 0.2s ease;
}

/* Botones mejorados */
.enhanced-admin-panel button {
    transition: all 0.2s ease;
    font-weight: 500;
    border: none;
    outline: none;
}

.enhanced-admin-panel button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.enhanced-admin-panel button:active {
    transform: translateY(0);
}

/* Notificaciones mejoradas */
.admin-notification {
    border-left: 4px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

/* Imagen actual display */
#current-image-display img {
    max-height: 80px;
    object-fit: contain;
    margin: 0 auto;
    display: block;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

/* Textarea de explicaciones */
#explanation-output {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    background-color: #fefefe;
    border: 2px solid #fed7aa;
    border-radius: 6px;
    padding: 12px;
    resize: vertical;
    min-height: 200px;
}

#explanation-output:focus {
    border-color: #ea580c;
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.1);
    outline: none;
}

/* Estados de carga */
.loading-state {
    opacity: 0.7;
    pointer-events: none;
}

.loading-state::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Color analysis */
#color-analysis {
    background-color: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 4px;
    padding: 8px;
    margin-top: 8px;
}

/* Responsive */
@media (max-width: 1024px) {
    .enhanced-admin-panel {
        inset: 8px;
    }
    
    .enhanced-admin-panel .flex {
        flex-direction: column;
    }
    
    .enhanced-admin-panel .w-1\\/3 {
        width: 100%;
        max-height: 200px;
    }
}

/* Scrollbars personalizados */
.enhanced-admin-panel ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.enhanced-admin-panel ::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.enhanced-admin-panel ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.enhanced-admin-panel ::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Badges y estados */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.active {
    background-color: #dcfce7;
    color: #166534;
}

.status-badge.inactive {
    background-color: #fef2f2;
    color: #991b1b;
}

/* Efectos de hover para secciones */
.bg-blue-50:hover {
    background-color: #dbeafe;
}

.bg-green-50:hover {
    background-color: #dcfce7;
}

.bg-purple-50:hover {
    background-color: #faf5ff;
}

.bg-yellow-50:hover {
    background-color: #fefce8;
}

.bg-orange-50:hover {
    background-color: #fff7ed;
}

.bg-gray-50:hover {
    background-color: #f9fafb;
}

/* Animación de fade in para el panel */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.enhanced-admin-panel {
    animation: fadeIn 0.3s ease-in-out;
}

/* Canvas herramientas cursor */
.tool-fill canvas { cursor: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIGZpbGw9Im5vbmUiIHN0cm9rZT0iY3VycmVudENvbG9yIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgY2xhc3M9ImZlYXRoZXIgZmVhdGhlci1kcm9wbGV0Ij48cGF0aCBkPSJtMTIgMi42OSA1LjY2IDUuNjZhOCA4IDAgMSAxLTExLjMxIDBaIi8+PC9zdmc+'), crosshair; }
.tool-brush canvas { cursor: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIGZpbGw9Im5vbmUiIHN0cm9rZT0iY3VycmVudENvbG9yIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgY2xhc3M9ImZlYXRoZXIgZmVhdGhlci1lZGl0LTMiPjxwYXRoIGQ9Im0xMiAyMGgxMSIvPjxwYXRoIGQ9Im0xNi41IDMuNWE0IDQgMCAxIDEgNSA1TDcgMjMgMiAyMWwxLTVaIi8+PC9zdmc+'), crosshair; }
.tool-eraser canvas { cursor: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIGZpbGw9Im5vbmUiIHN0cm9rZT0iY3VycmVudENvbG9yIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgY2xhc3M9ImZlYXRoZXIgZmVhdGhlci10cmFzaC0yIj48cG9seWxpbmUgcG9pbnRzPSIzLDYgNSw2IDIxLDYiLz48cGF0aCBkPSJtMTkgNnYxNGE0IDQgMCAwIDEtNCA0SDlhNCA0IDAgMCAxLTQtNFY2bTItNFY0YTIgMiAwIDAgMSAyLTJoNmEyIDIgMCAwIDEgMiAydjIiLz48L3N2Zz4='), crosshair; }

/* Mejoras visuales adicionales */
.enhanced-admin-panel .bg-gradient-to-r {
    background-image: linear-gradient(to right, #dc2626, #b91c1c, #991b1b);
}