/* =====================================================================
 * TABLE OF CONTENTS
 * ===================================================================== */
/*
 * 1. CSS Variables & Custom Properties
 * 2. Base & Reset
 * 3. Typography
 * 4. Layout & Containers
 * 5. Navigation & Links
 * 6. Forms & Inputs
 * 7. Buttons
 * 8. Cards & Content Boxes
 * 9. Alert Components
 * 10. Loading & Spinner
 * 11. Badges & Labels
 * 12. Modals
 * 13. PWA Installation Banner
 * 14. Choices.js Custom Styling
 * 15. Footer
 * 16. Utilities & Helper Classes
 * 17. Animations & Keyframes
 * 18. Media Queries
 */

/* =====================================================================
 * 1. CSS Variables & Custom Properties
 * ===================================================================== */
   :root {
  /* Brand Colors */
  --primary: #22B926;                    /* Primary color - Brand green */
  --primary-light: #27d82c;              /* Lighter shade for hover states */
    --secondary: #444;                     /* Secondary color (unused) */
  
  /* Text Colors */
    --text-color: #333;                    /* Main text color */
    --text-secondary: #666;                /* Secondary text color */
  
  /* Background Colors */
    --background: #f6f6f6;                 /* Page background */
    --card-bg: #fff;                       /* Background for cards/containers */
  
  /* UI Elements */
    --border-radius: 4px;                  /* Global border radius */
    --button-radius: 4px;                  /* Button border radius (unused) */
    --shadow: 0 0 0.25rem rgba(0,0,0,0.08), 0 0.5rem 0.75rem rgba(0,0,0,0.14); /* Box shadow */
  
  /* Semantic Colors */
  --success: #22B926;                    /* Success/Low risk color */
    --warning: #ffc107;                    /* Warning/Medium risk color */
    --danger: #dc3545;                     /* Danger/High risk color */
  
  /* Rating Colors */
    --low: #22B926;                        /* Rating: low */
    --medium: #ff9800;                     /* Rating: medium */
    --high: #f44336;                       /* Rating: high */
  }
  
  /* =====================================================================
 * 2. Base & Reset
 * ===================================================================== */
  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background-color: var(--background);
    color: var(--text-color);
    line-height: 1.5;
    padding: 20px;
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
  }
  
  /* =====================================================================
 * 3. Typography
 * ===================================================================== */
  h1.main-headline {
    color: var(--text-color);
    margin-bottom: 15px;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
  }
  
  h2 {
    color: var(--text-color);
    margin-bottom: 15px;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
  }
  
  h3 {
    color: var(--text-color);
    margin-bottom: 15px;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
  }
  
  h4 {
    margin: 15px 0 8px;
    color: var(--text-color);
    font-weight: 500;
  }
  
  p {
    margin-bottom: 15px;
    color: var(--text-secondary);
    font-size: 16px;
  }

/* Lists */
ul {
  padding-left: 20px;
  margin-bottom: 15px;
}

li {
  margin-bottom: 5px;
    color: var(--text-secondary);
    font-size: 16px;
  }

  small {
    font-size: 0.7em;
  }
  
  /* =====================================================================
 * 4. Layout & Containers
 * ===================================================================== */
.container {
  max-width: 900px;
  margin: 0 auto 20px; /* Centered with bottom margin */
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 25px;
}

.logo-placeholder {
  max-width: 900px;
  margin: 0 auto 20px;
  text-align: center;
}

.logo-placeholder img {
  max-width: 380px;
  height: auto;
}

/* Info grids for displaying data */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.info-item {
  display: flex;
  flex-direction: column;
  margin-bottom: 5px;
}

.final-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.final-item {
  margin-bottom: 15px;
}

.final-result-item {
  grid-column: 1 / -1; /* Span all columns */
  margin-top: 15px;
}

/* =====================================================================
 * 5. Navigation & Links
 * ===================================================================== */
  a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out;
    outline: none;
  }
  
  a:hover {
    color: var(--primary-light);
    text-decoration: underline;
  }

.details-link {
  display: inline-block;
  font-size: 0.85rem;
  margin-top: 5px;
  color: var(--primary);
  text-decoration: none;
}

.details-link:hover {
  text-decoration: underline;
  color: var(--primary-light);
  }
  
  /* =====================================================================
 * 6. Forms & Inputs
 * ===================================================================== */
  .input-group {
    display: flex;
    margin-bottom: 10px;
  }
  
  input[type="url"] {
    flex: 1;
    background-color: #fff;
    border: 1px solid #ddd;
    color: #333;
    font-size: 14px;
    font-weight: 400;
    padding: 12px 15px;
    border-radius: var(--border-radius);
    margin-right: 10px;
  }
  
  input[type="url"]:focus {
    outline: none;
    border-color: var(--primary);
  }
  
