/* Main Container */
.ai-widget-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}


/* Button Wrapper */
.widget-button-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  bottom: 120px; /* 80px+ space above the consultation button */
  left: 10px;
}

/* Tooltip */
.widget-tooltip {
  background: linear-gradient(135deg, #6e48aa, #9d50bb);
  color: white;
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(110, 72, 170, 0.3);
  white-space: nowrap;
  animation: fadeIn 0.5s ease;
  position: relative;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.widget-tooltip::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px 8px 0;
  border-style: solid;
  border-color: #6e48aa transparent transparent transparent;
}

/* Main Button */
.widget-main-button {
  width: 64px;
  height: 64px;

  border-radius: 50%;
  background: linear-gradient(135deg, #6e48aa, #9d50bb);
  color: white;
  border: none;
  box-shadow: 0 6px 20px rgba(110, 72, 170, 0.4);
  cursor: pointer;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.widget-main-button:hover {
  transform: scale(1.1) translateY(-5px);
  box-shadow: 0 8px 25px rgba(110, 72, 170, 0.5);
}

/* Pulsing Animation */
.button-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  animation: pulse 2s infinite;
  z-index: -1;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.7; }
  70% { transform: scale(1.3); opacity: 0; }
  100% { transform: scale(0.95); opacity: 0; }
}
/* AI Projections Panel */
.ai-projections-panel {
  display: none;
  position: absolute;
  bottom: 90px;
  right: 0;
  width: 420px;
  max-width: calc(100vw - 60px);
  max-height: 80vh;
  background: white;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  border: 1px solid #e0e0e0;
  z-index: 1001;
  animation: slideUp 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(135deg, #f8f5ff, #f0e9ff);
  border-bottom: 1px solid #e5dfff;
  position: sticky;
  top: 0;
  z-index: 2;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-header h3 {
  margin: 0;
  font-size: 1.3rem;
  color: #5d3a9e;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-header i {
  color: #7e5bef;
  font-size: 1.3rem;
}

.ai-badge {
  background: #7e5bef;
  color: white;
  font-size: 0.7rem;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
}

.close-panel {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #999;
  cursor: pointer;
  padding: 5px;
  transition: all 0.2s ease;
}

.close-panel:hover {
  color: #666;
  transform: rotate(90deg);
}

.panel-content {
  padding: 0;
  overflow-y: auto;
  max-height: calc(80vh - 110px);
}

/* Input Section */
.input-section {
  padding: 20px;
  background: #fafafa;
  border-bottom: 1px solid #eee;
}

.input-row {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.input-group {
  flex: 1;
  margin-bottom: 0;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #555;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-group label i {
  font-size: 0.9rem;
  color: #7e5bef;
}

.styled-select {
  width: 100%;
  padding: 10px 15px 10px 35px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.9rem;
  background-color: white;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237e5bef' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  appearance: none;
  -webkit-appearance: none;
  transition: all 0.2s ease;
}

.styled-select:focus {
  border-color: #7e5bef;
  box-shadow: 0 0 0 2px rgba(126, 91, 239, 0.2);
  outline: none;
}

.generate-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #6e48aa, #9d50bb);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(110, 72, 170, 0.2);
}

.generate-btn:hover {
  background: linear-gradient(135deg, #5d3a9e, #8d40ab);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(110, 72, 170, 0.3);
}

.generate-btn:active {
  transform: translateY(0);
}

/* Results Section */
.results-section {
  padding: 0 20px;
}

.loading-spinner {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 40px 0;
  text-align: center;
}

.spinner-container {
  position: relative;
  width: 50px;
  height: 50px;
  margin-bottom: 20px;
}

.spinner {
  width: 100%;
  height: 100%;
  border: 4px solid rgba(126, 91, 239, 0.1);
  border-radius: 50%;
  border-top-color: #7e5bef;
  animation: spin 1.2s linear infinite;
  position: absolute;
  top: 0;
  left: 0;
}

.spinner-inner {
  width: 60%;
  height: 60%;
  border: 3px solid transparent;
  border-radius: 50%;
  border-top-color: #9d50bb;
  animation: spinReverse 1.5s linear infinite;
  position: absolute;
  top: 20%;
  left: 20%;
}

.loading-text {
  font-weight: 600;
  color: #444;
  margin-bottom: 5px;
  font-size: 1rem;
}

.loading-subtext {
  color: #888;
  font-size: 0.85rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes spinReverse {
  to { transform: rotate(-360deg); }
}

.projection-results {
  display: none;
  padding: 20px 0;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.results-header h4 {
  margin: 0;
  color: #5d3a9e;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.results-header i {
  color: #7e5bef;
}

.confidence-meter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.confidence-label {
  font-size: 0.75rem;
  color: #888;
  font-weight: 500;
}

.confidence-bar {
  width: 60px;
  height: 6px;
  background: #f0f0f0;
  border-radius: 3px;
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  background: linear-gradient(90deg, #6e48aa, #9d50bb);
  border-radius: 3px;
  width: 82%;
}

.confidence-value {
  font-size: 0.75rem;
  font-weight: 600;
  color: #5d3a9e;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 25px;
}

.result-card {
  background: white;
  border-radius: 10px;
  padding: 16px;
  border: 1px solid #eee;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.03);
  transition: all 0.3s ease;
}

.result-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.result-card.highlight {
  grid-column: span 2;
  background: linear-gradient(135deg, #f9f5ff, #f4eeff);
  border: 1px solid #e5dfff;
}

.result-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.result-header h4 {
  margin: 0;
  color: #5d3a9e;
  font-size: 0.95rem;
  font-weight: 600;
}

.result-header i {
  color: #7e5bef;
  font-size: 1.1rem;
}

.result-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 6px;
}

.highlight .result-value {
  font-size: 1.8rem;
  color: #6e48aa;
}

.result-description {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.5;
}

.ai-insights {
  background: #f9f9ff;
  border-radius: 10px;
  padding: 18px;
  margin: 25px 0;
  border: 1px solid #eee;
}

.insights-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.insights-header h4 {
  margin: 0;
  color: #5d3a9e;
  font-size: 1rem;
}

.insights-header i {
  color: #7e5bef;
  font-size: 1.2rem;
}

.insights-content {
  color: #444;
  line-height: 1.6;
  font-size: 0.9rem;
}

.insight-item {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.insight-item:last-child {
  margin-bottom: 0;
}

.insight-icon {
  color: #7e5bef;
  font-size: 0.9rem;
  margin-top: 3px;
}

.risk-assessment {
  background: #fff9f9;
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 20px;
  border: 1px solid #ffecec;
}

.risk-assessment h4 {
  margin: 0 0 15px 0;
  color: #9e3a3a;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.risk-assessment i {
  color: #ef5b5b;
}

.risk-meters {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.risk-meter {
  display: flex;
  align-items: center;
  gap: 10px;
}

.risk-meter label {
  width: 120px;
  font-size: 0.85rem;
  color: #666;
}

.meter-bar {
  flex: 1;
  height: 6px;
  background: #f0f0f0;
  border-radius: 3px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: 3px;
}

.meter-fill.low {
  background: #4caf50;
  width: 30%;
}

.meter-fill.medium {
  background: #ff9800;
  width: 60%;
}

.meter-fill.high {
  background: #f44336;
  width: 80%;
}

/* CTA Section */
.cta-section {
  text-align: center;
  padding: 25px 20px;
  background: linear-gradient(135deg, #f8f5ff, #f0e9ff);
  border-top: 1px solid #e5dfff;
  position: sticky;
  bottom: 0;
}

.cta-content {
  margin-bottom: 15px;
}

.cta-content h4 {
  margin: 0 0 8px 0;
  color: #5d3a9e;
  font-size: 1.1rem;
}

.cta-content p {
  margin: 0 0 15px 0;
  color: #666;
  font-size: 0.9rem;
  line-height: 1.5;
}

.cta-button {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #6e48aa, #9d50bb);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(110, 72, 170, 0.2);
}

.cta-button:hover {
  background: linear-gradient(135deg, #5d3a9e, #8d40ab);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(110, 72, 170, 0.3);
}

.ai-watermark {
  font-size: 0.75rem;
  color: #aaa;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 10px;
}

.ai-watermark i {
  color: #bbb;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(30px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Adjustments */
@media (max-width: 480px) {
  .ai-widget-container {
    bottom: 10px;
    right: 20px;
  }
  
  .widget-main-button {
    width: 56px;
    height: 56px;
    font-size: 22px;
  }
  
  .widget-tooltip {
    font-size: 0.8rem;
    padding: 6px 12px;
  }
  
  .ai-projections-panel {
    width: 92vw;
    right: 4vw;
    bottom: 70px;
    max-height: 85vh;
  }
  
  .input-row {
    flex-direction: column;
    gap: 12px;
  }
  
  .results-grid {
    grid-template-columns: 1fr;
  }
  
  .result-card.highlight {
    grid-column: span 1;
  }
}
















/* Modal Overlay */
.user-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 45, 90, 0.8);
  z-index: 9999;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.3s ease-out;
}

/* Modal Content */
.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 500px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 5px 20px rgba(0, 45, 90, 0.3);
  overflow: hidden;
}

.modal-header {
  background: #0056b3;
  color: white;
  padding: 20px;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.modal-header p {
  margin: 8px 0 0;
  opacity: 0.9;
  font-size: 0.9rem;
}

/* Form Styles */
.modal-form {
  padding: 25px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
  font-size: 0.95rem;
}

.form-group input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-group input:focus {
  outline: none;
  border-color: #0056b3;
  box-shadow: 0 0 0 2px rgba(0, 86, 179, 0.2);
}

/* Buttons */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 25px;
}

.btn {
  padding: 12px 20px;
  border: none;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background-color: #0056b3;
  color: white;
}

.btn-primary:hover {
  background-color: #004494;
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: #f0f0f0;
  color: #333;
}

.btn-secondary:hover {
  background-color: #e0e0e0;
}

/* Response Message */
.form-response {
  padding: 0 25px 25px;
  min-height: 20px;
  color: #d9534f;
  font-size: 0.9rem;
  text-align: center;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Responsive Adjustments */
@media (max-width: 600px) {
  .modal-content {
    width: 95%;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }


    .ai-widget-container {
    bottom: 10px;
    
  }
}






.close-button {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  font-weight: bold;
  color: #555;
  cursor: pointer;
}

.close-button:hover {
  color: #000;
}


@media (max-width: 600px) {
  .widget-tooltip {
    display: none;
  }

  .widget-label-mobile {
    display: block;
  }
}