/* AI Assistant Styles */
.ai-assistant {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  }
  
  /* Pulsante trigger */
  .ai-trigger-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #4662D9;
    color: white;
    border: none;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s, background-color 0.3s;
  }
  
  .ai-trigger-button:hover {
    background: #3651C8;
    transform: scale(1.05);
  }
  
  /* Pannello principale */
  .ai-panel {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 480px; /* Aumentato da 380px */    
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s;
    transform-origin: bottom right;
    animation: slideIn 0.3s forwards;
    height: 90vh;
  }
  
  @keyframes slideIn {
    from {
      opacity: 0;
      transform: translateY(20px) scale(0.95);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }
  
  /* Intestazione pannello */
  .ai-panel-header {
    background: #4662D9;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .ai-panel-title {
    font-weight: 600;
    font-size: 18px;
    display: flex;
    align-items: center;
  }
  
  .ai-back-button {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    margin-right: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
  }
  
  .ai-back-button:hover {
    background: rgba(255, 255, 255, 0.2);
  }
  
  .ai-panel-close {
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
  }
  
  .ai-panel-close:hover {
    background: rgba(255, 255, 255, 0.2);
  }
  
  /* Contenuto del pannello */
  .ai-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
  }
  
  /* Selezione degli agenti */
  .ai-intro-text {
    color: #666;
    margin-bottom: 15px;
  }
  
  .ai-agent-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  
  .ai-agent-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    background: #f5f8ff;
    border: 1px solid #e0e7ff;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
  }
  
  .ai-agent-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    background: #edf2ff;
  }
  
  .ai-agent-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #4662D9;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 18px;
  }
  
  .ai-agent-icon-travel {
    background: linear-gradient(135deg, #4662D9, #3651C8);
  }
  
  .ai-agent-details {
    flex: 1;
  }
  
  .ai-agent-details h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
  }
  
  .ai-agent-details p {
    margin: 0;
    font-size: 13px;
    color: #666;
  }
  
  /* Interfaccia dell'agente */
  .ai-agent-interface {
    height: 100%;
  }
  
  /* Stile per Travel Agent */
  .travel-agent {
    display: flex;
    flex-direction: column;
    height: 100%;
  }
  
  .agent-step-title {
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
    color: #333;
  }
  
  .travel-options {    
    overflow-y: auto;
    margin-bottom: 15px;
  }
  
  .travel-option {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px; /* Aumentato da 12px */
    margin-bottom: 15px; /* Aumentato da 10px */
    background: #fafafa;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    transition: all 0.2s;
  }

  .travel-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  }
  
  .travel-option-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
  }

  .travel-option-header h5 {
    font-size: 16px;
    margin: 0;
    font-weight: 600;
  }
  
  .travel-option-details {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #ddd;
  }
  
  .travel-segment {
    background: white;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 10px;
    border: 1px solid #eee;
    font-size: 14px;
  }
  
  .segment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
  }
  
  .segment-route {
    margin-bottom: 5px;
  }
  
  .segment-class {
    margin-top: 5px;
  }
  
  .segment-price {
    margin-left: 5px;
    font-weight: bold;
  }
  
  .travel-reasoning {
    font-style: italic;
    color: #666;
    font-size: 13px;
    margin: 10px 0;
  }
  
  .travel-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
  }
  
  .tips-section {
    background: #f0f7ff;
    border-radius: 8px;
    padding: 12px;
    font-size: 13px;
  }
  
  .tips-title {
    font-size: 14px;
    margin-bottom: 8px;
  }
  
  .tips-list {
    margin: 0;
    padding-left: 20px;
  }
  
  .loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 12px;
  }
  
  .segment-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 10px;
    color: #444;
  }

  .segments-container {
    background-color: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 12px;
  }

  .travel-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    background: #f9fafb;
    padding: 12px;
    border-radius: 8px;
  }

  .detail-item {
    margin-bottom: 5px;
  }

  .travel-option-actions, .travel-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    margin-top: 12px;
  }

  .segment-note {
    font-style: italic;
    color: #666;
    font-size: 13px;
    margin-top: 5px;
  }

  .text-success {
    color: #22c55e !important;
  }

  .text-primary {
    color: #3b82f6 !important;
  }

  .text-danger {
    color: #ef4444 !important;
  }
  
  /* Responsive per tablet e mobile */
  @media (max-width: 768px) {
    .ai-panel {
      width: 420px;
    }
  }
  
  @media (max-width: 576px) {
    .ai-panel {
      position: fixed;
      width: 100%;
      max-height: 80vh;
      bottom: 70px;
      right: 0;
      left: 0;
      border-radius: 12px 12px 0 0;
    }
  }

  .ml-2 {
    margin-left: 0.5rem;
  }
  
  .mr-2 {
    margin-right: 0.5rem;
  }
  
  .btn-success {
    background-color: #22c55e;
    border-color: #22c55e;
    color: white;
  }
  
  .btn-success:hover {
    background-color: #16a34a;
    border-color: #16a34a;
  }