/* === MAIN-SITE.CSS - Styles for Main Scanner Page === */

/* Detail list styles - ensure proper layout */
#detailedResults dl {
  margin-bottom: 1rem;
}

#detailedResults .detail-item {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

#detailedResults .detail-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

#detailedResults dt {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

#detailedResults dd {
  margin: 0;
  margin-left: 0;
}

/* Redirect Chain Info Styles */
.redirect-info {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  padding: 1.25rem;
  background: var(--bg-warning-light, #fffbf0);
  border: 1px solid var(--border-warning, #ffe082);
  border-radius: var(--radius-lg);
  animation: fadeIn 0.3s ease-out;
  clear: both;
}

.redirect-info h4 {
  margin: 0 0 0.75rem 0;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
}

.redirect-info h5 {
  margin: 1rem 0 0.5rem 0;
  color: var(--text-danger);
  font-size: 1rem;
  font-weight: 600;
}

.redirect-info p {
  margin: 0.5rem 0;
  color: var(--text-secondary);
}

.redirect-info code {
  background: rgba(0, 0, 0, 0.05);
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  word-break: break-all;
}

/* Redirect Chain Specific Styles */
.redirect-chain-info {
  margin-bottom: 1.25rem;
}

.redirect-chain-info.dangerous-redirect {
  background: rgba(220, 53, 69, 0.1);
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(220, 53, 69, 0.3);
}

.redirect-urls {
  margin: 1rem 0;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 0.375rem;
}

.redirect-urls p {
  margin: 0.5rem 0;
}

.redirect-arrow {
  font-size: 1.5rem;
  text-align: center;
  color: #666;
  margin: 0.75rem 0 !important;
}

.url-original, .url-final {
  padding: 0.2rem 0.5rem;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 0.25rem;
  font-size: 0.875rem;
  word-break: break-all;
}

.url-dangerous {
  background: rgba(220, 53, 69, 0.2);
  color: #dc3545;
  font-weight: 600;
}

.redirect-warning {
  color: #dc3545;
  font-weight: 600;
  margin-top: 0.75rem !important;
  text-align: center;
}

.suspicious-patterns {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.suspicious-patterns h5,
.phishing-indicators h5 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  color: #333;
}

.suspicious-patterns ul,
.phishing-indicators ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.patterns-list,
.indicators-list {
  max-height: 300px;
  overflow-y: auto;
}

.more-patterns,
.more-indicators {
  margin-top: 0.75rem;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 0.375rem;
  text-align: center;
  font-style: italic;
  color: #666;
  font-size: 0.875rem;
}

.suspicious-patterns li {
  padding: 0.5rem 0.75rem;
  margin: 0.5rem 0;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

/* Removed - now using unified severity styles above */

/* Phishing Indicators Styles */
.phishing-indicators {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Removed - now using unified h5 styles above */

.phishing-indicators ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.phishing-indicators li {
  padding: 0.75rem;
  margin: 0.5rem 0;
  border-radius: 0.5rem;
  font-size: 0.9rem;
}

/* Severity levels for phishing indicators */
.phishing-indicators li.severity-critical,
.suspicious-patterns li.severity-critical {
  background: #ffcdd2;
  color: #b71c1c;
  border-left: 4px solid #d32f2f;
  font-weight: 600;
}

.phishing-indicators li.severity-high,
.suspicious-patterns li.severity-high {
  background: #ffebee;
  color: #c62828;
  border-left: 3px solid #ef5350;
}

.phishing-indicators li.severity-medium,
.suspicious-patterns li.severity-medium {
  background: #fff8e1;
  color: #f57f17;
  border-left: 3px solid #ffc107;
}

.phishing-indicators li.severity-low,
.suspicious-patterns li.severity-low {
  background: #e8f5e9;
  color: #2e7d32;
  border-left: 3px solid #66bb6a;
}

.phishing-indicators li small {
  display: block;
  margin-top: 0.25rem;
  opacity: 0.9;
}

.phishing-indicators a {
  color: #1976d2;
  text-decoration: underline;
}

/* Phishing Warning Alert */
.phishing-warning {
  background: #d32f2f;
  color: white;
  padding: 1.5rem;
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
  text-align: center;
  animation: pulse 2s ease-in-out infinite;
}

.phishing-warning h4 {
  margin: 0 0 0.75rem 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.phishing-warning p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* Main Theme */
.theme-main {
  background: linear-gradient(135deg, var(--primary-orange) 0%, #ff9500 50%, var(--primary-orange-light) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow-x: hidden;
  scroll-padding-top: 2rem;
}

/* Particles.js container */
#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 0;
}

/* Main Container */
.theme-main .container {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: var(--blur-md);
  border-radius: var(--radius-2xl);
  padding: var(--spacing-xl);
  width: 100%;
  max-width: 720px;
  box-shadow: 
    0 32px 64px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.18);
  position: relative;
  animation: slideUp 0.8s ease-out;
  overflow-x: hidden;
  margin-bottom: 6rem;
  opacity: 1 !important; /* Fix per assicurare visibilità */
  z-index: 1; /* Sopra particles */
}

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

.theme-main .container:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 40px 80px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.2);
  transition: var(--transition-normal);
}

/* Header & Logo */
.header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.logo::before {
  font-size: 2.2rem;
  animation: pulse 2s ease-in-out infinite;
}

.theme-main .logo {
  background: linear-gradient(135deg, var(--primary-orange), var(--primary-orange-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.theme-main .logo::before {
  content: '🔍';
}

.subtitle {
  color: #64748b;
  font-size: 1.1rem;
  font-weight: 500;
  opacity: 0;
  animation: fadeIn 1s ease-out 0.3s forwards;
}

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

/* Scan Form */
.scan-form {
  margin-bottom: var(--spacing-xl);
}

.input-container {
  position: relative;
  margin-bottom: var(--spacing-lg);
}

.url-input {
  width: 100%;
  padding: 1.25rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-lg);
  background: #f8fafc;
  transition: var(--transition-normal);
  outline: none;
}

.url-input:focus {
  border-color: var(--primary-orange);
  background: white;
  box-shadow: 0 0 0 4px rgba(255, 120, 73, 0.1);
  transform: translateY(-1px);
}

.url-input:focus-visible {
  outline: 2px solid var(--primary-orange);
  outline-offset: 2px;
}

.url-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.url-input.valid {
  border-color: var(--success);
}

.url-input.invalid {
  border-color: var(--warning);
}

.scan-button {
  width: 100%;
  padding: 1.25rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--primary-orange) 0%, var(--primary-orange-dark) 100%);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.scan-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.6s;
}

.scan-button:hover::before {
  left: 100%;
}

.scan-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(255, 120, 73, 0.3);
}

.scan-button:active {
  transform: translateY(0);
}

.scan-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Loading States */
.loading {
  display: none;
  text-align: center;
  padding: var(--spacing-xl);
  animation: fadeInUp 0.5s ease-out;
}

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

.loading-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border: 4px solid #e2e8f0;
  border-top: 4px solid var(--primary-orange);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  color: #64748b;
  font-size: 1rem;
  font-weight: 500;
}

