/*
 * LinkShield SaaS - Component Stylesheet
 * Toast System, Generator Widget, Click Gateway, Accordion, Cards & Animations
 */

/* ==========================================================================
   Toast Notification System
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
  max-width: 400px;
  width: calc(100% - 3rem);
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--bg-card-border);
  box-shadow: var(--shadow-lg);
  color: var(--text-main);
  font-size: 0.925rem;
  font-weight: 500;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-success .toast-icon { background: rgba(16, 185, 129, 0.15); color: var(--success); }

.toast-error { border-left: 4px solid var(--error); }
.toast-error .toast-icon { background: rgba(239, 68, 68, 0.15); color: var(--error); }

.toast-warning { border-left: 4px solid var(--warning); }
.toast-warning .toast-icon { background: rgba(245, 158, 11, 0.15); color: var(--warning); }

.toast-info { border-left: 4px solid var(--info); }
.toast-info .toast-icon { background: rgba(59, 130, 246, 0.15); color: var(--info); }

.toast-message { flex-grow: 1; line-height: 1.4; }

/* ==========================================================================
   Hero & SafeLink Generator Card
   ========================================================================== */
.hero-wrapper {
  padding-top: calc(var(--header-height) + 3rem);
  padding-bottom: 5rem;
  position: relative;
  text-align: center;
}

.hero-title {
  max-width: 900px;
  margin: 1.5rem auto 1.25rem;
}

.hero-subtitle {
  max-width: 680px;
  margin: 0 auto 3rem;
  font-size: 1.2rem;
  line-height: 1.6;
}

.generator-card {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
  text-align: left;
  border-radius: 20px;
}

.generator-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--gradient-accent);
}

.input-group {
  display: flex;
  gap: 0.75rem;
  position: relative;
  margin-bottom: 1.5rem;
}

.url-input-wrapper {
  position: relative;
  flex-grow: 1;
}

.url-input-wrapper > svg {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  transition: var(--transition-fast);
  pointer-events: none;
}

.url-input {
  width: 100%;
  height: 60px;
  padding: 0 4.25rem 0 3.25rem;
  background: var(--bg-input);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 1.05rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition-normal);
}

.url-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
}

.url-input:focus ~ svg {
  color: var(--primary);
}

/* Paste Button Icon Only */
.paste-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-input);
  border: 1px solid var(--bg-card-border);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  z-index: 2;
}

.paste-btn svg {
  position: static !important;
  transform: none !important;
  display: block;
  flex-shrink: 0;
}

.paste-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFF;
}

/* Result Box */
.result-container {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--primary-glow);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 1.5rem;
  animation: fadeIn 0.4s ease;
}

.result-container.active {
  display: block;
}

.result-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.result-box {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px dashed var(--primary-glow);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  min-height: 76px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

.result-url {
  width: 100%;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--secondary);
  word-break: break-all;
  overflow-wrap: anywhere;
  white-space: normal;
}

/* Action Toolbar Grid */
.result-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.btn-action {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--bg-card-border);
  background: var(--bg-input);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn-action:hover {
  background: var(--bg-card-hover);
  border-color: rgba(99, 102, 241, 0.3);
  color: var(--text-main);
}

.btn-copy {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFF;
}

.btn-copy:hover {
  background: var(--primary-hover);
}

.btn-open {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--secondary);
}

.btn-open:hover {
  background: rgba(16, 185, 129, 0.25);
  color: #FFF;
}

.btn-share {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.3);
  color: var(--accent);
}

.btn-share:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #FFF;
}

.btn-clear {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}

.btn-clear:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--error);
}

.preview-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--secondary);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

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

@media (max-width: 480px) {
  .result-actions-grid {
    grid-template-columns: 1fr;
  }
}

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

/* ==========================================================================
   Click-to-Open Verification Gateway Component
   ========================================================================== */
.click-gateway-wrapper {
  max-width: 680px;
  margin: 3rem auto;
  padding: 3rem 2.5rem;
  text-align: center;
  position: relative;
}

