/*
 * Honeyporch Design System
 * 
 * Component classes for consistent styling across the application.
 * Compatible with Tailwind CSS v4
 */

/* ========================================
   BUTTONS
   ======================================== */

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--color-honey-300),
    var(--color-honey-400)
  );
  color: white;
  font-weight: 600;
  padding: 0.625rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-glow-honey);
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

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

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

.btn-primary:disabled:hover {
  transform: translateY(0);
}

.btn-secondary {
  border: 2px solid var(--color-blue-400);
  color: var(--color-blue-400);
  background: white;
  font-weight: 600;
  padding: 0.625rem 1.5rem;
  border-radius: 0.5rem;
  transition: all 0.2s;
  cursor: pointer;
}

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

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

.btn-ghost {
  color: var(--color-text-main);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: colors 0.2s;
  border: none;
  background: transparent;
  cursor: pointer;
}

.btn-ghost:hover {
  background: #f3f4f6;
}

.btn-danger {
  background: #ef4444;
  color: white;
  font-weight: 600;
  padding: 0.625rem 1.5rem;
  border-radius: 0.5rem;
  transition: colors 0.2s;
  border: none;
  cursor: pointer;
}

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

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

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* ========================================
   CARDS
   ======================================== */

.card {
  background: white;
  border-radius: 0.75rem;
  border: 1px solid #f3f4f6;
  box-shadow: var(--shadow-card);
}

.card-hover {
  background: white;
  border-radius: 0.75rem;
  border: 1px solid #f3f4f6;
  box-shadow: var(--shadow-card);
  transition: all 0.2s;
  cursor: pointer;
}

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

.card-padding {
  padding: 1.5rem;
}

/* ========================================
   BADGES
   ======================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 0.25rem;
}

.badge-blue {
  background: #f0f7ff;
  color: var(--color-blue-400);
}

.badge-green {
  background: #ecfdf5;
  color: #059669;
}

.badge-orange {
  background: #fff7ed;
  color: #ea580c;
}

.badge-red {
  background: #fef2f2;
  color: #dc2626;
}

.badge-peach {
  background: var(--color-blue-50);
  color: var(--color-blue-400);
}

/* ========================================
   FORM INPUTS
   ======================================== */

.input {
  width: 100%;
  padding: 0.625rem 1rem;
  padding-left: 1rem; /* Default left padding, can be overridden with Tailwind pl-* classes */
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  background: rgba(249, 250, 251, 0.5);
  transition: all 0.2s;
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
  font-weight: 400;
}

.input:focus {
  outline: none;
  border-color: var(--color-honey-300);
  background: white;
  box-shadow: 0 0 0 3px rgba(255, 179, 71, 0.1);
}

/* Handle browser autofill styling - CRITICAL FOR CONSISTENT FONTS */
.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus,
.input:-webkit-autofill:active {
  -webkit-text-fill-color: #2d3436 !important;
  -webkit-box-shadow: 0 0 0 1000px rgba(249, 250, 251, 0.5) inset !important;
  box-shadow: 0 0 0 1000px rgba(249, 250, 251, 0.5) inset !important;
  font-family: "Montserrat", sans-serif !important;
  font-size: 1rem !important;
  font-weight: 400 !important;
  transition: background-color 5000s ease-in-out 0s !important;
  caret-color: #2d3436 !important;
  /* Force immediate application of font styles */
  animation-name: autofill-fix;
  animation-duration: 0.001s;
  animation-fill-mode: both;
}

/* Target the actual text rendering in autofilled inputs */
.input:-webkit-autofill::first-line {
  font-family: "Montserrat", sans-serif !important;
  font-size: 1rem !important;
  font-weight: 400 !important;
  color: #2d3436 !important;
}

/* Keyframe to trigger style application */
@keyframes autofill-fix {
  from,
  to {
    font-family: "Montserrat", sans-serif;
  }
}