.loading-dots::after {
  content: '';
  animation: dots 1.5s linear infinite;
}

/* Results */
.result {
  display: none;
  padding: var(--spacing-xl);
  border-radius: var(--radius-xl);
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
  animation: resultSlide 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  border: none;
  backdrop-filter: var(--blur-sm);
  word-wrap: break-word;
  overflow-wrap: break-word;
  scroll-margin-top: 2rem;
  margin-bottom: 2rem;
}

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

.result.safe {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.95), rgba(34, 197, 94, 0.9));
  color: white;
  box-shadow: 0 20px 40px rgba(16, 185, 129, 0.3);
}

.result.unsafe,
.result.rate-limit {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(220, 38, 38, 0.9));
  color: white;
  box-shadow: 0 20px 40px rgba(239, 68, 68, 0.3);
}

.result.warning {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.95), rgba(245, 158, 11, 0.9));
  color: white;
  box-shadow: 0 20px 40px rgba(251, 191, 36, 0.3);
}

.result.loading {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.95), rgba(217, 119, 6, 0.9));
  color: white;
  box-shadow: 0 20px 40px rgba(245, 158, 11, 0.3);
}

.result-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
  animation: bounce 1s ease-in-out;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

.result-text {
  margin-bottom: 0.75rem;
  position: relative;
  z-index: 10;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.result-details {
  font-size: 1rem;
  opacity: 0.9;
  font-weight: 400;
  position: relative;
  z-index: 10;
}

/* Result Details Expanded */
.result-details-expanded {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: var(--blur-sm);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  margin-top: var(--spacing-md);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: var(--shadow-sm);
  display: none;
  scroll-margin-top: 2rem;
  margin-bottom: 1.5rem;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.4;
  color: #1e293b;
}

.detail-item strong {
  color: #374151;
  font-weight: 600;
  min-width: 120px;
}

.detail-item span:last-child {
  color: #6b7280;
  text-align: right;
  font-weight: 500;
}

/* Score System */
.score-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 0.75rem;
  position: relative;
  z-index: 10;
  border: 1px solid;
}

