/**
 * AI Modal Styles
 * Modern, clean design for AI playbook generation
 */

/* Modal overlay */
.ai-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Modal content */
.ai-modal-content {
  background-color: white;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  max-width: 500px;
  width: 90%;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Modal header */
.ai-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.ai-modal-header h2 {
  font-size: 24px;
  font-weight: 600;
  color: #1a1815;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-icon {
  font-size: 28px;
}

.ai-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #6e645a;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.ai-close:hover {
  background-color: #f5f3f0;
  color: #1a1815;
}

/* Modal body */
.ai-modal-body {
  margin-bottom: 24px;
}

.ai-form-group {
  margin-bottom: 20px;
}

.ai-form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #1a1815;
  font-size: 14px;
}

.ai-form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #d9d4cf;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.2s;
}

.ai-form-group textarea:focus {
  outline: none;
  border-color: #6e645a;
}

.ai-form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid #d9d4cf;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  background-color: white;
  cursor: pointer;
  transition: border-color 0.2s;
}

.ai-form-group select:focus {
  outline: none;
  border-color: #6e645a;
}

.ai-help-text {
  font-size: 12px;
  color: #6e645a;
  margin-top: 4px;
}

.ai-char-count {
  text-align: right;
  font-size: 11px;
  color: #6e645a;
  margin-top: 4px;
}

/* Error message */
.ai-error {
  display: none;
  background-color: #fef4f4;
  border: 1px solid #f5d3d3;
  color: #c93434;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

/* Not configured state */
.ai-not-configured {
  text-align: center;
  padding: 8px 0;
}

.ai-not-configured p {
  color: #6e645a;
  margin-bottom: 20px;
  font-size: 14px;
}

.ai-not-configured-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* Loading state */
.ai-loading {
  display: none;
  text-align: center;
  padding: 20px;
}

.ai-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f5f3f0;
  border-top-color: #6e645a;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.ai-loading-text {
  font-size: 14px;
  color: #6e645a;
}

/* Modal footer */
.ai-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.ai-btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: inherit;
}

.ai-btn-secondary {
  background-color: #f5f3f0;
  color: #1a1815;
  border: 1px solid #d9d4cf;
}

.ai-btn-secondary:hover:not(:disabled) {
  background-color: #e8e4df;
}

.ai-btn-primary {
  background: linear-gradient(135deg, #6e645a 0%, #857a6e 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ai-btn-primary:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.ai-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* AI Generate button (main page) */
.btn-ai-generate {
  background: linear-gradient(135deg, #6e645a 0%, #857a6e 100%);
  color: white;
  border: none;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-ai-generate:hover {
  background: linear-gradient(135deg, #5a5248 0%, #6e645a 100%);
}

.btn-ai-generate .sparkle {
  font-size: 15px;
  animation: sparkle 1.5s infinite;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

@keyframes sparkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; transform: scale(1.1); }
}

/* Responsive design */
@media (max-width: 600px) {
  .ai-modal-content {
    padding: 24px;
    width: 95%;
  }

  .ai-modal-header h2 {
    font-size: 20px;
  }

  .ai-btn {
    padding: 10px 20px;
    font-size: 13px;
  }
}