/* Firefox autofill */
.input:-moz-autofill,
.input:-moz-autofill:hover,
.input:-moz-autofill:focus {
  font-family: "Montserrat", sans-serif !important;
  font-size: 1rem !important;
  font-weight: 400 !important;
}

.input-error {
  width: 100%;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid #fca5a5;
  background: rgba(249, 250, 251, 0.5);
  transition: all 0.2s;
}

.input-error:focus {
  outline: none;
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
}

.textarea {
  width: 100%;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  background: rgba(249, 250, 251, 0.5);
  transition: all 0.2s;
  resize: none;
  font-family: "Montserrat", sans-serif;
}

.textarea:focus {
  outline: none;
  border-color: var(--color-honey-300);
  background: white;
  box-shadow: 0 0 0 3px rgba(255, 179, 71, 0.1);
}

.select {
  width: 100%;
  padding: 0.625rem 2.5rem 0.625rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  background: rgba(249, 250, 251, 0.5);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-size: 1.5rem;
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  appearance: none;
  transition: all 0.2s;
  font-family: "Montserrat", sans-serif;
}

.select:focus {
  outline: none;
  border-color: var(--color-honey-300);
  background-color: white;
  box-shadow: 0 0 0 3px rgba(255, 179, 71, 0.1);
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

.heading-display {
  font-family: "Playfair Display", serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--color-text-main);
  letter-spacing: -0.025em;
}

@media (min-width: 768px) {
  .heading-display {
    font-size: 3.75rem;
  }
}

.heading-page {
  font-family: "Playfair Display", serif;
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--color-text-main);
}

@media (min-width: 768px) {
  .heading-page {
    font-size: 3rem;
  }
}

.heading-section {
  font-family: "Playfair Display", serif;
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--color-text-main);
}

.heading-card {
  font-family: "Playfair Display", serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text-main);
}

.text-body {
  font-size: 1rem;
  color: var(--color-text-main);
  line-height: 1.625;
}

.text-muted {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.link {
  color: var(--color-blue-400);
  text-underline-offset: 2px;
  transition: colors 0.2s;
}

.link:hover {
  color: #5b7fa8;
  text-decoration: underline;
}

/* ========================================
   LAYOUT
   ======================================== */

.container-main {
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  width: 100%;
}

@media (min-width: 1024px) {
  .container-main {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.glass-panel {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(48px);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

/* ========================================
   BACKGROUNDS
   ======================================== */

.bg-grid {
  background-color: var(--color-cream);
  background-image:
    linear-gradient(90deg, rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}

.bg-glow {
  position: relative;
}

.bg-glow::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at 50% 30%,
    rgba(255, 179, 71, 0.08) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: -1;
}

/* ========================================
   NAVIGATION
   ======================================== */

.nav-bar {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(48px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  height: 4.5rem;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  border-bottom: 1px solid #f3f4f6;
}

.nav-item {
  color: var(--color-text-main);
  font-weight: 500;
  font-size: 0.875rem;
  transition: color 0.2s;
  text-decoration: none;
}

.nav-item:hover {
  color: var(--color-honey-400);
}

/* ========================================
   AVATARS
   ======================================== */

.avatar {
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: white;
}

.avatar-sm {
  width: 2rem;
  height: 2rem;
  font-size: 0.75rem;
}

.avatar-md {
  width: 2.5rem;
  height: 2.5rem;
  font-size: 0.875rem;
}

.avatar-lg {
  width: 3rem;
  height: 3rem;
  font-size: 1rem;
}

.avatar-xl {
  width: 4rem;
  height: 4rem;
  font-size: 1.125rem;
}

/* ========================================
   UTILITIES
   ======================================== */

.section-spacing {
  margin-bottom: 3rem;
}

@media (min-width: 1024px) {
  .section-spacing {
    margin-bottom: 4rem;
  }
}

.divider {
  border-top: 1px solid #f3f4f6;
}

.text-gradient-honey {
  background: linear-gradient(
    to right,
    var(--color-honey-300),
    var(--color-honey-400)
  );
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}
