* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #2d3748;
  background: #fafafa;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

header {
  text-align: center;
  margin-bottom: 32px;
}

header h1 {
  font-size: 32px;
  font-weight: 700;
  color: #8b7fc7;
  margin-bottom: 8px;
}

.subtitle {
  color: #718096;
  font-size: 16px;
}

.card {
  background: #fff;
  border: 1px solid #e8e4f0;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: #2d3748;
}

.btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, #8b7fc7, #9d8fd4);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-1px);
  background: #7c6fb8;
}

.btn-secondary {
  background: #fff;
  border: 1px solid #e8e4f0;
  color: #2d3748;
}

.btn-secondary:hover {
  background: #f7f5fb;
  border-color: #8b7fc7;
}

.btn-danger {
  background: #fc8181;
  color: white;
}

.btn-danger:hover {
  background: #f56565;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

/* Debate Selector */
.debate-selector .debate-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.debate-selector label {
  font-weight: 600;
  margin-right: 12px;
  color: #2d3748;
}

.debate-selector select {
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid #e8e4f0;
  border-radius: 8px;
  min-width: 300px;
}

.debate-selector select:focus {
  outline: none;
  border-color: #8b7fc7;
  box-shadow: 0 0 0 3px rgba(139, 127, 199, 0.1);
}

/* Cheat Sheet */
.cheat-sheet-content {
  background: #f7f5fb;
  padding: 16px;
  border-radius: 8px;
  white-space: pre-wrap;
  min-height: 100px;
  line-height: 1.8;
}

/* Grid Layout */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

/* Lists */
.list-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list-item {
  background: #f7f5fb;
  border: 1px solid #e8e4f0;
  border-radius: 8px;
  padding: 16px;
  transition: all 0.2s;
}

.list-item:hover {
  border-color: #8b7fc7;
  transform: translateX(2px);
}

.list-item-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 8px;
}

.list-item-title {
  font-weight: 600;
  color: #2d3748;
  font-size: 15px;
}

.list-item-meta {
  color: #718096;
  font-size: 13px;
  margin-top: 4px;
}

.list-item-actions {
  display: flex;
  gap: 8px;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
}

.badge-pending {
  background: rgba(139, 127, 199, 0.15);
  color: #6b5ba0;
}

.badge-active {
  background: rgba(104, 211, 145, 0.15);
  color: #2f855a;
}

.badge-completed {
  background: rgba(157, 214, 197, 0.15);
  color: #2c7a7b;
}

/* AI Assistant */
.ai-assistant {
  background: linear-gradient(135deg, #f7f5fb 0%, #fff 100%);
}

.ai-chat {
  display: flex;
  flex-direction: column;
  height: 400px;
}

.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #fff;
  border: 1px solid #e8e4f0;
  border-radius: 8px;
  margin-bottom: 16px;
}

.ai-message {
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 8px;
  line-height: 1.6;
}

.ai-message.user {
  background: #8b7fc7;
  color: white;
  margin-left: 20%;
}

.ai-message.assistant {
  background: #f7f5fb;
  color: #2d3748;
  margin-right: 20%;
}

.ai-message strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  opacity: 0.8;
}

.ai-input-area {
  display: flex;
  gap: 12px;
}

.ai-input-area input {
  flex: 1;
  padding: 12px 16px;
  font-size: 14px;
  border: 1px solid #e8e4f0;
  border-radius: 8px;
}

.ai-input-area input:focus {
  outline: none;
  border-color: #8b7fc7;
  box-shadow: 0 0 0 3px rgba(139, 127, 199, 0.1);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-content.large {
  max-width: 800px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid #e8e4f0;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: #2d3748;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #718096;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
}

.modal-close:hover {
  color: #2d3748;
}

.modal form {
  padding: 24px;
}

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

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #2d3748;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid #e8e4f0;
  border-radius: 8px;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #8b7fc7;
  box-shadow: 0 0 0 3px rgba(139, 127, 199, 0.1);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.empty-state {
  color: #718096;
  font-style: italic;
  text-align: center;
  padding: 32px;
}

.hidden {
  display: none;
}

/* Responsive */
@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .debate-selector .debate-header {
    flex-direction: column;
    align-items: stretch;
  }

  .debate-selector select {
    min-width: 100%;
  }

  .ai-message.user,
  .ai-message.assistant {
    margin-left: 0;
    margin-right: 0;
  }
}