.info-section {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.info-section h3 {
  margin: 0 0 0.5rem 0;
  color: #333;
  font-size: 16px;
  font-weight: 600;
}

.info-section p {
  margin: 0;
  color: #666;
  font-size: 14px;
}

.info-competencias {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
  font-size: 14px;
}

.info-competencias p {
  margin: 0.25rem 0;
  color: #666;
}

#competencias-container {
  margin: 2rem 0;
  display: grid;
  gap: 1.5rem;
}

.unidad-card {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 0;
  margin-bottom: 1.5rem;
  transition: box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.unidad-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.unidad-header {
  background: #f8f9fa;
  color: #333;
  padding: 1rem 1.5rem;
  margin: 0;
  border-bottom: 1px solid #e0e0e0;
  font-weight: 600;
  font-size: 16px;
  text-align: left;
}

.unidad-content {
  padding: 1.5rem;
}

.competencias-controls {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.competencias-controls label {
  font-weight: 600;
  color: #333;
  font-size: 14px;
  white-space: nowrap;
}

.select-num-competencias {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background: #ffffff;
  min-width: 140px;
}

.select-num-competencias:focus {
  outline: none;
  border-color: #4CAF50;
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

.competencias-unidad {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.competencias-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.competencia-item {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 0;
  margin-bottom: 1rem;
  transition: box-shadow 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.competencia-item:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.competencia-header {
  background: #e3f2fd;
  color: #1976d2;
  padding: 0.75rem 1rem;
  margin: 0;
  border-bottom: 1px solid #e0e0e0;
  font-weight: 600;
  font-size: 14px;
  text-align: left;
}

.competencia-content {
  padding: 1.5rem;
}

.competencia-content .form-row {
  margin-bottom: 1rem;
}

.competencia-content .form-row:last-child {
  margin-bottom: 0;
}

.competencia-content label {
  display: block;
  font-weight: 600;
  color: #333;
  font-size: 13px;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.competencia-content input,
.competencia-content textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.2s ease;
  background: #ffffff;
  box-sizing: border-box;
}

.competencia-content input:focus,
.competencia-content textarea:focus {
  outline: none;
  border-color: #4CAF50;
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

.competencia-content textarea {
  min-height: 80px;
  resize: vertical;
  font-family: inherit;
}

.competencia-codigo {
  background: #f1f5f9 !important;
  color: #64748b !important;
  font-weight: 600;
  font-family: 'Courier New', monospace;
  cursor: not-allowed !important;
  border: 1px solid #cbd5e1 !important;
}

.competencia-titulo {
  font-weight: 500;
}

.competencia-descripcion {
  min-height: 80px;
  resize: vertical;
}

.form-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 2rem 0;
}

.btn {
  padding: 10px 20px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 120px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: #4CAF50;
  color: white;
  border-color: #4CAF50;
}

.btn-primary:hover {
  background: #45a049;
  border-color: #45a049;
}

.btn-secondary {
  background: #ffffff;
  color: #333;
  border-color: #ddd;
}

.btn-secondary:hover {
  background: #f8f9fa;
  border-color: #bbb;
}

.mensaje {
  margin-top: 1rem;
  padding: 12px 16px;
  border-radius: 4px;
  font-weight: 500;
  text-align: center;
  display: none;
  font-size: 14px;
}

.mensaje.exito {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  display: block;
}

.mensaje.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  display: block;
}

.mensaje-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
}

.mensaje-info h3 {
  margin-top: 0;
  color: #0c5460;
}

@media (max-width: 768px) {
  .competencia-item {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  
  .btn-eliminar-competencia {
    align-self: flex-end;
    width: auto;
    padding: 6px 12px;
  }
  
  .info-section {
    padding: 1rem;
  }
  
  .unidad-competencia-content {
    padding: 1rem;
  }
  
  .unidad-competencia-header {
    padding: 1rem;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .info-section {
    padding: 0.75rem;
  }
  
  .unidad-competencia-content {
    padding: 0.75rem;
  }
  
  .btn {
    font-size: 13px;
    padding: 8px 16px;
  }
}

select:disabled,
.select-num-competencias:disabled {
  background-color: #f5f5f5;
  color: #999;
  border-color: #ddd;
  cursor: not-allowed;
  opacity: 0.7;
}

button:disabled,
.btn:disabled {
  background-color: #f5f5f5;
  color: #999;
  border-color: #ddd;
  cursor: not-allowed;
  opacity: 0.7;
}

button:disabled:hover,
.btn:disabled:hover {
  background-color: #f5f5f5;
  color: #999;
  transform: none;
}

.btn-warning {
  background: linear-gradient(135deg, #ff9a56 0%, #ffad56 100%);
  color: white;
  border: none;
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
  box-shadow: 0 4px 15px rgba(255, 154, 86, 0.3);
}

.btn-warning:hover {
  background: linear-gradient(135deg, #ff8a40 0%, #ff9d40 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 154, 86, 0.4);
}

/* Modal styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  padding: 2.5rem;
  max-width: 450px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  transform: scale(0.8) translateY(-30px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: white;
  overflow: hidden;
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), transparent);
  border-radius: 20px;
  pointer-events: none;
}

.modal-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: block;
  animation: bounceIn 0.6s ease-out 0.2s both;
}

.modal-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.modal-message {
  font-size: 1.1rem;
  line-height: 1.5;
  margin-bottom: 2rem;
  opacity: 0.9;
  animation: fadeInUp 0.6s ease-out 0.4s both;
}

.modal-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  animation: fadeInUp 0.6s ease-out 0.5s both;
}

.modal-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
  position: relative;
  overflow: hidden;
}

.modal-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.modal-btn:hover::before {
  width: 300px;
  height: 300px;
}

.modal-btn-confirm {
  background: #ff4757;
  color: white;
  box-shadow: 0 8px 20px rgba(255, 71, 87, 0.4);
}

.modal-btn-confirm:hover {
  background: #ff3742;
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(255, 71, 87, 0.5);
}

.modal-btn-cancel {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.1);
}

.modal-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(255, 255, 255, 0.2);
}

/* Animaciones para el modal */
@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 40px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
