/*
 * =============================================================================
 * ERRORS.CSS
 * Phase 3a: error-pages + notification-settings + landingpage-enhancements + direct-link-ui → errors.css
 * =============================================================================
 * 
 * Consolidated CSS for error handling and enhancement features:
 * - Error pages (404, 500, 403, 400) with unified styling
 * - Notification settings interface with toggle switches
 * - Landing page scientific foundation enhancements
 * - Direct link UI for challenge access
 * 
 * Created: October 2025
 * Total lines consolidated: ~878 lines from 4 files
 */

/* =============================================================================
   SECTION 1: ERROR PAGES
   ============================================================================= */

/* Error Pages Styles */
/* Unified styling for 404, 500, 403, 400 error pages */

.error-page {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: var(--space-xl, 2rem);
}

.error-code {
    font-size: 6rem;
    font-weight: 800;
    color: var(--primary-500, #3b82f6);
    margin-bottom: var(--space-lg, 1.5rem);
    line-height: 1;
}

.error-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--gray-800, #1f2937);
    margin-bottom: var(--space-lg, 1.5rem);
}

.error-description {
    font-size: var(--font-size-lg, 1.125rem);
    color: var(--gray-600, #4b5563);
    margin-bottom: var(--space-xl, 2rem);
    max-width: 500px;
    line-height: 1.6;
}

.error-actions {
    display: flex;
    gap: var(--space-lg, 1.5rem);
    flex-wrap: wrap;
    justify-content: center;
}

/* Mobile Responsive for error pages */
@media (max-width: 768px) {
    .error-code {
        font-size: 4rem;
    }
    
    .error-title {
        font-size: 1.5rem;
    }
    
    .error-actions {
        flex-direction: column;
        align-items: center;
        gap: var(--space-md, 1rem);
    }
    
    .error-actions .btn {
        width: 100%;
        max-width: 250px;
    }
}

/* =============================================================================
   SECTION 2: NOTIFICATION SETTINGS
   ============================================================================= */

/* Notification Settings Styles */

.settings-page {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.settings-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
}

.settings-section {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.settings-section h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info {
    flex: 1;
    margin-right: 1rem;
}

.setting-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    color: var(--text-color);
}

.setting-info p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--muted-color);
    line-height: 1.4;
}

.setting-control {
    flex-shrink: 0;
}

/* Toggle Switch Styles for notifications */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #28a745;  /* Green color when active */
    box-shadow: 0 0 5px rgba(40, 167, 69, 0.3);
}

input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.toggle-slider:hover {
    background-color: #bbb;
}

input:checked + .toggle-slider:hover {
    background-color: #218838;  /* Darker green on hover when active */
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.4);
}

/* Email Settings Special Styling */
.email-section {
    background: linear-gradient(135deg, #f8f9ff, #fff);
    border-left: 4px solid var(--primary-color);
}

/* Email Categories Section States */
.email-categories-section {
    transition: all 0.3s ease;
}

.email-categories-section.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.email-categories-section.disabled .setting-item {
    cursor: not-allowed;
}

.email-categories-section.disabled .toggle-switch {
    cursor: not-allowed;
}

.email-categories-section.disabled h5 {
    color: #999 !important;
}

.email-categories-section.enabled {
    opacity: 1;
    pointer-events: auto;
}

.email-categories-section.enabled .setting-item {
    cursor: default;
}

.email-categories-section.enabled .toggle-switch {
    cursor: pointer;
}

/* Better visual feedback for disabled toggles */
.email-categories-section.disabled .toggle-slider {
    background-color: #e0e0e0 !important;
}

.email-categories-section.disabled .toggle-slider:before {
    background-color: #f5f5f5 !important;
}

.email-section .setting-item {
    background: rgba(255,255,255,0.7);
    border-radius: 0.25rem;
    padding: 1rem;
    margin: 0.5rem 0;
    border: 1px solid rgba(0,0,0,0.1);
}

/* Status Indicator */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

.status-active {
    background: #d1f2d1;
    color: #0d5016;
}

.status-inactive {
    background: #f2d1d1;
    color: #501616;
}

/* Action Buttons for settings */
.settings-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: center;
}

