/* ============================================
   KHOLI THE BAKER - UI COMPONENTS
   Buttons, Forms, Cards, Modals & More
   ============================================ */

/* ============================================
   BUTTONS - Apple Design Language
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

/* Primary Button - Anzac Gold */
.btn-primary {
  background: var(--anzac);
  color: var(--revolver);
}

.btn-primary:hover {
  background: var(--anzac-light);
  transform: scale(1.02);
  color: var(--revolver);
}

.btn-primary:active {
  background: var(--anzac-dark);
  transform: scale(0.98);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Secondary Button - Outline */
.btn-secondary {
  background: transparent;
  color: var(--revolver);
  border: 1px solid var(--anzac);
}

.btn-secondary:hover {
  background: rgba(217, 183, 72, 0.1);
  color: var(--revolver);
}

.btn-secondary:active {
  background: rgba(217, 183, 72, 0.2);
}

/* Tertiary Button - Ghost */
.btn-tertiary {
  background: transparent;
  color: var(--revolver);
  padding: 0.5rem 1rem;
}

.btn-tertiary:hover {
  background: rgba(27, 14, 28, 0.05);
  color: var(--revolver);
}

.btn-tertiary:active {
  background: rgba(27, 14, 28, 0.1);
}

/* Large Button - Apple Style */
.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

/* Small Button - Apple Style */
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
}

/* Icon Button */
.btn-icon {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
}

/* WhatsApp Button */
.btn-whatsapp {
  background: var(--success);
  color: var(--white);
}

.btn-whatsapp:hover {
  background: #1da34b;
  transform: scale(1.02);
  color: var(--white);
}

.btn-whatsapp:active {
  background: #168239;
  transform: scale(0.98);
}

/* Pulsing Button */
.btn-pulse {
  animation: pulseGlow 2s ease-in-out infinite;
}

/* Magnetic Button */
.btn-magnetic {
  transition: transform var(--duration-micro) ease-out;
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
  margin-bottom: var(--space-6);
}

.form-label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: 500;
  color: var(--chocolate);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--chocolate);
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  transition: all var(--duration-fast) var(--ease-out-quad);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--anzac);
  box-shadow: 0 0 0 4px rgba(217, 183, 72, 0.2);
  transform: translateY(-2px);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--gray-400);
}

.form-textarea {
  min-height: 150px;
  resize: vertical;
}

.form-select {
  cursor: pointer;
  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='%233B2F2F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  background-size: 20px;
  padding-right: var(--space-12);
}

/* Input with Icon */
.form-input-icon {
  position: relative;
}

.form-input-icon .form-input {
  padding-left: var(--space-12);
}

.form-input-icon .icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
}

/* Form Validation States */
.form-input.is-valid {
  border-color: var(--success);
  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='%2322C55E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  background-size: 20px;
  padding-right: var(--space-12);
}

.form-input.is-invalid {
  border-color: var(--error);
  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='%23EF4444' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='15' y1='9' x2='9' y2='15'%3E%3C/line%3E%3Cline x1='9' y1='9' x2='15' y2='15'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  background-size: 20px;
  padding-right: var(--space-12);
}

.form-error {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--error);
}

/* Form Checkbox & Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}

.form-check-input {
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-sm);
  appearance: none;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out-quad);
  position: relative;
}

.form-check-input:checked {
  background: var(--anzac);
  border-color: var(--anzac);
}

.form-check-input:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: var(--revolver);
  border-radius: 2px;
}

.form-check-label {
  font-size: var(--text-sm);
  color: var(--gray-600);
}

/* Range Slider */
.form-range {
  width: 100%;
  height: 6px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  appearance: none;
  cursor: pointer;
}

.form-range::-webkit-slider-thumb {
  appearance: none;
  width: 24px;
  height: 24px;
  background: var(--anzac);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all var(--duration-fast) var(--ease-out-quad);
}

.form-range::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-gold);
}

/* ============================================
   CARDS
   ============================================ */

.card {
  background: var(--white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--duration-normal) var(--ease-out-quad);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-image {
  position: relative;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out-quad);
}

.card:hover .card-image img {
  transform: scale(1.05);
}

.card-body {
  padding: var(--space-6);
}

.card-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
  color: var(--chocolate);
}

.card-text {
  color: var(--gray-600);
  margin-bottom: var(--space-4);
}

.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Product Card */
.product-card {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  text-align: center;
  transform-style: preserve-3d;
  perspective: 1000px;
}

.product-card-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-6);
  background: linear-gradient(135deg, var(--ecru-white) 0%, var(--ecru-dark) 100%);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.product-card-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
}

.product-card-description {
  font-size: var(--text-sm);
  color: var(--gray-600);
  margin-bottom: var(--space-6);
}

/* Testimonial Card */
.testimonial-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(217, 183, 72, 0.25);
}

.testimonial-quote {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--chocolate);
  margin-bottom: var(--space-6);
  line-height: 1.8;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.testimonial-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--anzac) 0%, var(--anzac-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--revolver);
}

.testimonial-name {
  font-weight: 600;
  color: var(--chocolate);
}

.testimonial-role {
  font-size: var(--text-sm);
  color: var(--gray-500);
}

/* Service Card */
.service-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-6);
  align-items: start;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
  transition: all var(--duration-normal) var(--ease-out-quad);
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.service-card-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--anzac) 0%, var(--anzac-light) 100%);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--revolver);
  flex-shrink: 0;
}

.service-card-content h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}

.service-card-content p {
  color: var(--gray-600);
  margin-bottom: var(--space-4);
}

/* ============================================
   BADGES & TAGS
   ============================================ */

.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: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-full);
}

.badge-gold {
  background: rgba(217, 183, 72, 0.2);
  color: var(--anzac-dark);
}

.badge-blush {
  background: rgba(255, 182, 193, 0.2);
  color: #D4848F;
}

.badge-butter {
  background: rgba(255, 225, 53, 0.2);
  color: #B8A02A;
}

/* ============================================
   ALERTS & NOTIFICATIONS
   ============================================ */

.alert {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: #166534;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #991B1B;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: #92400E;
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #1E40AF;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-6);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all var(--duration-normal) var(--ease-out-quad);
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(59, 47, 47, 0.6);
  backdrop-filter: blur(4px);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-normal) var(--ease-out-quad);
}

.modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-2xl);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  transition: all var(--duration-normal) var(--ease-out-quad);
}

.modal-overlay.is-active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--gray-100);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast) var(--ease-out-quad);
}

.modal-close:hover {
  background: var(--gray-200);
}

.modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  max-height: calc(90vh - 140px);
}

.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--gray-100);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-4);
}

/* ============================================
   LOADING STATES
   ============================================ */

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--ecru-dark);
  border-top-color: var(--anzac);
  border-radius: 50%;
  animation: spinSlow 1s linear infinite;
}

.loading-dots {
  display: flex;
  gap: var(--space-2);
}

.loading-dots span {
  width: 8px;
  height: 8px;
  background: var(--anzac);
  border-radius: 50%;
  animation: bounceIn 0.6s ease-in-out infinite alternate;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--ecru-dark) 25%,
    var(--ecru-light) 50%,
    var(--ecru-dark) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 1em;
  margin-bottom: var(--space-3);
}

.skeleton-title {
  height: 1.5em;
  width: 60%;
  margin-bottom: var(--space-4);
}

.skeleton-image {
  height: 200px;
  width: 100%;
}
