/* ==========================================================================
   RustPress Enterprise Theme - Components
   ========================================================================== */

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--btn-padding-y) var(--btn-padding-x);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 100%);
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
}

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

.btn:active {
  transform: scale(0.98);
}

.btn svg {
  width: 16px;
  height: 16px;
  transition: transform var(--duration-fast) var(--ease-out);
}

.btn:hover svg {
  transform: translateX(2px);
}

/* Button Sizes */
.btn--sm {
  padding: var(--btn-padding-y-sm) var(--btn-padding-x-sm);
  font-size: var(--text-xs);
}

.btn--lg {
  padding: var(--btn-padding-y-lg) var(--btn-padding-x-lg);
  font-size: var(--text-base);
}

.btn--xl {
  padding: 1.25rem 2.5rem;
  font-size: var(--text-lg);
}

/* Primary Button */
.btn--primary {
  background: var(--gradient-rust);
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow-md), 0 0 0 0 var(--color-rust-glow);
}

.btn--primary:hover {
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: translateY(-2px);
}

/* Glow Effect */
.btn--glow {
  box-shadow: var(--shadow-glow);
  animation: btn-glow 2s ease-in-out infinite alternate;
}

@keyframes btn-glow {
  from {
    box-shadow: 0 0 20px var(--color-rust-glow), 0 0 40px rgba(206, 66, 43, 0.2);
  }
  to {
    box-shadow: 0 0 30px var(--color-rust-glow), 0 0 60px rgba(206, 66, 43, 0.3);
  }
}

/* Secondary Button */
.btn--secondary {
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  border-color: var(--border-color);
}

.btn--secondary:hover {
  background: var(--color-bg-hover);
  border-color: var(--border-color-hover);
}

/* Outline Button */
.btn--outline {
  background: transparent;
  color: var(--color-text-primary);
  border-color: var(--border-color);
}

.btn--outline:hover {
  background: var(--color-glass);
  border-color: var(--color-rust);
  color: var(--color-rust-light);
}

/* Outline Rust Button */
.btn--outline-rust {
  background: transparent;
  color: var(--color-rust);
  border-color: var(--color-rust);
}

.btn--outline-rust:hover {
  background: var(--color-rust);
  color: white;
}

/* Ghost Button */
.btn--ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border-color: transparent;
}

.btn--ghost:hover {
  background: var(--color-glass);
  color: var(--color-text-primary);
}

/* Link Button */
.btn--link {
  background: transparent;
  color: var(--color-rust-light);
  padding: 0;
  border: none;
}

.btn--link:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

/* Icon Button */
.btn--icon {
  padding: var(--space-3);
  border-radius: var(--radius-lg);
}

.btn--icon svg {
  width: 20px;
  height: 20px;
}

.btn--icon:hover svg {
  transform: none;
}

/* Block Button */
.btn--block {
  display: flex;
  width: 100%;
}

/* ========== Cards ========== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  transition: all var(--duration-normal) var(--ease-out);
}

.card:hover {
  border-color: var(--border-color-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.card--interactive:hover {
  border-color: var(--border-rust);
  box-shadow: var(--shadow-glow);
}

.card--glass {
  background: var(--color-glass);
  backdrop-filter: blur(20px);
  border-color: var(--color-glass-border);
}

.card--rust {
  background: linear-gradient(135deg, rgba(206, 66, 43, 0.1) 0%, rgba(233, 116, 81, 0.05) 100%);
  border-color: var(--border-rust);
}

.card__header {
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-color);
}

.card__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-2);
}

.card__description {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}

.card__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-rust);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  color: white;
}

.card__icon svg {
  width: 24px;
  height: 24px;
}

/* Feature Card */
.feature-card {
  padding: var(--space-8);
  text-align: center;
}

.feature-card__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-6);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(206, 66, 43, 0.2) 0%, rgba(233, 116, 81, 0.1) 100%);
  border: 1px solid var(--border-rust);
  border-radius: var(--radius-xl);
  color: var(--color-rust-light);
  transition: all var(--duration-normal) var(--ease-out);
}

.feature-card:hover .feature-card__icon {
  background: var(--gradient-rust);
  color: white;
  transform: scale(1.1);
  box-shadow: var(--shadow-glow);
}

.feature-card__icon svg {
  width: 28px;
  height: 28px;
}

.feature-card__title {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-3);
}

.feature-card__description {
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}

/* ========== Badges ========== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  border-radius: var(--radius-full);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--border-color);
}

.badge--rust {
  background: linear-gradient(135deg, rgba(206, 66, 43, 0.2) 0%, rgba(233, 116, 81, 0.1) 100%);
  border-color: var(--border-rust);
  color: var(--color-rust-light);
}

.badge--glow {
  box-shadow: var(--shadow-glow);
  animation: badge-glow 2s ease-in-out infinite alternate;
}

@keyframes badge-glow {
  from { box-shadow: 0 0 10px var(--color-rust-glow); }
  to { box-shadow: 0 0 20px var(--color-rust-glow); }
}

.badge--success {
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.3);
  color: var(--color-success);
}

.badge--new {
  background: var(--gradient-rust);
  color: white;
  border: none;
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: currentColor;
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

/* ========== Input Fields ========== */
.input-group {
  margin-bottom: var(--space-4);
}

