/*
 *  1/10/25 - creación  -- ckt
 *  Actualizado para index.html con barra superior y diseño moderno
 */

/* Reset y configuración base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  line-height: 1.6;
  color: #333;
}

/* Barra superior */
.top-bar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo-container {
  display: flex;
  align-items: center;
}

.logo-placeholder {
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1.2rem;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.nav-buttons {
  display: flex;
  gap: 1rem;
}

.btn {
  padding: 0.8rem 1.5rem;
  text-decoration: none;
  border-radius: 25px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.btn-login {
  background: transparent;
  color: #667eea;
  border-color: #667eea;
}

.btn-login:hover {
  background: #667eea;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-register {
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: white;
}

.btn-register:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Contenido principal */
.main-content {
  padding: 3rem 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.main-content h1 {
  text-align: center;
  color: white;
  font-size: 3rem;
  margin-bottom: 2rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.content-section {
  background: rgba(255, 255, 255, 0.95);
  padding: 3rem;
  border-radius: 20px;
  margin-bottom: 3rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

.content-section h2 {
  color: #667eea;
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.content-section h3 {
  color: #764ba2;
  font-size: 1.8rem;
  margin: 2rem 0 1rem 0;
}

.content-section p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  text-align: justify;
  color: #555;
}

/* Sección de características */
.features-section {
  background: rgba(255, 255, 255, 0.95);
  padding: 3rem;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

.features-section h2 {
  color: #667eea;
  font-size: 2.5rem;
  margin-bottom: 2rem;
  text-align: center;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.feature-card {
  background: linear-gradient(135deg, #f8f9ff 0%, #e8ecff 100%);
  padding: 2rem;
  border-radius: 15px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(102, 126, 234, 0.1);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(102, 126, 234, 0.2);
}

.feature-card h4 {
  color: #667eea;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.feature-card p {
  color: #666;
  font-size: 1rem;
  text-align: center;
}

/* Pie de página */
.footer {
  background: rgba(0, 0, 0, 0.8);
  color: white;
  text-align: center;
  padding: 2rem 0;
  margin-top: 3rem;
}

.footer p {
  margin: 0;
  font-size: 0.9rem;
}

/* Estilos para formularios (mantenidos del diseño original) */
form {
  display: inline-block;
  padding: 20px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

label {
  display: block;
  margin: 10px 0 5px;
}

input {
  padding: 8px;
  width: 200px;
  margin-bottom: 15px;
}

button {
  padding: 10px 20px;
  background: #0077cc;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

button:hover {
  background: #005fa3;
}

/* Estilos para formularios de autenticación */
.auth-container {
  background: rgba(255, 255, 255, 0.95);
  padding: 3rem;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  max-width: 500px;
  margin: 0 auto;
}

.auth-container h1 {
  color: #667eea;
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2.5rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  color: #555;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.form-group input,
.form-group select {
  padding: 1rem;
  border: 2px solid #e1e5e9;
  border-radius: 10px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  background: white;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-submit {
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: white;
  padding: 1rem 2rem;
  border: none;
  border-radius: 25px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.auth-links {
  text-align: center;
  margin-top: 2rem;
}

.auth-links p {
  margin: 0.5rem 0;
  color: #666;
}

.auth-links a {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
}

.auth-links a:hover {
  text-decoration: underline;
}

.error-message {
  background: #fee;
  color: #c33;
  padding: 1rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  border-left: 4px solid #c33;
}

.success-message {
  background: #efe;
  color: #363;
  padding: 1rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  border-left: 4px solid #363;
}

/* Estilos para dashboard */
.dashboard-container {
  max-width: 1000px;
  margin: 0 auto;
}

.dashboard-container h1 {
  color: white;
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2.5rem;
}

.user-info-card {
  background: rgba(255, 255, 255, 0.95);
  padding: 2rem;
  border-radius: 15px;
  margin-bottom: 2rem;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.user-info-card h2 {
  color: #667eea;
  margin-bottom: 1.5rem;
  text-align: center;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 0.8rem;
  background: #f8f9ff;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

.info-item strong {
  color: #555;
}

.info-item span {
  color: #667eea;
  font-weight: 600;
}

.status-message {
  background: rgba(255, 255, 255, 0.95);
  padding: 1.5rem;
  border-radius: 15px;
  margin-bottom: 2rem;
  text-align: center;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.status-message p {
  color: #363;
  font-size: 1.1rem;
  margin: 0;
}

.dashboard-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.action-card {
  background: rgba(255, 255, 255, 0.95);
  padding: 2rem;
  border-radius: 15px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.action-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(102, 126, 234, 0.2);
}

.action-card h3 {
  color: #667eea;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.action-card p {
  color: #666;
  margin: 0;
}

.logout-card {
  border: 2px solid #ff6b6b;
}

.logout-card h3 {
  color: #ff6b6b;
}

/* Estilos para formularios complejos */
.form-container {
  background: rgba(255, 255, 255, 0.95);
  padding: 3rem;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  max-width: 800px;
  margin: 0 auto;
}

.form-container h1 {
  color: #667eea;
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2.5rem;
}

.user-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.checkboxes-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem;
  background: #f8f9ff;
  border-radius: 8px;
  border: 1px solid #e1e5e9;
}

.checkbox-item input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.checkbox-item label {
  margin: 0;
  font-weight: normal;
  cursor: pointer;
}

.no-branches {
  color: #666;
  font-style: italic;
  text-align: center;
  padding: 1rem;
  background: #f8f9ff;
  border-radius: 8px;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.btn-cancel {
  background: transparent;
  color: #666;
  padding: 1rem 2rem;
  border: 2px solid #e1e5e9;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-cancel:hover {
  background: #f8f9ff;
  border-color: #667eea;
  color: #667eea;
}

/* Estilos para selección de sucursal */
.branch-selection-container {
  max-width: 600px;
  margin: 0 auto;
}

.branch-selection-container h1 {
  color: white;
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2.5rem;
}

.user-welcome {
  background: rgba(255, 255, 255, 0.95);
  padding: 2rem;
  border-radius: 15px;
  margin-bottom: 2rem;
  text-align: center;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.user-welcome h2 {
  color: #667eea;
  margin-bottom: 0.5rem;
}

.company-info {
  color: #666;
  font-size: 1.1rem;
  margin: 0;
}

.selection-card {
  background: rgba(255, 255, 255, 0.95);
  padding: 2rem;
  border-radius: 15px;
  margin-bottom: 2rem;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.selection-card h3 {
  color: #667eea;
  margin-bottom: 1rem;
  text-align: center;
}

.branch-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.info-section {
  background: rgba(255, 255, 255, 0.95);
  padding: 1.5rem;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.info-section h4 {
  color: #667eea;
  margin-bottom: 1rem;
}

.info-section p {
  color: #666;
  margin: 0;
  line-height: 1.6;
}

.email-message {
  font-size: 0.9rem;
  margin-top: 0.5rem;
  padding: 0.5rem;
  border-radius: 5px;
}

/* Estilos para verificación de email */
.verification-container {
  max-width: 600px;
  margin: 0 auto;
}

.verification-container h1 {
  color: white;
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2.5rem;
}

.verification-card {
  background: rgba(255, 255, 255, 0.95);
  padding: 3rem;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  text-align: center;
  margin-bottom: 2rem;
}

.success-icon,
.error-icon {
  margin-bottom: 1.5rem;
}

.verification-card h2 {
  color: #667eea;
  margin-bottom: 1.5rem;
  font-size: 2rem;
}

.success-message {
  color: #363;
  font-size: 1.1rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.error-message {
  color: #c33;
  font-size: 1.1rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.verification-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.help-section {
  background: rgba(255, 255, 255, 0.95);
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.help-section h3 {
  color: #667eea;
  margin-bottom: 1rem;
  text-align: center;
}

.help-section p {
  color: #666;
  margin-bottom: 1rem;
}

.help-section ul {
  color: #666;
  text-align: left;
  max-width: 400px;
  margin: 0 auto;
}

.help-section li {
  margin-bottom: 0.5rem;
}

.help-info {
  background: rgba(255, 255, 255, 0.95);
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  margin-top: 2rem;
}

.help-info h3 {
  color: #667eea;
  margin-bottom: 1rem;
  text-align: center;
}

.help-info ul {
  color: #666;
  text-align: left;
  max-width: 400px;
  margin: 0 auto;
}

.help-info li {
  margin-bottom: 0.5rem;
}

/* Responsive design */
@media (max-width: 768px) {
  .top-bar {
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
  }
  
  .nav-buttons {
    width: 100%;
    justify-content: center;
  }
  
  .main-content h1 {
    font-size: 2rem;
  }
  
  .content-section,
  .features-section,
  .auth-container,
  .form-container,
  .verification-card,
  .help-section,
  .help-info {
    padding: 2rem 1rem;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .checkboxes-container {
    grid-template-columns: 1fr;
  }
  
  .form-actions,
  .verification-actions {
    flex-direction: column;
  }
  
  .dashboard-actions {
    grid-template-columns: 1fr;
  }
  
  .info-grid {
    grid-template-columns: 1fr;
  }
  
  .container {
    padding: 0 1rem;
  }
}

/* Estilos para validación en tiempo real */
.validation-message {
  margin-top: 5px;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  display: none;
}

.validation-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.validation-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.validation-loading {
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.validation-loading::after {
  content: " ⏳";
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Estilos para gestión de usuarios */
.action-buttons {
  margin: 20px 0;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.action-buttons .btn {
  margin-right: 10px;
  margin-bottom: 5px;
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s ease;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background-color: #007bff;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background-color: #0056b3;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background-color: #545b62;
}

.btn-danger {
  background-color: #dc3545;
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background-color: #c82333;
}

.create-user-form {
  margin: 20px 0;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.create-user-form h3 {
  margin-top: 0;
  color: #495057;
}

.form-actions {
  margin-top: 20px;
  text-align: right;
}

.form-actions .btn {
  margin-left: 10px;
}

.checkbox-label {
  display: block;
  margin: 5px 0;
  font-weight: normal;
  cursor: pointer;
}

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

table th:first-child,
table td:first-child {
  width: 40px;
  text-align: center;
}

.user-checkbox {
  cursor: pointer;
}

/* Estilos para mensajes de error y éxito */
.error ul {
  margin: 10px 0;
  padding-left: 20px;
}

.error li {
  margin: 5px 0;
}

.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  padding: 12px;
  border-radius: 4px;
  margin: 10px 0;
}

.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  padding: 12px;
  border-radius: 4px;
  margin: 10px 0;
}

/* Estilos para la nueva interfaz de gestión de usuarios */
.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.user-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border: 1px solid #e9ecef;
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
}

.user-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.user-header {
  display: flex;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  position: relative;
}

.user-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
  margin-right: 15px;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-info {
  flex: 1;
}

.user-name {
  margin: 0 0 5px 0;
  font-size: 18px;
  font-weight: 600;
}

.user-username {
  margin: 0;
  opacity: 0.8;
  font-size: 14px;
}

.user-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  width: 35px;
  height: 35px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.btn-icon.btn-danger:hover {
  background: rgba(220, 53, 69, 0.8);
}

.user-details {
  padding: 20px;
}

.detail-item {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f8f9fa;
}

.detail-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.detail-label {
  font-weight: 500;
  color: #6c757d;
  min-width: 120px;
  font-size: 14px;
}

.detail-value {
  color: #495057;
  font-size: 14px;
}

.role-badge, .status-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.role-badge.role-owner {
  background: #fff3e0;
  color: #f57c00;
}

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

.role-badge.role-user {
  background: #e8f5e8;
  color: #388e3c;
}

.status-badge {
  background: #e8f5e8;
  color: #2e7d32;
}

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

.status-badge.status-suspended {
  background: #fff3e0;
  color: #ef6c00;
}

.status-badge.status-locked {
  background: #fce4ec;
  color: #ad1457;
}

.user-footer {
  padding: 15px 20px;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
}

.user-stats {
  display: flex;
  justify-content: space-around;
  text-align: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-item strong {
  font-size: 18px;
  color: #495057;
  margin-bottom: 2px;
}

.stat-item small {
  font-size: 11px;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: 12px;
  border: 2px dashed #dee2e6;
  margin: 20px 0;
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state h3 {
  color: #6c757d;
  margin-bottom: 10px;
  font-size: 24px;
}

.empty-state p {
  color: #adb5bd;
  font-size: 16px;
  margin: 0;
}

/* Responsive para móviles */
@media (max-width: 768px) {
  .users-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .user-header {
    padding: 15px;
  }
  
  .user-details {
    padding: 15px;
  }
  
  .user-footer {
    padding: 12px 15px;
  }
  
  .detail-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
  
  .detail-label {
    min-width: auto;
  }
}