.btn-save {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-save:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-reset {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-reset:hover {
    background: #545b62;
}

.btn-test {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-test:hover {
    background: #138496;
}

/* Test Results */
.test-result {
    padding: 0.75rem;
    border-radius: 0.25rem;
    margin: 0.5rem 0;
    font-size: 0.875rem;
}

.test-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.test-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Recent Activity Preview */
.preview-section {
    background: #f8f9fa;
    border: 1px dashed var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-top: 2rem;
}

.preview-notification {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    padding: 0.75rem;
    margin: 0.5rem 0;
    font-size: 0.875rem;
}

.preview-notification.email {
    border-left: 4px solid #007bff;
    background: #f8f9ff;
}

/* Mobile Responsiveness for notification settings */
@media (max-width: 768px) {
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .setting-control {
        align-self: flex-end;
    }
    
    .settings-actions {
        flex-direction: column;
    }
}

/* =============================================================================
   SECTION 3: LANDING PAGE ENHANCEMENTS
   ============================================================================= */

/* Landingpage Enhancements - Wissenschaftliche Fundierung */
/* Erstellt: 2025-10-04 */

/* Hero Benefits Section (ersetzt hero-stats) */
.hero-benefits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid var(--gray-200);
}

.benefit-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  animation: fadeInUp 0.6s ease-out both;
}

.benefit-item:nth-child(1) { animation-delay: 0.2s; }
.benefit-item:nth-child(2) { animation-delay: 0.3s; }
.benefit-item:nth-child(3) { animation-delay: 0.4s; }

.benefit-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary-50);
  color: var(--primary-600);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.benefit-item:hover .benefit-icon {
  background: var(--primary-100);
  transform: scale(1.05);
}

.benefit-content {
  display: flex;
  flex-direction: column;
}

.benefit-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-600);
  line-height: 1;
  font-family: var(--font-display);
}

.benefit-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-top: 0.25rem;
}

.benefit-desc {
  font-size: 0.75rem;
  color: var(--gray-600);
  margin-top: 0.125rem;
}

/* Use Cases Section (ersetzt Testimonials) */
.use-cases-modern {
  padding: var(--section-padding) 0;
  background: var(--gray-50);
}

.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.use-case-card {
  background: var(--white);
  border-radius: var(--rounded-2xl);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  border: 1px solid var(--gray-200);
}

.use-case-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
  border-color: var(--primary-200);
}

.use-case-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.use-case-card h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.75rem;
}

.use-case-description {
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.use-case-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
}

.use-case-features li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-700);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.use-case-features svg {
  color: var(--success-500);
  flex-shrink: 0;
}

.use-case-example {
  background: var(--gray-50);
  border-left: 3px solid var(--primary-500);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--rounded-lg) var(--rounded-lg) 0;
  font-size: 0.875rem;
  color: var(--gray-700);
}

.use-case-example strong {
  color: var(--primary-600);
  font-weight: 600;
}

/* Scientific Foundation Section */
.scientific-foundation {
  padding: var(--section-padding) 0;
  background: linear-gradient(135deg, var(--primary-50) 0%, var(--secondary-50) 100%);
}

.foundation-content {
  max-width: 1000px;
  margin: 0 auto;
}

.foundation-content h3 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--gray-900);
  text-align: center;
  margin-bottom: 1rem;
}

.foundation-intro {
  text-align: center;
  color: var(--gray-600);
  font-size: 1.125rem;
  margin-bottom: 3rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.research-item {
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--rounded-xl);
  box-shadow: var(--shadow-sm);
  position: relative;
  border: 1px solid var(--gray-200);
  transition: all 0.3s ease;
}

.research-item:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--primary-300);
}

.research-number {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--primary-100);
  color: var(--primary-700);
  min-width: 32px;
  height: 24px;
  padding: 0 0.5rem;
  border-radius: var(--rounded-3xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--primary-200);
}

.research-item h4 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.75rem;
  padding-right: 2rem;
}

.research-item p {
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: 0.75rem;
  font-size: 0.9375rem;
}

