/**
 * Estilos para ConfigurationManagerUI
 * UI de gestión de configuraciones personalizadas
 */

/* IMPORTANTE: Todos los estilos deben estar escopados para no afectar el resto de la app */

/* ============================================
   OVERLAY Y MODAL
   ============================================ */

.config-manager-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    animation: fadeIn 0.2s ease-out;
}

.config-manager-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

/* ============================================
   HEADER
   ============================================ */

.config-manager-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.config-manager-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}

.config-close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f3f4f6;
    border-radius: 8px;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.2s;
}

.config-close-btn:hover {
    background: #e5e7eb;
    color: #111827;
}

/* ============================================
   TABS
   ============================================ */

.config-manager-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.config-tab {
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    position: relative;
    top: 1px;
}

.config-tab:hover {
    color: #111827;
}

.config-tab.active {
    color: #4f46e5;
    border-bottom-color: #4f46e5;
    background: white;
}

/* ============================================
   CONTENIDO
   ============================================ */

.config-manager-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.config-view {
    display: block;
}

.config-view.hidden {
    display: none;
}

/* ============================================
   SECCIONES
   ============================================ */

.config-section {
    margin-bottom: 2rem;
}

.config-section:last-child {
    margin-bottom: 0;
}

.config-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.config-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 1rem 0;
}

.config-section-header .config-section-title {
    margin-bottom: 0;
}

/* ============================================
   LISTA DE ITEMS
   ============================================ */

.config-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.config-empty {
    padding: 2rem;
    text-align: center;
    color: #9ca3af;
    font-style: italic;
    background: #f9fafb;
    border-radius: 8px;
    border: 2px dashed #e5e7eb;
}

/* ============================================
   ITEMS DE CONFIGURACIÓN
   ============================================ */

.config-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: white;
    transition: all 0.2s;
}

.config-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.config-item-system {
    background: #f9fafb;
}

.config-item-custom {
    background: white;
}

.config-item-hidden {
    background: #fef3c7;
    border-color: #fbbf24;
}

.config-item-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
}

.config-item-info {
    flex: 1;
    min-width: 0;
}

.config-item-name {
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.config-item-meta {
    font-size: 0.875rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   ACCIONES DE ITEMS
   ============================================ */

.config-item-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.config-action-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.config-action-btn:hover {
    background: #e5e7eb;
    transform: scale(1.05);
}

.config-action-btn:active {
    transform: scale(0.95);
}

.config-action-delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Botón de eliminación para elementos del sistema (más sutil) */
.config-item-system .config-action-btn {
    background: transparent;
    color: #9ca3af;
    font-size: 1.25rem;
    font-weight: 600;
}

.config-item-system .config-action-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Botón de restauración */
.config-action-restore {
    background: #fef3c7;
    color: #d97706;
}

.config-action-restore:hover {
    background: #10b981;
    color: white;
}

/* ============================================
   FOOTER
   ============================================ */

.config-manager-footer {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

/* ============================================
   BOTONES
   ============================================ */

.config-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.config-btn-primary {
    background: #4f46e5;
    color: white;
}

.config-btn-primary:hover {
    background: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.config-btn-primary:active {
    transform: translateY(0);
}

.config-btn-secondary {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

.config-btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

/* ============================================
   TOAST DE NOTIFICACIÓN
   ============================================ */

.config-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #10b981;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s ease-out;
}

.config-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ============================================
   ANIMACIONES
   ============================================ */

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
    .config-manager-modal {
        max-height: 100vh;
        border-radius: 0;
    }

    .config-manager-header h2 {
        font-size: 1.25rem;
    }

    .config-manager-tabs {
        padding: 0 1rem;
    }

    .config-tab {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .config-manager-content {
        padding: 1rem;
    }

    .config-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .config-section-header .config-btn {
        width: 100%;
        justify-content: center;
    }

    .config-item {
        flex-wrap: wrap;
    }

    .config-item-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .config-manager-footer {
        flex-direction: column;
    }

    .config-manager-footer .config-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   DARK MODE
   ============================================ */

body.dark-mode .config-manager-modal {
    background: #1f2937;
}

body.dark-mode .config-manager-header {
    border-bottom-color: #374151;
}

body.dark-mode .config-manager-header h2 {
    color: #f9fafb;
}

body.dark-mode .config-close-btn {
    background: #374151;
    color: #9ca3af;
}

body.dark-mode .config-close-btn:hover {
    background: #4b5563;
    color: #f9fafb;
}

body.dark-mode .config-manager-tabs {
    border-bottom-color: #374151;
    background: #111827;
}

body.dark-mode .config-tab {
    color: #9ca3af;
}

body.dark-mode .config-tab:hover {
    color: #f9fafb;
}

body.dark-mode .config-tab.active {
    color: #818cf8;
    border-bottom-color: #818cf8;
    background: #1f2937;
}

body.dark-mode .config-section-title {
    color: #e5e7eb;
}

body.dark-mode .config-empty {
    background: #111827;
    border-color: #374151;
    color: #6b7280;
}

body.dark-mode .config-item {
    border-color: #374151;
    background: #111827;
}

body.dark-mode .config-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .config-item-system {
    background: #0f172a;
}

body.dark-mode .config-item-custom {
    background: #111827;
}

body.dark-mode .config-item-hidden {
    background: #422006;
    border-color: #92400e;
}

body.dark-mode .config-item-name {
    color: #f9fafb;
}

body.dark-mode .config-item-meta {
    color: #9ca3af;
}

body.dark-mode .config-action-btn {
    background: #374151;
    color: #9ca3af;
}

body.dark-mode .config-action-btn:hover {
    background: #4b5563;
    color: #f9fafb;
}

body.dark-mode .config-action-delete:hover {
    background: #7f1d1d;
    color: #fca5a5;
}

body.dark-mode .config-item-system .config-action-btn {
    background: transparent;
    color: #6b7280;
}

body.dark-mode .config-item-system .config-action-btn:hover {
    background: #7f1d1d;
    color: #fca5a5;
}

body.dark-mode .config-action-restore {
    background: #422006;
    color: #fbbf24;
}

body.dark-mode .config-action-restore:hover {
    background: #065f46;
    color: #6ee7b7;
}

body.dark-mode .config-manager-footer {
    border-top-color: #374151;
    background: #111827;
}

body.dark-mode .config-btn-secondary {
    background: #374151;
    color: #e5e7eb;
    border-color: #4b5563;
}

body.dark-mode .config-btn-secondary:hover {
    background: #4b5563;
    border-color: #6b7280;
}