/* Standard Select Element */
select {
  background-color: #fff;
  border: 1px solid #ddd;
  color: #333;
  font-size: 14px;
  font-weight: 400;
  padding: 12px 15px;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  width: 100%;
  margin-bottom: 0;
}

select:focus {
  border: 1px solid var(--primary);
  outline: none;
}

/* =====================================================================
 * 7. Buttons
 * ===================================================================== */
  button[type="submit"] {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: background-color 0.2s;
  }
  
  button[type="submit"]:hover {
    background-color: var(--primary-light);
    color: #fff;
  }
  
/* Disabled button state */
  button:disabled {
    background-color: rgba(34, 185, 38, 0.5);
    cursor: not-allowed;
  }
  
  button:disabled:hover {
    background-color: rgba(34, 185, 38, 0.5);
    box-shadow: none;
  }
  
  /* =====================================================================
 * 8. Cards & Content Boxes
 * ===================================================================== */
  .card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 25px;
    scroll-margin-top: 20px;
  }
  
.results-container {
  margin-top: 25px;
  }
  
  /* Label and value in info cards */
  .label {
    font-weight: bold;
    color: var(--text-secondary);
    font-size: 0.9rem;
  }
  
  .value {
    font-size: 1.1rem;
    color: var(--text-color);
  }
  
  .value.error-text {
    color: var(--danger) !important;
    font-weight: bold;
  }
  
  /* Description style with left border */
  .description {
    font-style: italic;
    color: var(--text-secondary);
    border-left: 3px solid var(--primary-light);
    padding-left: 10px;
  }
  
/* Analysis section */
.analysis-section {
  margin-top: 15px;
}

/* Content box styling */
.content-box {
  margin-top: 30px;
}

/* Code box inside modals */
.code-box {
  background-color: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 15px;
  margin: 15px 0;
  overflow-x: auto;
}

.code-box pre {
  font-family: monospace;
  font-size: 0.85rem;
  line-height: 1.4;
  color: #333;
  margin: 0;
  white-space: pre-wrap;
}

/* Info box - small notice text */
.info-box {
  margin-top: 1rem;
}

.info-box p {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
}

/* =====================================================================
 * 9. Alert Components
 * ===================================================================== */
.error-message {
  color: var(--danger);
  margin: 5px 0 15px;
  font-size: 0.8em;
}

.error-text, .profile-blocked {
  color: var(--danger);
    font-weight: bold;
  }
  
/* Alert box - notification component */
.alert-box {
  margin-bottom: 0;
  padding: 0.8rem 1rem 1rem;
    background-color: var(--danger);
  border-radius: 4px 4px 0 0;
}

.alert-box + .card {
  border-top-left-radius: 0; 
  border-top-right-radius: 0;
  margin-top: 0;
}

.alert-box + .card p,
.alert-box + .card ul,
.alert-box + .card li {
  font-size: 0.85rem;
}

.alert-box + .card p b {
  font-size: 0.85rem;
}

.alert-box .alert-header {
  display: flex;
  align-items: center;
  margin: 0;
  font-weight: 600;
}

.alert-box .alert-header i {
  color: white;
  margin-right: 0.5rem;
  font-size: 1.4rem;
}

.alert-box .alert-header span {
  color: white;
    font-size: 1.2rem;
}

/* Alert Card - warning/error message container */
.alert-card {
  border-left: 5px solid var(--danger);
  background-color: #fff5f5;
    font-size: 0.85rem;
}

.alert-card.warning {
  border-left: 5px solid var(--warning);
  background-color: #fff3e0;
}

.alert-card h2 {
  color: var(--danger);
  font-size: 1.5rem;
}

.alert-card.warning h2 {
  color: var(--warning);
}

.alert-card h2 i {
  margin-right: 0.2rem;
  font-size: 1.2em;
}

.alert-card h3 {
  color: var(--danger);
  font-size: 1.5rem;
}

.alert-card.warning h3 {
  color: var(--warning);
}

.alert-card h3 i {
  margin-right: 8px;
  font-size: 1.2em;
}

.alert-card p {
  color: var(--text-color);
  margin-bottom: 10px;
    font-size: 0.85rem;
}

.alert-card p:last-child {
  margin-bottom: 0;
}

.alert-card a {
  color: var(--danger);
    text-decoration: underline;
}

.alert-card.warning a {
  color: var(--warning);
}

.alert-card a:hover {
  color: var(--high);
}

.alert-card.warning a:hover {
  color: var(--medium);
}

/* Disclaimer section */
.disclaimer-section h4 {
    font-size: 14px;
}

.disclaimer-section p {
  font-size: 14px;
}

/* =====================================================================
 * 10. Loading & Spinner
 * ===================================================================== */
