/* cw.css */

  /* Container */
  #cw-chatToggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: #005f5a;
    color: white;
    padding: 16px;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    border: none;
    user-select: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    touch-action: manipulation;
  }
  #cw-chatToggle:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    background-color: #c5e0d0;
  }
  #cw-chatToggle:active {
    transform: translateY(-3px);
  }
  #cw-chatToggle svg {
    width: 24px;
    height: 24px;
    display: block;
  }
  
  /* Hide toggle button when chat is open */
  #cw-chatToggle.chat-open {
    display: none !important;
  }
  
  /* Chat widget wrapper */
  #cw-chatWidgetWrapper {
    position: fixed;
    bottom: 20px;
    right: 24px;
    z-index: 100000;
    pointer-events: none;
    max-height: calc(100vh - 40px);
    display: flex;
    align-items: flex-end;
  }
  
  #cw-chatWidgetWrapper #cw-chatWidget {
    pointer-events: auto;
  }
  
  /* Chat widget container */
  #cw-chatWidget {
    display: none;
    position: relative;
    width: 460px;
    max-height: calc(100vh - 40px);
    background: white;
    /* border: 1px solid #ccc; */
    border-radius: 12px;
    flex-direction: column;
    font-family: system-ui, sans-serif;
    overflow: hidden;
    font-size: 16px; /* Eigene Basis-Schriftgröße, unabhängig von der Seiten-Schriftgröße */
  }
  
  
  /* Close button */
  #cw-closeBtn {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    width: 32px;
    height: 32px;
  }
  
  #cw-closeBtn:hover {
    background-color: rgba(0, 0, 0, 0.1);
  }
  
  #cw-closeBtn svg {
    display: block;
    width: 24px;
    height: 24px;
  }
  #cw-chatWidget.active {
    display: flex;
  }
  
  /* Logo container */
  #cw-chatWidget .logo-container {
    display: flex;
    /* justify-content: center; */
    padding-top: 16px;
    padding-bottom: 10px;
    padding-left: 16px;
    background-color: #c5e0d0;
    position: relative;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
  }
  #cw-chatWidget .logo-container img {
    height: 60px;
    user-select: none;
    image-rendering: optimizeQuality;
    image-rendering: pixelated;
    image-rendering: -webkit-optimize-contrast; /* Chrome */
    image-rendering: crisp-edges;              /* Fallback */
  }

  #callBtn {
    display: none;
  }
  
  /* Header */
  #cw-status {
    display: none;
    padding: 10px 10px;
    background-color: #f0f0f0;
    border-bottom: 1px solid #ddd;
    max-height: 0;
    transition: max-height 0.5s ease-in-out, padding 0.5s ease-in-out;
  }
  
  #cw-chatWidget .header {
    background-color: #0070c0;
    color: white;
    padding: 8px 16px;
    font-weight: 600;
    text-align: center;
    user-select: none;
  }
  
  /* Messages container */
  #cw-chatMessages {
    overflow-y: auto;
    padding: 10px;
    height: 620px;
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px;
    font-size: 14px;
    line-height: 1.4;
    user-select: text;
    scroll-behavior: smooth;
    background: #eeeeee;
  }
  
  /* Chat form */
  #cw-chatForm {
    display: flex;
    margin: 0px;
    padding: 12px;
    background-color: #eeeeee;
    border-radius: 0;
    gap: 0;
  }
  #cw-chatInput {
    flex: 1;
    border: none;
    padding: 12px 16px;
    font-size: 16px;
    outline-offset: 2px;
    border-radius: 8px 0 0 8px;
    background-color: #ffffff;
  }
  #cw-chatInput:focus {
    outline: 0px solid #0070c0;
  }
  #cw-chatForm button {
    background-color: #ffffff;
    border: none;
    color: #333;
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 600;
    border-radius: 0 8px 8px 0;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  #cw-chatForm button:hover {
    background-color: #c5e0d0;
  }
  
  /* Footer */
  .cw-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    background-color: #eeeeee;
    border-top: 1px solid #dddddd;
    border-radius: 0 0 12px 12px;
    position: relative;
    font-size: 12px;
    margin-top: -1px;
  }
  
  .cw-support-email {
    color: #333;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
  }
  
  .cw-support-email:hover {
    color: #005f5a;
    text-decoration: underline;
  }
  
  .cw-copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: color 0.2s ease, transform 0.2s ease;
    border-radius: 4px;
  }
  
  .cw-copy-btn:hover {
    color: #005f5a;
    transform: scale(1.1);
  }
  
  .cw-copy-btn:active {
    transform: scale(0.95);
  }
  
  .cw-copy-btn svg {
    width: 16px;
    height: 16px;
    display: block;
  }
  
  /* Tooltip */
  .cw-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background-color: #333;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    margin-bottom: 8px;
    z-index: 100001;
  }
  
  .cw-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
  }
  
  .cw-tooltip.cw-tooltip-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  
  /* Message bubbles */
  .cw-message {
    max-width: 75%;
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 12px;
    word-wrap: break-word;
    white-space: pre-wrap;
  }
  .cw-message.user {
    background-color: #c5e0d0;
    color: #0c0c0c;
    margin-left: auto;
    text-align: right;
    padding: 15px;
    width: fit-content;
  }
  .cw-message.bot {
    background-color: #ffffff;
    color: #333;
    margin-right: auto;
    text-align: left;
    position: relative;
    padding: 15px;
    padding-right: 50px;
    padding-bottom: 35px;
    overflow: hidden;
  }
  
  /* Message header for bot messages */
  .cw-message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }
  
  .cw-robot-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    transition: transform 0.2s ease;
  }
  
  .cw-message-header:hover .cw-robot-icon {
    transform: scale(1.1);
  }
  
  .cw-header-text {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    line-height: 1.2;
  }
  
  .cw-message-content {
    color: #333;
    line-height: 1.5;
  }
  
  .cw-message-link {
    color: #005f5a;
    text-decoration: underline;
    word-break: break-all;
    transition: color 0.2s ease;
  }
  
  .cw-message-link:hover {
    color: #003d3a;
    text-decoration: underline;
  }
  
  /* Loading animation */
  .cw-loading {
    padding: 15px;
  }
  
  .cw-loading-dots {
    display: flex;
    gap: 6px;
    align-items: center;
  }
  
  .cw-loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #999;
    animation: cw-loading-bounce 1.4s infinite ease-in-out both;
  }
  
  .cw-loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
  }
  
  .cw-loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
  }
  
  .cw-loading-dots span:nth-child(3) {
    animation-delay: 0;
  }
  
  @keyframes cw-loading-bounce {
    0%, 80%, 100% {
      transform: scale(0);
      opacity: 0.5;
    }
    40% {
      transform: scale(1);
      opacity: 1;
    }
  }
  
  .cw-message.bot:has(.cw-message-header) {
    padding-top: 12px;
  }
  
  /* Feedback container */
  .cw-feedback-container {
    position: absolute;
    bottom: 4px;
    right: 4px;
    display: flex;
    gap: 4px;
    opacity: 0.4;
    transition: opacity 0.2s ease;
  }
  
  .cw-message.bot:hover .cw-feedback-container {
    opacity: 1;
  }
  
  /* Button container */
  .cw-button-container {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
  }
  
  /* Datenschutz button */
  .cw-datenschutz-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background-color: #f5f5f5;
    border: 1px solid #d0d0d0;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    font-family: system-ui, sans-serif;
    width: fit-content;
  }
  
  .cw-datenschutz-button:hover {
    background-color: #e8e8e8;
    border-color: #b0b0b0;
  }
  
  .cw-datenschutz-button svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    stroke: currentColor;
  }
  
  .cw-datenschutz-button span {
    font-weight: 500;
  }
  
  .cw-feedback-btn {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 6px;
    padding: 4px 6px;
    cursor: pointer;
    font-size: 10px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1.2;
  }
  
  .cw-feedback-btn:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.04);
    transform: translateY(-1px);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15);
  }
  
  .cw-feedback-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  }
  
  .cw-feedback-btn:disabled {
    cursor: not-allowed;
    opacity: 0.4;
  }
  
  .cw-feedback-btn svg {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    stroke: currentColor;
  }
  
  .cw-feedback-btn span {
    font-size: 10px;
    line-height: 1;
  }
  
  .cw-helpful:hover {
    background-color: rgba(76, 175, 80, 0.1);
    border-color: rgba(76, 175, 80, 0.3);
    color: #4caf50;
  }
  
  .cw-not-helpful:hover {
    background-color: rgba(244, 67, 54, 0.1);
    border-color: rgba(244, 67, 54, 0.3);
    color: #f44336;
  }
  
  .button {
    display: inline-block;
    padding: 12px 24px;
    background-color: transparent;
    color: inherit;
    text-align: center;
    text-decoration: none;
    border-radius: 0px;
    font-size: 16px;
    border: none;
    font-weight: bold;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: absolute;
    right: 0;
    top: 10%;
    transform: translateY(-50%)
  }
  
  .button:hover {
    opacity: 0.8;
  }
  
  .button:active {
    opacity: 0.6;
  }
  
  
  
  
  /* Headline above the wizard */
  .wizard-headline {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    padding: 20px 0;
    background-color: #f8f9f9;
    color: #2c3e50;
    border-bottom: 2px solid #ddd;
  }
  
  /* Main wizard container */
  .wizard {
    display: flex;
    justify-content: space-between;
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    background-color: #e0e0e0;
  }
  
  /* Each step box */
  .wizard li {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 2px solid #fff;
    color: white;
    box-sizing: border-box;
  }
  
  .wizard li:last-child {
    border-right: none;
  }
  
  /* Header inside each box (icon + label) */
  .wizard .header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 10px;
    font-weight: bold;
    font-size: 16px;
    text-align: center;
  }
  
  /* Detail text area inside the box */
  .wizard .text {
    padding: 20px 10px;
    text-align: center;
    font-size: 14px;
    flex-grow: 1;
  }
  
  /* DARK GREY: Open */
  .wizard li.open {
    background-color: #7f8c8d;
  }
  
  .wizard li.open .header {
    background-color: #5d6d7e;
  }
  
  /* DARK GREEN: Done */
  .wizard li.done {
    background-color: #1e8449;
  }
  
  .wizard li.done .header {
    background-color: #145a32;
  }
  
  /* Icon style */
  .wizard i {
    font-size: 18px;
  }
  
  /* ============================================
     MOBILE RESPONSIVE STYLES
     ============================================ */
  
  /* Tablet and below (max-width: 768px) */
  @media screen and (max-width: 768px) {
    /* Widget container - responsive width */
    #cw-chatWidget {
      width: calc(100vw - 32px);
      max-width: 460px;
      max-height: 90vh;
    }
    
    /* Widget wrapper - adjust position */
    #cw-chatWidgetWrapper {
      bottom: 16px;
      right: 16px;
      left: 16px;
    }
    
    /* Toggle button - adjust position */
    #cw-chatToggle {
      bottom: calc(20px + env(safe-area-inset-bottom, 0px));
      right: 16px;
      z-index: 999999;
      pointer-events: auto;
      -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
      touch-action: manipulation;
    }
    
    /* Chat messages - responsive height */
    #cw-chatMessages {
      height: calc(90vh - 250px);
      min-height: 300px;
      padding: 12px;
      font-size: 14px;
    }
    
    /* Message bubbles - larger max-width on tablet */
    .cw-message {
      max-width: 80%;
      padding: 12px 14px;
    }
    
    .cw-message.user {
      padding: 12px 14px;
    }
    
    .cw-message.bot {
      padding: 12px 14px;
      padding-right: 45px;
      padding-bottom: 32px;
    }
    
    /* Logo container - reduce padding */
    #cw-chatWidget .logo-container {
      padding-top: 12px;
      padding-bottom: 8px;
      padding-left: 12px;
    }
    
    #cw-chatWidget .logo-container img {
      height: 52px;
    }
    
    /* Form - adjust padding */
    #cw-chatForm {
      padding: 10px;
    }
    
    #cw-chatInput {
      padding: 14px 16px;
      font-size: 16px; /* Prevents zoom on iOS */
    }
    
    #cw-chatForm button {
      padding: 14px 16px;
      min-width: 48px;
      min-height: 48px;
    }
    
    /* Footer - adjust font size */
    .cw-footer {
      padding: 12px;
      font-size: 13px;
    }
    
    /* Close button - larger touch target */
    #cw-closeBtn {
      width: 40px;
      height: 40px;
      right: 4px;
    }
    
    /* Feedback buttons - larger on tablet */
    .cw-feedback-btn {
      padding: 4px 8px;
      font-size: 11px;
    }
    
    .cw-feedback-btn svg {
      width: 14px;
      height: 14px;
    }
    
    .cw-feedback-btn span {
      font-size: 11px;
    }
    
    /* Datenschutz button - adjust padding */
    .cw-datenschutz-button {
      padding: 12px;
      font-size: 14px;
    }
  }
  
  /* Mobile devices (max-width: 480px) */
  @media screen and (max-width: 480px) {
    /* Widget container - full width on very small screens */
    #cw-chatWidget {
      position: fixed;
      width: 100vw;
      max-width: 100vw;
      max-height: 100vh;
      height: 100vh;
      border-radius: 0;
      bottom: 0;
      right: 0;
      left: 0;
      top: 0;
      margin: 0;
    }
    
    /* Widget wrapper - full screen on mobile */
    #cw-chatWidgetWrapper {
      bottom: 0;
      right: 0;
      left: 0;
      top: 0;
      width: 100vw;
      height: 100vh;
      margin: 0;
      padding: 0;
    }
    
    /* Toggle button - safe area for iOS */
    #cw-chatToggle {
      bottom: calc(20px + env(safe-area-inset-bottom, 0px));
      right: max(16px, env(safe-area-inset-right, 16px));
      z-index: 999999;
      pointer-events: auto;
      -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
      touch-action: manipulation;
    }
    
    /* Chat messages - full height calculation */
    #cw-chatMessages {
      height: calc(100vh - 240px);
      min-height: 250px;
      padding: 12px 12px 20px 12px;
      font-size: 14px;
    }
    
    /* Message bubbles - larger max-width on mobile */
    .cw-message {
      max-width: calc(100% - 24px);
      padding: 10px 12px;
      margin-bottom: 10px;
    }
    
    .cw-message.user {
      padding: 10px 12px;
    }
    
    .cw-message.bot {
      padding: 10px 12px;
      padding-right: 40px;
      padding-bottom: 30px;
    }
    
    /* Logo container - smaller on mobile */
    #cw-chatWidget .logo-container {
      padding-top: 12px;
      padding-bottom: 8px;
      padding-left: 12px;
      border-top-left-radius: 0;
      border-top-right-radius: 0;
    }
    
    #cw-chatWidget .logo-container img {
      height: 44px;
    }
    
    /* Form - mobile optimized */
    #cw-chatForm {
      padding: 10px 10px 16px 10px;
      gap: 0;
    }
    
    #cw-chatInput {
      padding: 14px 16px;
      font-size: 16px; /* Prevents zoom on iOS */
      border-radius: 8px 0 0 8px;
    }
    
    #cw-chatForm button {
      padding: 14px 16px;
      min-width: 48px;
      min-height: 48px;
      border-radius: 0 8px 8px 0;
    }
    
    /* Footer - mobile optimized */
    .cw-footer {
      padding: 12px 12px max(12px, env(safe-area-inset-bottom, 12px)) 12px;
      font-size: 13px;
      border-radius: 0;
    }
    
    /* Close button - larger on mobile */
    #cw-closeBtn {
      width: 44px;
      height: 44px;
      right: 4px;
      top: 50%;
    }
    
    /* Feedback buttons - larger touch targets on mobile */
    .cw-feedback-container {
      bottom: 6px;
      right: 6px;
      gap: 6px;
    }
    
    .cw-feedback-btn {
      padding: 5px 10px;
      font-size: 12px;
      min-width: 80px;
    }
    
    .cw-feedback-btn svg {
      width: 14px;
      height: 14px;
    }
    
    .cw-feedback-btn span {
      font-size: 12px;
    }
    
    /* Datenschutz button - mobile optimized */
    .cw-datenschutz-button {
      padding: 12px 14px;
      font-size: 14px;
      min-height: 44px;
    }
    
    /* Message header - adjust spacing */
    .cw-message-header {
      margin-bottom: 8px;
      padding-bottom: 6px;
      gap: 6px;
    }
    
    .cw-header-text {
      font-size: 13px;
    }
    
    .cw-robot-icon {
      width: 18px;
      height: 18px;
    }
    
    /* Status div - adjust padding */
    #cw-status {
      padding: 8px 12px;
      font-size: 14px;
    }
    
    /* Copy button - larger touch target */
    .cw-copy-btn {
      padding: 8px;
      min-width: 44px;
      min-height: 44px;
    }
    
    .cw-copy-btn svg {
      width: 18px;
      height: 18px;
    }
    
    /* Support email - larger touch target */
    .cw-support-email {
      padding: 4px 8px;
      min-height: 32px;
      display: inline-flex;
      align-items: center;
    }
  }
  
  /* Landscape orientation on mobile */
  @media screen and (max-width: 768px) and (orientation: landscape) {
    #cw-chatMessages {
      height: calc(100vh - 200px);
      min-height: 200px;
    }
    
    #cw-chatWidget {
      max-height: 95vh;
    }
  }
  
  /* Very small devices (max-width: 360px) */
  @media screen and (max-width: 360px) {
    #cw-chatMessages {
      padding: 10px;
      font-size: 13px;
    }
    
    .cw-message {
      padding: 8px 10px;
    }
    
    .cw-message.user,
    .cw-message.bot {
      padding: 8px 10px;
    }
    
    .cw-message.bot {
      padding-right: 35px;
      padding-bottom: 28px;
    }
    
    #cw-chatWidget .logo-container img {
      height: 40px;
    }
    
    #cw-chatForm {
      padding: 8px;
    }
    
    #cw-chatInput {
      padding: 12px 14px;
    }
    
    #cw-chatForm button {
      padding: 12px 14px;
    }
  }
  