.research-source {
  font-size: 0.8125rem !important;
  color: var(--gray-500) !important;
  font-style: italic;
  margin-bottom: 0 !important;
  border-top: 1px solid var(--gray-100);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

.research-source a {
  color: var(--primary-600);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.research-source a:hover {
  color: var(--primary-700);
  text-decoration: underline;
}

.foundation-note {
  background: var(--white);
  border: 2px solid var(--primary-200);
  border-radius: var(--rounded-xl);
  padding: 1.5rem;
  text-align: center;
  color: var(--gray-700);
  font-size: 1rem;
  line-height: 1.6;
  box-shadow: var(--shadow-sm);
}

.foundation-note strong {
  color: var(--primary-700);
}

/* Responsive Anpassungen for landing page */
@media (max-width: 768px) {
  .hero-benefits {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .use-cases-grid {
    grid-template-columns: 1fr;
  }

  .research-grid {
    grid-template-columns: 1fr;
  }

  .benefit-item {
    padding: 1rem;
    background: var(--white);
    border-radius: var(--rounded-lg);
    box-shadow: var(--shadow-sm);
  }
}

/* Animations for landing page */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =============================================================================
   SECTION 4: DIRECT LINK UI
   ============================================================================= */

/* Direct-Link Access UI Styles */

.direct-link-welcome {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 30px;
  color: white;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  margin: 20px 0;
}

.direct-link-welcome h3 {
  font-size: 1.5em;
  margin: 0 0 15px 0;
  font-weight: 600;
}

.direct-link-info {
  font-size: 1.1em;
  margin-bottom: 25px;
  line-height: 1.6;
  opacity: 0.95;
}

.direct-link-info strong {
  color: var(--white, #ffffff);
  font-weight: 600;
}

/* Join Cards */
.join-card {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  padding: 25px;
  margin-top: 20px;
  color: var(--gray-800, #1f2937);
  text-align: left;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.join-card.success {
  border-left: 5px solid #27ae60;
}

.join-card.info {
  border-left: 5px solid #3498db;
}

.join-card.disabled {
  border-left: 5px solid #95a5a6;
  opacity: 0.8;
}

.join-icon {
  font-size: 2em;
  flex-shrink: 0;
  margin-top: 5px;
}

.join-content {
  flex: 1;
}

.join-message {
  font-size: 1.1em;
  margin: 0 0 15px 0;
  line-height: 1.5;
  color: var(--gray-800, #1f2937);
}

.join-note {
  font-size: 0.9em;
  color: var(--gray-500, #6b7280);
  font-style: italic;
  margin: 10px 0 0 0;
  line-height: 1.4;
}

.join-btn {
  font-size: 1.1em !important;
  padding: 12px 24px !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  transition: all 0.3s ease !important;
  text-transform: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.join-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Responsive Design for direct link */
@media (max-width: 768px) {
  .direct-link-welcome {
    padding: 20px;
    margin: 15px 0;
  }
  
  .direct-link-welcome h3 {
    font-size: 1.3em;
  }
  
  .direct-link-info {
    font-size: 1em;
  }
  
  .join-card {
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    text-align: center;
  }
  
  .join-icon {
    align-self: center;
  }
  
  .join-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Animation für Join-Cards - using slideInUp from style.css */
.join-card {
  animation: slideInUp 0.6s ease-out;
}

/* Hover-Effects für bessere UX */
.join-card:not(.disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

/* Focus-States für Accessibility */
.join-btn:focus {
  outline: 3px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* Unterschiedliche Button-Styles */
.join-btn.btn-primary-modern {
  background: #27ae60;
  border-color: #27ae60;
}

.join-btn.btn-secondary-modern {
  background: #3498db;
  border-color: #3498db;
  color: white;
}

/* Zusätzliche Visual Enhancements */
.direct-link-welcome::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="1" fill="white" opacity="0.1"/><circle cx="10" cy="90" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grain)"/></svg>');
  border-radius: 12px;
  pointer-events: none;
}

.direct-link-welcome {
  position: relative;
}

/* Preview Notice Styles */
.preview-notice {
  background: #f8f9fa;
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  margin-bottom: 25px;
}

.preview-notice h2 {
  color: #495057;
  margin: 0 0 10px 0;
  font-size: 1.3em;
}

.preview-text {
  color: #6c757d;
  margin: 0;
  line-height: 1.6;
}

/* Leaderboard Preview */
.leaderboard-preview {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-top: 20px;
}

.leaderboard-preview h3 {
  margin: 0 0 15px 0;
  color: var(--gray-800, #1f2937);
  text-align: center;
}

.preview-leaderboard {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preview-entry {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 4px solid #007bff;
}

.preview-entry:first-child {
  border-left-color: #ffd700;
  background: #fff9e6;
}

.preview-entry:nth-child(2) {
  border-left-color: #c0c0c0;
  background: #f5f5f5;
}

.preview-entry:nth-child(3) {
  border-left-color: #cd7f32;
  background: #faf7f2;
}

.preview-rank {
  font-weight: bold;
  color: #495057;
  margin-right: 15px;
  min-width: 25px;
}

.preview-name {
  flex: 1;
  font-weight: 500;
  color: var(--gray-800, #1f2937);
}

.preview-score {
  font-weight: bold;
  color: #007bff;
  font-size: 1.1em;
}

@media (max-width: 768px) {
  .preview-notice {
    padding: 15px;
  }
  
  .preview-notice h2 {
    font-size: 1.2em;
  }
  
  .leaderboard-preview {
    padding: 15px;
  }
  
  .preview-entry {
    padding: 10px 12px;
  }
}