.input-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  margin-bottom: var(--space-2);
  color: var(--color-text-secondary);
}

.input {
  width: 100%;
  padding: var(--input-padding-y) var(--input-padding-x);
  font-size: var(--text-base);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--input-radius);
  color: var(--color-text-primary);
  transition: all var(--duration-fast) var(--ease-out);
}

.input:focus {
  outline: none;
  border-color: var(--input-border-focus);
  box-shadow: 0 0 0 3px var(--color-rust-glow);
}

.input::placeholder {
  color: var(--color-text-muted);
}

.input--error {
  border-color: var(--color-error);
}

.input--success {
  border-color: var(--color-success);
}

textarea.input {
  min-height: 120px;
  resize: vertical;
}

/* ========== Select ========== */
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23707070' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

/* ========== Checkbox & Radio ========== */
.checkbox,
.radio {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}

.checkbox input,
.radio input {
  width: 20px;
  height: 20px;
  appearance: none;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.checkbox input {
  border-radius: var(--radius-sm);
}

.radio input {
  border-radius: 50%;
}

.checkbox input:checked,
.radio input:checked {
  background: var(--color-rust);
  border-color: var(--color-rust);
}

.checkbox input:checked::after {
  content: "";
  display: block;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
  margin: 2px auto;
}

.radio input:checked::after {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  margin: 5px;
}

/* ========== Toggle Switch ========== */
.toggle {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}

.toggle__switch {
  width: 48px;
  height: 26px;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-full);
  position: relative;
  transition: background var(--duration-fast) var(--ease-out);
}

.toggle__switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform var(--duration-fast) var(--ease-out);
}

.toggle input {
  display: none;
}

.toggle input:checked + .toggle__switch {
  background: var(--color-rust);
}

.toggle input:checked + .toggle__switch::after {
  transform: translateX(22px);
}

/* ========== Avatar ========== */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--gradient-rust);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--weight-semibold);
  color: white;
}

.avatar--sm { width: 32px; height: 32px; font-size: var(--text-sm); }
.avatar--lg { width: 56px; height: 56px; font-size: var(--text-lg); }
.avatar--xl { width: 80px; height: 80px; font-size: var(--text-2xl); }

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ========== Progress Bar ========== */
.progress {
  height: 8px;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  background: var(--gradient-rust);
  border-radius: var(--radius-full);
  transition: width var(--duration-slow) var(--ease-out);
}

.progress--glow .progress__bar {
  box-shadow: var(--shadow-glow);
}

/* ========== Tooltip ========== */
.tooltip {
  position: relative;
}

.tooltip__content {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-fast) var(--ease-out);
  z-index: var(--z-tooltip);
}

.tooltip:hover .tooltip__content {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ========== Tag ========== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
}

.tag--rust {
  background: rgba(206, 66, 43, 0.2);
  color: var(--color-rust-light);
}

/* ========== Stat Card ========== */
.stat {
  text-align: center;
  padding: var(--space-6);
}

.stat__value {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  background: var(--gradient-rust);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: var(--space-2);
}

.stat__label {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

/* ========== Testimonial ========== */
.testimonial {
  padding: var(--space-8);
  text-align: center;
}

.testimonial__quote {
  font-size: var(--text-xl);
  font-style: italic;
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-6);
  color: var(--color-text-secondary);
}

.testimonial__quote::before {
  content: '"';
  font-size: var(--text-4xl);
  color: var(--color-rust);
  display: block;
  margin-bottom: var(--space-2);
}

.testimonial__author {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
}

.testimonial__name {
  font-weight: var(--weight-semibold);
}

.testimonial__role {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ========== Accordion ========== */
.accordion {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.accordion__item {
  border-bottom: 1px solid var(--border-color);
}

.accordion__item:last-child {
  border-bottom: none;
}

.accordion__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  font-weight: var(--weight-medium);
  text-align: left;
  background: transparent;
  transition: background var(--duration-fast) var(--ease-out);
}

.accordion__trigger:hover {
  background: var(--color-glass);
}

.accordion__trigger svg {
  width: 20px;
  height: 20px;
  transition: transform var(--duration-normal) var(--ease-out);
}

.accordion__item.active .accordion__trigger svg {
  transform: rotate(180deg);
}

.accordion__content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-normal) var(--ease-out);
}

.accordion__item.active .accordion__content {
  max-height: 500px;
}

.accordion__body {
  padding: 0 var(--space-6) var(--space-4);
  color: var(--color-text-secondary);
}

/* ========== Tabs ========== */
.tabs {
  border-bottom: 1px solid var(--border-color);
}

.tabs__list {
  display: flex;
  gap: var(--space-1);
}

.tabs__trigger {
  padding: var(--space-3) var(--space-6);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  border-bottom: 2px solid transparent;
  transition: all var(--duration-fast) var(--ease-out);
  margin-bottom: -1px;
}

.tabs__trigger:hover {
  color: var(--color-text-primary);
}

.tabs__trigger.active {
  color: var(--color-rust);
  border-bottom-color: var(--color-rust);
}

.tabs__content {
  padding: var(--space-6) 0;
}

.tabs__panel {
  display: none;
}

.tabs__panel.active {
  display: block;
  animation: fadeIn var(--duration-normal) var(--ease-out);
}

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