.gateway-badge-shield {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  background: var(--gradient-glass);
  border: 1px solid var(--bg-card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px var(--primary-glow);
}

.progress-container {
  margin: 2.5rem 0;
}

.progress-counter-text {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.progress-counter-text span {
  color: var(--secondary);
}

.progress-bar-outer {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--bg-card-border);
}

.progress-bar-inner {
  height: 100%;
  width: 0%;
  background: var(--gradient-accent);
  border-radius: var(--radius-full);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 15px var(--secondary-glow);
}

.step-instruction {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.verify-action-btn {
  width: 100%;
  max-width: 440px;
  height: 64px;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 auto;
  border-radius: var(--radius-md);
  box-shadow: 0 0 35px var(--primary-glow);
}

.trust-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--bg-card-border);
}

.trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.trust-item svg {
  color: var(--secondary);
}

/* ==========================================================================
   Feature Cards & Grid Layout
   ========================================================================== */
.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 4rem;
}

.section-header p {
  margin-top: 1rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.feature-card {
  padding: 2.25rem;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.feature-card h3 {
  font-size: 1.3rem;
}

/* ==========================================================================
   FAQ Accordion Component
   ========================================================================== */
.faq-container {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  overflow: hidden;
  transition: var(--transition-fast);
}

.faq-question {
  width: 100%;
  padding: 1.5rem 1.75rem;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.1rem;
  font-weight: 600;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  outline: none;
}

.faq-icon {
  transition: transform 0.3s ease;
  color: var(--text-muted);
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
  color: var(--primary);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 1.75rem;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
}

.faq-item.active .faq-answer {
  max-height: 500px;
  padding: 0 1.75rem 1.5rem 1.75rem;
}

/* ==========================================================================
   Statistics & Testimonials
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
  margin: 4rem 0;
}

.stat-card {
  padding: 2rem 1rem;
}

.stat-number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.testimonial-card {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #FFF;
}

/* ==========================================================================
   Error Pages & Legal Article Templates
   ========================================================================== */
.error-page-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-height) + 3rem) 1.5rem 4rem 1.5rem;
  text-align: center;
}

.error-card {
  max-width: 600px;
  width: 100%;
  padding: 3.5rem 2.5rem;
}

.error-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-main);
  line-height: 1.25;
}

.nav-action-btn {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.error-code {
  font-size: 6rem;
  font-weight: 800;
  line-height: 1;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}

.legal-content-wrapper {
  max-width: 860px;
  margin: 0 auto;
  padding: calc(var(--header-height) + 3rem) 1.5rem 4rem 1.5rem;
}

.legal-article h1 { margin-bottom: 1.5rem; }
.legal-article h2 { margin: 2.5rem 0 1rem 0; font-size: 1.75rem; color: var(--text-main); }
.legal-article p { margin-bottom: 1.25rem; font-size: 1.05rem; line-height: 1.8; }
.legal-article ul { margin: 1rem 0 1.5rem 2rem; color: var(--text-muted); }
.legal-article li { margin-bottom: 0.5rem; }

/* Mobile & Tablet Adaptations */
@media (max-width: 992px) {
  .result-actions-grid { grid-template-columns: repeat(2, 1fr); }
  .features-grid, .testimonials-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .input-group { flex-direction: column; }
  .url-input { height: 54px; }
}

@media (max-width: 600px) {
  .result-actions-grid { grid-template-columns: 1fr; }
  .features-grid, .testimonials-grid { grid-template-columns: 1fr; }
  .brand-logo img {
    max-width: 140px;
    height: auto;
  }
  .nav-action-btn {
    padding: 0.45rem 0.75rem !important;
    font-size: 0.82rem !important;
    gap: 0.35rem !important;
  }
  .error-card {
    padding: 2.25rem 1.25rem;
  }
  .error-title {
    font-size: 1.35rem !important;
    line-height: 1.3;
    margin-bottom: 0.75rem;
  }
  .error-code {
    font-size: 4.25rem;
  }
  .trust-features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem 1rem;
  }
  .trust-features-grid .trust-item:nth-child(3) {
    grid-column: 1 / -1;
    justify-self: center;
  }
  .generator-card { padding: 1.5rem; }
  .click-gateway-wrapper { padding: 2rem 1.25rem; }
  .stats-grid { grid-template-columns: 1fr; }
}
