/**
 * AI Features Stylesheet
 * Styling for AI-powered features in Redmine
 */

/* AI Features Panel */
.ai-features-panel {
  margin: 20px 0;
  padding: 15px;
  background: #f6f6f6;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
}

.ai-features-panel h3 {
  margin: 0 0 15px 0;
  padding: 0;
  font-size: 14px;
  font-weight: bold;
  color: #555;
}

/* AI Tabs */
.ai-tabs {
  margin-top: 10px;
}

.ai-tabs .tabs {
  margin: 0 0 10px 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid #ccc;
  display: flex;
  flex-wrap: wrap;
}

.ai-tabs .tabs li {
  margin: 0 5px -1px 0;
  padding: 0;
}

.ai-tabs .tabs a {
  display: block;
  padding: 8px 15px;
  background: #fff;
  border: 1px solid #ccc;
  border-bottom: none;
  border-radius: 3px 3px 0 0;
  text-decoration: none;
  color: #555;
  font-weight: normal;
}

.ai-tabs .tabs a:hover {
  background: #f6f6f6;
  color: #000;
}

.ai-tabs .tabs li.selected a {
  background: #628db6;
  color: #fff;
  border-color: #628db6;
  font-weight: bold;
}

/* Tab Content */
.ai-tab-content {
  padding: 15px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 0 3px 3px 3px;
  min-height: 100px;
}

.ai-loading {
  padding: 20px;
  text-align: center;
  color: #666;
  font-style: italic;
}

.ai-loading:before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  border: 2px solid #ccc;
  border-top-color: #628db6;
  border-radius: 50%;
  animation: ai-spin 0.8s linear infinite;
  vertical-align: middle;
}

@keyframes ai-spin {
  to { transform: rotate(360deg); }
}

.ai-content {
  line-height: 1.6;
  color: #333;
}

.ai-error {
  padding: 10px;
  background: #ffeaea;
  border: 1px solid #d00;
  border-radius: 3px;
  margin: 10px 0;
}

.ai-load-button {
  margin-top: 10px;
}

.ai-load-button.disabled,
.ai-load-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}


.inline-form {
  display: inline-block;
  margin-right: 5px;
}

.inline-form .small-input {
  width: 60px;
  margin-right: 3px;
}

/* AI Data Formatting */
.ai-data {
  margin: 10px 0;
}

.ai-data dt {
  font-weight: bold;
  color: #555;
  margin-top: 8px;
}

.ai-data dd {
  margin: 4px 0 4px 20px;
  color: #333;
}

.ai-list {
  margin: 8px 0;
  padding-left: 25px;
}

.ai-list li {
  margin: 4px 0;
  line-height: 1.5;
}

/* Settings Page Styles */
.settings .info {
  display: block;
  font-size: 0.9em;
  color: #666;
  margin-top: 3px;
}

.settings label.block {
  display: block;
  margin: 8px 0;
  font-weight: normal;
}

.settings label.block input[type="checkbox"] {
  margin-right: 5px;
}

.settings #connection_status {
  margin-left: 10px;
  font-weight: bold;
}

/* Project Settings */
fieldset.box.tabular {
  margin: 15px 0;
}

fieldset.box.tabular p.info {
  margin: 5px 0;
  padding-left: 180px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .ai-tabs .tabs {
    flex-direction: column;
  }
  
  .ai-tabs .tabs li {
    margin: 0 0 5px 0;
  }
  
  .ai-tabs .tabs a {
    border-radius: 3px;
    border-bottom: 1px solid #ccc;
  }
  
  .ai-tabs .tabs li.selected a {
    border-bottom: none;
  }
  
  .ai-tab-content {
    border-radius: 3px;
  }
}

/* Dark mode support (if Redmine theme supports it) */
@media (prefers-color-scheme: dark) {
  .ai-features-panel {
    background: #2d2d2d;
    border-color: #444;
  }
  
  .ai-features-panel h3 {
    color: #ccc;
  }
  
  .ai-tab-content {
    background: #1e1e1e;
    border-color: #444;
    color: #ccc;
  }
  
  .ai-content {
    color: #ccc;
  }
  
  .ai-data dt {
    color: #aaa;
  }
  
  .ai-data dd {
    color: #ccc;
  }
}