#loading {
  margin-top: 30px; 
  margin-bottom: 20px;
  text-align: center;
}

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.spinner, #loading-icon {
  font-size: 30px;
  color: var(--primary);
  margin-bottom: 15px;
  animation: spin 1.5s linear infinite;
  will-change: transform;
  transform: translateZ(0);
  animation-play-state: running !important; /* Ensure animation is running */
}

#loading p, #loading-message {
  color: var(--primary);
  font-weight: bold;
  margin-top: 5px;
}

#loading .wait-info, #loading-message .wait-info {
  color: #888;
  font-size: 14px;
  font-weight: normal;
  margin-left: 5px;
  display: block;
}
  
  /* =====================================================================
 * 11. Badges & Labels
 * ===================================================================== */
/* Rating badge */
.rating {
  margin-top: 15px;
}

.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 4px;
  font-weight: bold;
  color: #fff;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.badge.hoch {
  background-color: var(--danger);
}

.badge.mittel {
  background-color: var(--warning);
}

.badge.niedrig {
  background-color: var(--success);
}

/* Larger badge variant */
.badge.large {
  font-size: 1.2rem;
  padding: 10px 18px;
  margin-bottom: 2px;
  margin-top: 5px;
}

/* Explanation text below ratings */
.explanation {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 10px 0;
}

/* Rating color classes */
.rating-low {
  color: var(--danger);
  font-size: 1.5rem;
}

.rating-medium {
  color: var(--warning);
  font-size: 1.5rem;
}

.rating-high {
  color: var(--success);
  font-size: 1.5rem;
}

.risk-level-low {
  color: var(--success);
}

.risk-level-medium {
  color: var(--warning);
}

.risk-level-high {
  color: var(--danger);
}

.zwischenbewertung-low {
  color: var(--success);
}

.zwischenbewertung-medium {
  color: var(--warning);
}

.zwischenbewertung-high {
  color: var(--danger);
}

/* Spacing for removed reviews details link */
.removed-reviews-spacer {
  margin: 0 4px;
  }
  
  /* =====================================================================
 * 12. Modals
 * ===================================================================== */
  .modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4); /* Semi-transparent background */
    animation: fadeIn 0.3s;
    display: none;
    justify-content: center;
    align-items: center;
  }
  
  .modal-content {
    background-color: var(--card-bg);
    margin: 0;
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideIn 0.3s;
  }
  
  .close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
  }
  
  .close-modal:hover,
  .close-modal:focus {
    color: var(--primary);
    text-decoration: none;
  }
  
/* =====================================================================
 * 13. PWA Installation Banner
 * ===================================================================== */
.pwa-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #fff;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: slideUp 0.3s ease-out;
  border-top: none; /* Remove blue line for desktop */
}

.pwa-install-content {
  display: flex;
  flex-direction: column; /* Text on top, button below */
  align-items: flex-start;
  padding: 0.5rem;
  max-width: 600px;
  margin: 0 auto;
  position: relative; /* For absolute positioning of the X */
}

.pwa-icon {
  width: 48px;
  height: 48px;
  margin-right: 1rem;
  border-radius: 8px;
}

.pwa-install-text {
  flex: 1;
  margin-bottom: 1rem; /* Space to button */
  width: 100%; /* Full width */
}

.pwa-install-text h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  color: #202124;
}

.pwa-install-text p {
  margin: 0;
  font-size: 0.85rem;
  color: #5f6368;
}

.pwa-install-button {
  background-color: var(--primary);
  color: white;
  border: none;
    border-radius: var(--border-radius);
  padding: 0.5rem 1rem;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
  font-size: 0.9rem;
  align-self: flex-start;
  transition: background-color 0.2s ease;
}

.pwa-install-button:hover {
  background-color: var(--primary-light);
}

.pwa-close-button {
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--text-secondary);
  position: absolute; 
  top: 0rem; 
  right: 0.5rem;
  display: inline-block;
  line-height: 1;
  }

  /* =====================================================================
 * 14. Choices.js Custom Styling
 * ===================================================================== */
/* Coach select container */
  .coach-select-container {
    margin: 20px 0;
  position: relative; /* For proper positioning */
  }

  .coach-select-container p {
    margin-bottom: 10px;
  }

/* Choices.js core styling */
  .choices {
    margin-bottom: 15px;
    width: 100%; /* Ensure full width */
  }

  .choices-select {
    width: 100%;
    position: relative;
  }

  .choices__inner {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    min-height: 44px;
    padding: 6px 7.5px;
    width: 100%;
  }

  .choices__input {
    background-color: transparent;
    margin-bottom: 0 !important; /* Fix extra margin */
  }

  .choices__list--dropdown {
    border: 1px solid #ddd;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    margin-top: -1px; /* Align with input border */
  }

  .choices__list--single {
    padding: 4px 16px 4px 4px; /* Better alignment */
  }

  .choices__list--dropdown .choices__item--selectable {
    padding: 6px 10px !important; /* Consistent padding */
    margin: 0 !important; /* Remove margins */
    border-bottom: 1px solid #f3f3f3; /* Subtle separator */
  }

  .choices__list--dropdown .choices__item--selectable:last-child {
    border-bottom: none; /* Remove border from last item */
  }

