/**
 * Estilos para Configuración de Servicios
 */

/* === BOTONES === */
.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.875rem;
}

.config-actions {
    display: flex;
    gap: 10px;
}

/* === MODALES === */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background-color: #1e1e1e;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
    border: 1px solid #333;
}

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

.modal-small {
    width: 90%;
    max-width: 500px;
}

.modal-medium {
    width: 90%;
    max-width: 700px;
}

.modal-large {
    width: 95%;
    max-width: 1200px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #333;
}

.modal-header h2 {
    margin: 0;
    color: #fff;
    font-size: 24px;
}

.modal-close {
    background: none;
    border: none;
    color: #999;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background-color: #333;
    color: #fff;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #333;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* === HEADER DE CONFIGURACIÓN === */
.config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #333;
}

.config-stats {
    display: flex;
    gap: 16px;
}

/* Badges dentro de los modales */
.modal .stat-badge {
    background-color: #2a2a2a;
    padding: 8px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal .stat-badge.critical {
    background-color: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.3);
}

/* Estilos de estadísticas dentro de los modales */
.modal .stat-label {
    color: #999;
    font-size: 14px;
}

.modal .stat-value {
    color: #fff;
    font-weight: bold;
    font-size: 16px;
}

/* === GRID DE SERVICIOS === */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.service-card {
    background-color: #2a2a2a;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #333;
    transition: all 0.3s;
}

.service-card:hover {
    border-color: #0ea5e9;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

.service-card.critical {
    border-color: rgba(220, 38, 38, 0.5);
    background-color: rgba(220, 38, 38, 0.05);
}

.service-card.critical:hover {
    border-color: #dc2626;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.service-card.disabled {
    opacity: 0.6;
}

.service-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.service-card-header h3 {
    margin: 0;
    color: #fff;
    font-size: 20px;
}

.service-badges {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}

.badge {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

.badge-critical {
    background-color: rgba(220, 38, 38, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(220, 38, 38, 0.5);
}

.badge-normal {
    background-color: rgba(156, 163, 175, 0.2);
    color: #d1d5db;
    border: 1px solid rgba(156, 163, 175, 0.5);
}

.badge-enabled {
    background-color: rgba(34, 197, 94, 0.2);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.5);
}

.badge-disabled {
    background-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.5);
}

.service-card-body {
    margin-bottom: 16px;
}

.service-info p {
    margin: 8px 0;
    color: #ccc;
    font-size: 14px;
}

.service-info strong {
    color: #0ea5e9;
}

.service-info code {
    background-color: #1e1e1e;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #86efac;
}

.service-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* === FORMULARIO === */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #fff;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: #999;
    font-size: 12px;
}

.checkbox-group {
    margin: 16px 0;
}

.checkbox-group label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    padding: 12px;
    background-color: #2a2a2a;
    border-radius: 8px;
    transition: all 0.2s;
}

.checkbox-group label:hover {
    background-color: #333;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
}

.checkbox-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.checkbox-label strong {
    color: #fff;
}

.checkbox-label small {
    color: #999;
    font-size: 12px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* === BOTONES === */
button, .btn-primary, .btn-secondary, .btn-small, .btn-edit, .btn-warning, .btn-danger, .btn-success {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: #0ea5e9;
    color: #fff;
}

.btn-primary:hover {
    background-color: #0284c7;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

.btn-secondary {
    background-color: #444;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #555;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-edit {
    background-color: #8b5cf6;
    color: #fff;
}

.btn-edit:hover {
    background-color: #7c3aed;
}

.btn-warning {
    background-color: #f59e0b;
    color: #fff;
}

.btn-warning:hover {
    background-color: #d97706;
}

.btn-danger {
    background-color: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-success {
    background-color: #22c55e;
    color: #fff;
}

.btn-success:hover {
    background-color: #16a34a;
}

/* === ESTADOS VACÍOS === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state p {
    font-size: 18px;
    margin-bottom: 20px;
}

.loading {
    text-align: center;
    color: #999;
    padding: 40px;
    font-style: italic;
}

/* === LISTA DE SERVICIOS CRÍTICOS === */
.critical-services-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.critical-services-list li {
    padding: 12px;
    background-color: #2a2a2a;
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.critical-services-list strong {
    color: #fff;
    flex: 1;
}

.service-meta {
    color: #999;
    font-size: 12px;
}

/* === NOTIFICACIONES TOAST === */
.toast {
    position: fixed;
    bottom: -100px;
    right: 20px;
    min-width: 300px;
    padding: 16px 24px;
    background-color: #2a2a2a;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 10001;
    transition: bottom 0.3s ease;
    border-left: 4px solid;
}

.toast.show {
    bottom: 20px;
}

.toast-success {
    border-left-color: #22c55e;
}

.toast-error {
    border-left-color: #ef4444;
}

.toast-info {
    border-left-color: #0ea5e9;
}

/* === IMPORTACIÓN RÁPIDA === */
.import-header {
    margin-bottom: 20px;
}

.import-description {
    color: #9ca3af;
    margin-bottom: 16px;
    line-height: 1.6;
}

.import-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    background: #2a2a2a;
    border: 1px solid #404040;
    border-radius: 6px;
    color: #fff;
    font-size: 0.875rem;
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
}

.import-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.services-import-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
    max-height: 50vh;
    overflow-y: auto;
    padding: 4px;
}

.service-import-item {
    background: #2a2a2a;
    border: 2px solid #404040;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.service-import-item:hover {
    border-color: #3b82f6;
    background: #333;
}

.service-import-item.selected {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.service-import-item.already-configured {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #6b7280;
}

.service-import-item.already-configured:hover {
    border-color: #6b7280;
    background: #2a2a2a;
}

.service-import-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.service-import-item.already-configured .service-import-checkbox {
    cursor: not-allowed;
}

.service-import-info {
    flex: 1;
}

.service-import-name {
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.service-import-slug {
    font-size: 0.75rem;
    color: #9ca3af;
    font-family: monospace;
}

.service-import-state {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.service-import-state.normal {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.service-import-state.reportes {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.service-import-state.caido {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.service-import-state.desconocido {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .config-header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .config-stats {
        flex-direction: column;
    }
    
    .modal-content {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .service-card-actions {
        flex-direction: column;
    }
    
    .service-card-actions button {
        width: 100%;
    }
}
