/* Base styles and theme customization */
:root {
  --color-primary: #4F46E5;
  --color-primary-dark: #4338CA;
  --color-primary-light: #6366F1;
  --color-secondary: #3B82F6;
  --color-accent: #818CF8;
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-danger: #EF4444;
  --color-text: #1E293B;
  --color-text-muted: #64748B;
  --color-bg: #FFFFFF;
  --color-bg-alt: #F8FAFC;
  --color-border: #E2E8F0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --radius: 0.5rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
}

/* Skip to main content link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 100;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
}

/* Focus styles - highly visible for keyboard navigation */
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Ad slot container - responsive and clearly marked */
.ad-slot {
  min-height: 280px;
  background-color: var(--color-bg-alt);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin: 1.5rem 0;
}

.ad-slot::before {
  content: 'Advertisement';
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  opacity: 0.6;
}

/* Sticky footer layout */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

/* Button base styles */
button,
.btn {
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  transition: all 0.2s ease;
  font-weight: 500;
}

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

.btn-primary {
  background-color: var(--color-primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--color-primary-dark);
}

.btn-secondary {
  background-color: var(--color-secondary);
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background-color: #2563EB;
}

/* Input base styles */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="range"],
select,
textarea {
  font-family: inherit;
  font-size: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Card component */
.card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

/* Copy button feedback */
.copy-btn {
  position: relative;
}

.copy-btn.copied::after {
  content: 'Copied!';
  position: absolute;
  top: -2rem;
  right: 0;
  background: var(--color-success);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  animation: fadeInOut 2s ease;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0; transform: translateY(5px); }
  10%, 90% { opacity: 1; transform: translateY(0); }
}

/* Tool page layout */
.tool-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.tool-header {
  margin-bottom: 2rem;
}

.tool-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 0.5rem 0;
}

.tool-header p {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* Grid layouts */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Alert/message boxes */
.alert {
  padding: 1rem;
  border-radius: var(--radius);
  margin: 1rem 0;
  border-left: 4px solid;
}

.alert-success {
  background-color: #D1FAE5;
  border-color: var(--color-success);
  color: #065F46;
}

.alert-warning {
  background-color: #FEF3C7;
  border-color: var(--color-warning);
  color: #92400E;
}

.alert-danger {
  background-color: #FEE2E2;
  border-color: var(--color-danger);
  color: #991B1B;
}

.alert-info {
  background-color: #DBEAFE;
  border-color: var(--color-secondary);
  color: #1E40AF;
}

/* Utility classes */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none; }

/* Screen reader utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.focus\:not-sr-only:focus {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Responsive utilities */
@media (max-width: 640px) {
  .tool-container {
    padding: 1rem;
  }

  .tool-header h1 {
    font-size: 1.5rem;
  }

  .tool-header p {
    font-size: 1rem;
  }
}

/* Print styles */
@media print {
  .ad-slot,
  nav,
  footer,
  button {
    display: none;
  }
}

/* ==============================
   ToolStash.one Promotional Styles
   ============================== */

/* Promo Banner in Hero Section */
.promo-banner {
  background: linear-gradient(135deg, #eef2ff 0%, #faf5ff 100%);
  border: 2px solid #e0e7ff;
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
}

.promo-banner:hover {
  border-color: #c7d2fe;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.promo-banner-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

.promo-banner-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.promo-banner-text {
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
}

.promo-banner-text strong {
  color: #4f46e5;
  font-weight: 600;
}

.promo-banner-cta {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  border: none;
  padding: 0.625rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.promo-banner-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

@media (min-width: 768px) {
  .promo-banner {
    flex-direction: row;
    justify-content: space-between;
    padding: 1rem 1.5rem;
  }

  .promo-banner-content {
    text-align: left;
  }
}

/* Sticky Floating Badge */
.promo-badge {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 9999px;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 200px;
  transition: all 0.3s ease;
  animation: slideInUp 0.5s ease;
}

.promo-badge:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.5);
}

.promo-badge.hidden {
  display: none;
}

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

.promo-badge-close {
  position: absolute;
  top: -6px;
  right: -6px;
  background: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.promo-badge-close:hover {
  background: #fee2e2;
  transform: scale(1.1);
}

.promo-badge-close svg {
  width: 12px;
  height: 12px;
  color: #6b7280;
}

.promo-badge-content {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: white;
  flex: 1;
}

.promo-badge-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.promo-badge-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.promo-badge-text strong {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
}

.promo-badge-text small {
  font-size: 0.75rem;
  opacity: 0.9;
  line-height: 1.2;
}

/* Feature Card Promo in About Section */
.feature-promo {
  position: relative;
  padding: 1rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  border: 2px dashed #e9d5ff;
  transition: all 0.3s ease;
}

.feature-promo:hover {
  border-color: #d8b4fe;
  background: linear-gradient(135deg, #f3e8ff 0%, #ede9fe 100%);
}

.feature-card-cta {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.feature-card-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.trial-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Feature Modal */
.feature-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.feature-modal.hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.feature-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.feature-modal-container {
  position: relative;
  z-index: 1001;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideInScale 0.3s ease;
}

@keyframes slideInScale {
  from {
    transform: scale(0.95) translateY(20px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.feature-modal-content {
  background: white;
  border-radius: 1.5rem;
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  position: relative;
}

.feature-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #f3f4f6;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
}

.feature-modal-close:hover {
  background: #e5e7eb;
  transform: rotate(90deg);
}

.feature-modal-close svg {
  width: 20px;
  height: 20px;
  color: #6b7280;
}

.feature-modal-header {
  text-align: center;
  margin-bottom: 2rem;
}

.feature-modal-logo {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

.feature-modal-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.5rem 0;
}

.feature-modal-subtitle {
  font-size: 1rem;
  color: #6b7280;
  margin: 0;
}

.feature-modal-features {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.feature-modal-item {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  border-radius: 1rem;
  border: 2px solid #e5e7eb;
  transition: all 0.3s ease;
}

.feature-modal-item:hover {
  border-color: #c7d2fe;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  transform: translateX(4px);
}

.feature-modal-item-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.feature-modal-item-content h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 0.5rem 0;
}

.feature-modal-item-content p {
  font-size: 0.9rem;
  color: #6b7280;
  margin: 0;
  line-height: 1.6;
}

.feature-modal-pricing {
  text-align: center;
  padding: 1rem;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
}

.feature-modal-pricing-text {
  font-size: 0.95rem;
  color: #78350f;
  margin: 0;
}

.feature-modal-pricing-text strong {
  font-weight: 700;
  color: #92400e;
}

.feature-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.feature-modal-cta-primary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  text-decoration: none;
  padding: 0.875rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  transition: all 0.2s ease;
  border: none;
}

.feature-modal-cta-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.feature-modal-cta-secondary {
  background: white;
  color: #6366f1;
  text-decoration: none;
  padding: 0.875rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  border: 2px solid #e0e7ff;
  transition: all 0.2s ease;
}

.feature-modal-cta-secondary:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .promo-badge {
    bottom: 1rem;
    right: 1rem;
    max-width: 160px;
    padding: 0.625rem 0.875rem;
  }

  .promo-badge-text strong {
    font-size: 0.8rem;
  }

  .promo-badge-text small {
    font-size: 0.7rem;
  }

  .promo-banner {
    padding: 1rem;
  }

  .promo-banner-text {
    font-size: 0.875rem;
  }

  .feature-modal-content {
    padding: 2rem 1.5rem;
  }

  .feature-modal-title {
    font-size: 1.5rem;
  }

  .feature-modal-item {
    padding: 1rem;
  }
}