.score-safe {
  background: rgba(16, 185, 129, 0.15);
  color: #065f46;
  border-color: rgba(16, 185, 129, 0.3);
}

.score-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.3);
}

.score-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #991b1b;
  border-color: rgba(239, 68, 68, 0.3);
}

/* Score Legend */
.score-section {
  margin-top: var(--spacing-md);
  padding-top: var(--spacing-md);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.score-legend {
  margin-top: var(--spacing-md);
  padding: var(--spacing-md);
  background: rgba(248, 250, 252, 0.8);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(226, 232, 240, 0.5);
}

.score-legend h5 {
  margin-bottom: 0.75rem;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 600;
}

.legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.5rem;
}

.legend-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.legend-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.legend-item.excellent {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.legend-item.good {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.legend-item.fair {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.legend-item.warning {
  background: rgba(251, 146, 60, 0.1);
  border: 1px solid rgba(251, 146, 60, 0.3);
}

.legend-item.danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.legend-icon {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.legend-range {
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.125rem;
}

.legend-desc {
  color: #6b7280;
  font-size: 0.6875rem;
}

/* Security Tips */
.security-tips {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  margin-top: var(--spacing-md);
  box-shadow: var(--shadow-sm);
  display: none;
  backdrop-filter: var(--blur-sm);
  scroll-margin-top: 2rem;
  margin-bottom: 2rem;
}

.security-tips h4 {
  margin-bottom: var(--spacing-md);
  color: #1e40af;
  font-size: 1rem;
  font-weight: 600;
}

.security-tips p {
  color: #1e293b;
  line-height: 1.6;
  margin-bottom: var(--spacing-sm);
  font-size: 0.875rem;
}

.security-tips ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: var(--spacing-md);
}

.security-tips li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  color: #374151;
  font-size: 0.875rem;
  line-height: 1.5;
}

.security-tips li::before {
  content: '🛡️';
  position: absolute;
  left: 0;
  top: 0;
  font-size: 1rem;
}

/* Understood Button */
.understood-button {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-normal);
  margin-top: var(--spacing-md);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  z-index: 1000;
  pointer-events: auto !important;
}

.understood-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.understood-button:active {
  transform: translateY(0);
}

/* Refresh variant button */
.understood-button.refresh-variant {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  margin-left: 10px;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.understood-button.refresh-variant:hover {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* Unsafe variant */
.understood-button.unsafe {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

.understood-button.unsafe:hover {
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* Footer */
footer, .footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: var(--blur-md);
  padding: 0.75rem 0;
  text-align: center;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  z-index: 1000;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05);
  display: block !important; /* Assicura visibilità */
}

footer p {
  color: #64748b;
  font-size: 0.75rem;
  margin: 0;
}

footer a {
  color: var(--primary-orange);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-fast);
}

footer a:hover {
  text-decoration: underline;
}

/* Mobile Optimizations */
@media (max-width: 640px) {
  .theme-main {
    padding: 10px;
  }
  
  .theme-main .container {
    padding: var(--spacing-lg);
    margin-bottom: 5rem;
  }
  
  .logo {
    font-size: 2rem;
  }
  
  .subtitle {
    font-size: 1rem;
  }
  
  .scan-button {
    padding: 1rem;
    font-size: 1rem;
  }
  
  .result {
    font-size: 1.125rem;
    padding: var(--spacing-lg);
  }
  
  .result-icon {
    font-size: 2.5rem;
  }
}

/* CTA Section Styles */
.cta-section {
  margin-top: 2rem;
  animation: fadeInUp 0.5s ease-out;
}

.cta-content {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: var(--transition-normal);
}

.cta-content:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.1);
}

.cta-content.password-variant {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-color: #f59e0b;
}

.cta-content.security-variant {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: #3b82f6;
}

.cta-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.cta-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.cta-description {
  font-size: 1rem;
  color: #64748b;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  background: var(--primary-orange);
  color: white;
  border-radius: var(--radius-lg);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-normal);
  box-shadow: 0 4px 6px rgba(255, 120, 73, 0.2);
}

.cta-button:hover {
  background: var(--primary-orange-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 12px rgba(255, 120, 73, 0.3);
}

.cta-arrow {
  font-size: 1.25rem;
  transition: transform 0.3s ease;
}

.cta-button:hover .cta-arrow {
  transform: translateX(4px);
}

/* Footer Legal Links */
.footer-legal-links {
  margin-top: 0.5rem;
  font-size: 0.9em;
}

.footer-legal-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-legal-links a:hover {
  color: var(--primary-orange);
  text-decoration: underline;
}