/* Choices hover/active states */
.choices__list--dropdown .choices__item--selectable.is-highlighted,
.choices__list--dropdown .choices__item--selectable:hover,
.choices__list--dropdown .choices__item--selectable.is-selected {
  background-color: var(--primary) !important;
  color: #fff !important;
  }

  .choices__list--dropdown .choices__item--selectable.is-highlighted {
    background-color: var(--primary);
    color: #fff;
  }

  .choices[data-type*="select-one"]:after {
    border-color: var(--text-color) transparent transparent transparent;
    right: 11.5px; /* Better arrow alignment */
    top: 50%;
  }

  .choices[data-type*="select-one"].is-open:after {
    border-color: transparent transparent var(--text-color) transparent;
  }

  /* Ensure placeholder is visible on ALL devices */
  .choices__list--single .choices__placeholder {
    display: block !important;
    opacity: 0.7;
  }

/* Fix for selecting placeholder */
.choices__list--dropdown .choices__item--selectable[data-value=""] {
  display: none; /* Hide placeholder from dropdown list */
}

/* Disabled state styling */
.choices.is-disabled .choices__inner, 
.choices.is-disabled .choices__input {
  background-color:#f9f9f9 !important;
}

/* =====================================================================
 * 15. Footer
 * ===================================================================== */
.disclaimer {
  max-width: 900px;
  margin: 20px auto 0;
  color: var(--text-secondary);
  font-size: 0.7em;
  text-align: center;
}

footer {
  max-width: 900px;
  margin: 10px auto 0;
  color: var(--text-secondary);
  font-size: 14px;
  text-align: center;
}

.footer-links {
  margin-top: 0;
}

.footer-links a {
  color: var(--primary);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* =====================================================================
 * 16. Utilities & Helper Classes
 * ===================================================================== */
.hidden {
  display: none;
}

/* =====================================================================
 * 17. Animations & Keyframes
 * ===================================================================== */
/* Spinner rotation */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Modal fade in */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Modal slide in */
@keyframes slideIn {
  from { transform: translateY(-50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* PWA banner slide up */
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* =====================================================================
 * 18. Media Queries
 * ===================================================================== */
/* Mobile adjustments for screens <= 768px */
@media (max-width: 768px) {
  /* Stack input and button vertically */
  .input-group {
    flex-direction: column;
  }
  
  /* Adjust URL input border radius */
  input[type="url"] {
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    margin-right: 0; /* Remove right margin on mobile */
    margin-bottom: 10px; /* Add spacing below input field */
  }
  
  /* Button takes full width with adjusted radius and padding */
  button[type="submit"] {
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    padding: 12px;
  }
  
  /* Make info grid single column */
  .info-grid {
    grid-template-columns: 1fr;
  }
  
  /* Final grid single column */
  .final-grid {
    grid-template-columns: 1fr;
  }
  
  /* Responsive adjustments for native select (fallback for Choices.js) */
  select {
    width: 100%;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
  }
  
  /* Choices dropdown adjustments */
  .choices__list--dropdown {
    width: 100%;
  }
  
  .choices__list--dropdown .choices__item {
    padding: 12px;
  }
  
  .choices__list--dropdown.is-active {
    display: block !important;
  }
  
  /* Fallback: if Choices.js not initialized, force native select to display */
  .choices:not(.is-initialized) select {
    display: block !important;
    width: 100%;
  }
  
  /* Optionally hide the auto-generated single select dropdown on mobile */
  .choices__list.choices__list--single {
    display: none !important;
  }
  
  /* Fix for placeholder on mobile */
  .choices__list--single .choices__placeholder {
    display: block !important;
    opacity: 0.7;
  }

  .choices[data-type*=select-one] .choices__input {
    border-bottom: 0px;
  }
  
  .choices__list--dropdown .choices__item--selectable {
    padding-right: 10px;
  }
  
  .choices__list--dropdown .choices__item--selectable:after {
    display: none;
  }
  
  /* Adjust logo size on mobile */
  .logo-placeholder img {
    max-width: 80%;
  }
}

/* Desktop adjustments for PWA banner */
  @media (min-width: 768px) {
    .pwa-install-banner {
    border-top: none; /* Ensure no border for desktop */
      max-width: 900px;
      margin-left: auto;
      margin-right: auto;
      border-radius: 8px 8px 0 0;
    }
  }
