/*
 * Author: Pyrukent
 * emprai/assets/css/components.css
 * Proyecto EMPRAI AUTOMOTIVE
 * Versión: 1.0
 */

/* UTILIDADES GLOBALES */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

/* LOADING SPINNER */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 0, 0, 0.2);
  border-top: 4px solid var(--clr-red-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* NOTIFICACIONES */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-organic);
  color: white;
  font-weight: 600;
  z-index: 10000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  max-width: 400px;
  box-shadow: var(--shadow-organic);
}

.notification.show {
  transform: translateX(0);
}

.notification-success {
  background: linear-gradient(135deg, #00FF00, #00CC00);
}

.notification-error {
  background: linear-gradient(135deg, #FF0000, #CC0000);
}

.notification-info {
  background: var(--gradient-red);
}

/* MODAL */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--clr-white);
  border-radius: var(--radius-organic);
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-organic);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

/* TOOLTIPS */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--clr-black);
  color: var(--clr-white);
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

.tooltip:hover::before {
  opacity: 1;
}

/* BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-red {
  background: var(--clr-red-primary);
  color: var(--clr-white);
}

.badge-black {
  background: var(--clr-black);
  color: var(--clr-white);
}

.badge-outline {
  background: transparent;
  border: 2px solid var(--clr-red-primary);
  color: var(--clr-red-primary);
}

/* PROGRESS BAR */
.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 0, 0, 0.2);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-red);
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

/* ACCORDION */
.accordion {
  border: 2px solid rgba(255, 0, 0, 0.2);
  border-radius: var(--radius-organic);
  overflow: hidden;
}

.accordion-item {
  border-bottom: 1px solid rgba(255, 0, 0, 0.1);
}

.accordion-item:last-child {
  border-bottom: none;
}

.accordion-header {
  padding: 1.5rem;
  background: var(--clr-white);
  cursor: pointer;
  transition: background 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.accordion-header:hover {
  background: rgba(255, 0, 0, 0.05);
}

.accordion-content {
  padding: 0 1.5rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: var(--clr-white);
}

.accordion-item.active .accordion-content {
  padding: 1.5rem;
  max-height: 500px;
}

/* TABS */
.tabs {
  width: 100%;
}

.tab-list {
  display: flex;
  background: var(--clr-gray-light);
  border-radius: var(--radius-organic);
  padding: 0.5rem;
  margin-bottom: 2rem;
}

.tab-button {
  flex: 1;
  padding: 1rem;
  background: transparent;
  border: none;
  border-radius: calc(var(--radius-organic) - 0.5rem);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

.tab-button.active {
  background: var(--clr-white);
  color: var(--clr-red-primary);
  box-shadow: var(--shadow-organic);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* CARDS ADICIONALES */
.card-minimal {
  background: var(--clr-white);
  border-radius: var(--radius-organic);
  padding: 2rem;
  box-shadow: var(--shadow-organic);
  transition: var(--transition-smooth);
}

.card-minimal:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-float);
}

.card-highlight {
  background: var(--gradient-red);
  color: var(--clr-white);
  border-radius: var(--radius-organic);
  padding: 2rem;
  box-shadow: var(--shadow-organic);
}

/* AVATARS */
.avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--clr-red-primary);
}

.avatar-lg {
  width: 80px;
  height: 80px;
}

.avatar-sm {
  width: 30px;
  height: 30px;
  border-width: 2px;
}

/* DIVIDERS */
.divider {
  height: 3px;
  background: var(--gradient-red);
  border: none;
  border-radius: 2px;
  margin: 2rem 0;
}

.divider-text {
  position: relative;
  text-align: center;
  margin: 2rem 0;
}

.divider-text::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-red);
}

.divider-text span {
  background: var(--clr-white);
  padding: 0 1rem;
  color: var(--clr-black);
  font-weight: 600;
}

/* FORM STATES */
.form-error {
  border-color: #FF0000 !important;
  box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.2) !important;
}

.form-success {
  border-color: #00FF00 !important;
  box-shadow: 0 0 0 3px rgba(0, 255, 0, 0.2) !important;
}

.field-error {
  color: #FF0000;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}