/* Custom styles for Invoice Generator */
/* Note: Using plain CSS since Tailwind is loaded via CDN (no build process) */

/* Hide elements until Alpine.js initializes */
[x-cloak] {
  display: none !important;
}

/* Invoice preview styling */
.invoice-preview {
  background: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Form input styling */
.form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  transition: all 0.15s ease;
}

.form-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.25rem;
}

/* Line items table */
.line-items-table {
  width: 100%;
  border-collapse: collapse;
}

.line-items-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.line-items-table td {
  padding: 0.5rem 0;
}

/* Button styles */
.btn-primary {
  padding: 0.75rem 1.5rem;
  background-color: #2563eb;
  color: white;
  font-weight: 600;
  border-radius: 0.5rem;
  transition: all 0.15s ease;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: #1d4ed8;
}

.btn-primary:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.3);
}

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

.btn-secondary {
  padding: 0.5rem 1rem;
  background-color: #f3f4f6;
  color: #374151;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.15s ease;
  border: none;
  cursor: pointer;
}

.btn-secondary:hover {
  background-color: #e5e7eb;
}

.btn-secondary:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(156, 163, 175, 0.3);
}

.btn-premium {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(to right, #9333ea, #4f46e5);
  color: white;
  font-weight: 600;
  border-radius: 0.5rem;
  transition: all 0.15s ease;
  border: none;
  cursor: pointer;
}

.btn-premium:hover {
  background: linear-gradient(to right, #7e22ce, #4338ca);
}

.btn-premium:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(147, 51, 234, 0.3);
}

.btn-danger {
  padding: 0.25rem 0.5rem;
  color: #dc2626;
  background: transparent;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-danger:hover {
  background-color: #fef2f2;
}

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

/* Premium badge */
.premium-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: linear-gradient(to right, #f3e8ff, #e0e7ff);
  color: #7c3aed;
  border-radius: 9999px;
}

/* Ad container styling */
.ad-container {
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem;
  text-align: center;
  min-height: 90px;
}

.ad-container.hidden-premium {
  display: none;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid white;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Invoice templates */
.template-classic .invoice-header {
  border-bottom: 2px solid #1f2937;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.template-modern .invoice-header {
  background-color: #2563eb;
  color: white;
  padding: 1.5rem;
  margin: -2rem -2rem 1.5rem -2rem;
  border-radius: 0.5rem 0.5rem 0 0;
}

.template-minimal .invoice-header {
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .invoice-preview {
    transform: scale(0.85);
    transform-origin: top center;
  }
}

@media (max-width: 768px) {
  .invoice-preview {
    transform: scale(0.7);
    transform-origin: top center;
  }
}

/* Print styles for PDF */
@media print {
  .no-print {
    display: none !important;
  }

  .invoice-preview {
    box-shadow: none;
    margin: 0;
    padding: 20mm;
  }
}

/* Logo upload styling */
.logo-upload {
  border: 2px dashed #d1d5db;
  border-radius: 0.5rem;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.logo-upload:hover {
  border-color: #3b82f6;
}

.logo-upload.has-logo {
  border-style: solid;
  border-color: #e5e7eb;
}

.logo-preview {
  max-width: 100%;
  max-height: 6rem;
  object-fit: contain;
  margin: 0 auto;
}

/* Currency selector */
.currency-selector {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background-color: white;
  transition: all 0.15s ease;
}

.currency-selector:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Template selector */
.template-option {
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.15s ease;
  background: white;
}

.template-option:hover {
  border-color: #93c5fd;
}

.template-option.selected {
  border-color: #2563eb;
  background-color: #eff6ff;
}

/* Pricing cards */
.pricing-card {
  background-color: white;
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
  border: 2px solid transparent;
  transition: all 0.15s ease;
}

.pricing-card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.pricing-card.recommended {
  border-color: #a855f7;
  position: relative;
}

.pricing-card.recommended::before {
  content: 'Best Value';
  position: absolute;
  top: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.25rem 0.75rem;
  background-color: #a855f7;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 9999;
}

.toast.success {
  background-color: #10b981;
  color: white;
}

.toast.error {
  background-color: #ef4444;
  color: white;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Focus visible for accessibility */
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #3b82f6, 0 0 0 4px rgba(59, 130, 246, 0.3);
}

/* Prose styles for legal pages */
.prose h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.prose p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.prose ul {
  margin-bottom: 1rem;
}

.prose li {
  margin-bottom: 0.5rem;
}
