/* Button Components (Modern) - Custom Design */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro", sans-serif;
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
  border: none;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  /* Custom crisp edges - slightly angular */
  clip-path: polygon(
    0 0,
    calc(100% - 4px) 0,
    100% 4px,
    100% 100%,
    4px 100%,
    0 calc(100% - 4px)
  );
  transition: transform 0.12s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.12s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.15s ease;
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.15s ease;
}

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

.btn:focus {
  outline: none;
}

.btn:focus-visible {
  outline: 2px solid #5B8DEF;
  outline-offset: 3px;
}

/* Primary Button - Bold, confident, with strong shadow */
.btn-primary {
  background: linear-gradient(135deg, #5B8DEF 0%, #4A7AD8 100%);
  color: var(--ui-text);
  box-shadow: 
    0 4px 12px rgba(91, 141, 239, 0.45),
    0 2px 4px rgba(74, 122, 216, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4A7AD8 0%, #3D6BC4 100%);
  box-shadow: 
    0 6px 16px rgba(91, 141, 239, 0.55),
    0 3px 6px rgba(74, 122, 216, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-2px) scale(1.02);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 
    0 2px 6px rgba(91, 141, 239, 0.5),
    0 1px 2px rgba(74, 122, 216, 0.4),
    inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* Secondary Button - Outlined with subtle glow */
.btn-secondary {
  background-color: transparent;
  color: #5B8DEF;
  border: 2px solid #5B8DEF;
  box-shadow: 
    0 0 0 0 rgba(91, 141, 239, 0),
    inset 0 0 0 0 rgba(91, 141, 239, 0);
  position: relative;
}

.btn-secondary::after {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border: 2px solid #5B8DEF;
  opacity: 0;
  filter: blur(4px);
  transition: opacity 0.2s ease;
}

.btn-secondary:hover {
  background-color: rgba(91, 141, 239, 0.1);
  border-color: #6B9DFF;
  color: #6B9DFF;
  transform: translateY(-1px);
}

.btn-secondary:hover::after {
  opacity: 0.6;
}

.btn-secondary:active {
  transform: translateY(0) scale(0.98);
  background-color: rgba(74, 140, 255, 0.15);
}

/* Ghost Button - Minimal, text-focused */
.btn-ghost {
  background-color: transparent;
  color: var(--ui-muted);
  border: none;
  padding: 10px 16px;
  position: relative;
}

.btn-ghost::after {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 16px;
  right: 16px;
  height: 2px;
  background-color: #5B8DEF;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-ghost:hover {
  color: var(--ui-text);
  background-color: rgba(255, 255, 255, 0.04);
}

.btn-ghost:hover::after {
  transform: scaleX(1);
}

.btn-ghost:active {
  transform: scale(0.96);
  background-color: rgba(255, 255, 255, 0.08);
}

/* Destructive Button - Warning with intensity */
.btn-destructive {
  background: linear-gradient(135deg, #D85C5C 0%, #C44A4A 100%);
  color: var(--ui-text);
  box-shadow: 
    0 4px 12px rgba(216, 92, 92, 0.45),
    0 2px 4px rgba(196, 74, 74, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.btn-destructive:hover {
  background: linear-gradient(135deg, #C44A4A 0%, #B03D3D 100%);
  box-shadow: 
    0 6px 16px rgba(216, 92, 92, 0.55),
    0 3px 6px rgba(196, 74, 74, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform: translateY(-2px) scale(1.02);
}

.btn-destructive:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 
    0 2px 6px rgba(216, 92, 92, 0.5),
    0 1px 2px rgba(196, 74, 74, 0.4),
    inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* Action Button - Small, simple, for positive actions */
.btn-action {
  padding: 6px 14px;
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.01em;
  background-color: #7BADFF;
  color: var(--ui-text);
  box-shadow: 
    0 2px 6px rgba(123, 173, 255, 0.3),
    0 1px 2px rgba(123, 173, 255, 0.2);
  clip-path: polygon(
    0 0,
    calc(100% - 3px) 0,
    100% 3px,
    100% 100%,
    3px 100%,
    0 calc(100% - 3px)
  );
}

.btn-action:hover {
  background-color: #6B9DFF;
  box-shadow: 
    0 3px 8px rgba(123, 173, 255, 0.4),
    0 1px 3px rgba(123, 173, 255, 0.3);
  transform: translateY(-1px) scale(1.01);
}

.btn-action:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 
    0 1px 4px rgba(123, 173, 255, 0.3),
    0 1px 2px rgba(123, 173, 255, 0.2);
}

.btn-action:focus-visible {
  outline: 2px solid #7BADFF;
  outline-offset: 2px;
}

/* Icon Button - Subtle, appears on hover */
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  background-color: transparent;
  color: var(--ui-muted);
  opacity: 0.5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  clip-path: none;
  position: relative;
  transition: opacity 0.2s ease, 
              background-color 0.2s ease,
              transform 0.12s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-icon::before {
  display: none;
}

.btn-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.2s ease, height 0.2s ease;
}

.btn-icon:hover {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--ui-text);
  transform: scale(1.1);
}

.btn-icon:hover::after {
  width: 100%;
  height: 100%;
}

.btn-icon:active {
  transform: scale(0.95);
  background-color: rgba(255, 255, 255, 0.12);
}

.btn-icon:focus-visible {
  outline: 2px solid #5B8DEF;
  outline-offset: 2px;
  opacity: 1;
}

.btn-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  position: relative;
  z-index: 1;
}

