/* Users management page styles */

.users-container {
  max-width: 1400px;
  margin: 0 auto;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.header > div {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-primary {
  background: #7c1331;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s;
}

.btn-primary:hover {
  background: #5568d3;
}

.btn-secondary {
  background: #ffffff;
  color: #333;
  border: 1px solid #ddd;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.btn-secondary:hover {
  background: #f5f5f5;
}

.btn-danger {
  background: #c62828;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s;
}

.btn-danger:hover {
  background: #b71c1c;
}

.btn-warning {
  background: #f57c00;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s;
}

.btn-warning:hover {
  background: #ef6c00;
}

.table-container {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-top: 20px;
  overflow-x: auto;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.users-table th {
  background: #f8f9fa;
  padding: 12px 8px;
  text-align: left;
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid #dee2e6;
}

.users-table td {
  padding: 12px 8px;
  border-bottom: 1px solid #dee2e6;
  color: #555;
}

.users-table tbody tr:hover {
  background: #f8f9fa;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.badge-estudiante {
  background: #e3f2fd;
  color: #1976d2;
}

.badge-docente {
  background: #f3e5f5;
  color: #7b1fa2;
}

.badge-admin {
  background: #ffe0b2;
  color: #e65100;
}

.badge-activo {
  background: #e8f5e9;
  color: #2e7d32;
}

.badge-success {
  background: #e8f5e9;
  color: #2e7d32;
}

.badge-inactivo {
  background: #ffebee;
  color: #c62828;
}

.badge-inactive {
  background: #ffebee;
  color: #c62828;
}

.action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  margin: 0 2px;
  font-size: 16px;
  transition: transform 0.2s;
}

.action-btn:hover {
  transform: scale(1.2);
}

/* Modal */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  animation: fadeIn 0.3s;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal[style*="display: block"] {
  display: flex !important;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s;
  padding: 20px;
  position: relative;
}

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

.modal-content h2 {
  margin: 0 0 20px 0;
  color: #7c1331;
  font-size: 24px;
  padding-right: 30px;
}

.modal-content .close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 32px;
  font-weight: bold;
  color: #999;
  cursor: pointer;
  line-height: 1;
  background: none;
  border: none;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content .close:hover,
.modal-content .close:focus {
  color: #333;
  text-decoration: none;
}

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

.modal-header h3 {
  margin: 0;
  color: #7c1331;
}

.close-btn {
  background: none;
  border: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
}

.close-btn:hover {
  color: #333;
}

.modal-body {
  padding: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.3s;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #7c1331;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group input[type="checkbox"] {
  margin-right: 8px;
}

.form-hint {
  display: block;
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}

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

.form-status.error {
  display: block;
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

.form-status.success {
  display: block;
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

/* Additional styles for carreras and materias pages */
.header-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.header-section h1 {
  margin: 0;
  font-size: 28px;
  color: #333;
}

.content-section {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-section {
  margin-bottom: 20px;
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 250px;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

.filters {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  cursor: pointer;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background: #f8f9fa;
}

.data-table th {
  text-align: left;
  padding: 12px 8px;
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid #dee2e6;
}

.data-table td {
  padding: 12px 8px;
  border-bottom: 1px solid #dee2e6;
  color: #555;
}

.data-table tbody tr:hover {
  background: #f8f9fa;
}

.text-center {
  text-align: center;
}

.actions-cell {
  text-align: center;
}

.btn-icon {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 4px;
  transition: background 0.2s;
}

.btn-icon:hover {
  background: #f0f0f0;
}

.btn-danger {
  background: #dc3545;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s;
}

.btn-danger:hover {
  background: #c82333;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* Docentes List */
.docentes-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 10px;
  background: #f9f9f9;
}

.docentes-list .empty-message {
  text-align: center;
  color: #999;
  padding: 20px;
  font-style: italic;
}

.docente-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  margin-bottom: 8px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  transition: box-shadow 0.2s;
}

.docente-item:hover {
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.docente-item:last-child {
  margin-bottom: 0;
}

.docente-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.docente-info strong {
  color: #333;
  font-size: 14px;
}

.docente-details {
  font-size: 12px;
  color: #666;
  display: flex;
  gap: 8px;
  align-items: center;
}

.docente-actions {
  display: flex;
  gap: 5px;
}

.btn-icon-small {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s;
}

.btn-icon-small:hover {
  background: #f0f0f0;
}

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

/* Comisiones specific styles */
.modal-large {
  max-width: 900px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.info-box {
  background: #e3f2fd;
  border: 1px solid #90caf9;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
}

.info-box ul {
  margin: 10px 0;
  padding-left: 25px;
}

.info-box li {
  margin: 5px 0;
}

.progress-bar {
  width: 100%;
  height: 30px;
  background: #f0f0f0;
  border-radius: 15px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #7c1331 0%, #5568d3 100%);
  transition: width 0.3s ease;
  width: 0%;
}

.link-primary {
  color: #7c1331;
  text-decoration: none;
  font-weight: 500;
}

.link-primary:hover {
  text-decoration: underline;
  color: #5568d3;
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: stretch;
  }

  .header > div {
    justify-content: space-between;
  }

  .table-container {
    overflow-x: scroll;
  }

  .users-table {
    min-width: 800px;
  }

  .modal-content {
    width: 95%;
    margin: 10px;
  }
  
  .modal-large {
    max-width: 95%;
  }
  
  .modal-actions {
    flex-direction: column;
  }
}
