/* Reset and base styles */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: #f5f7fa;
  color: #1a1a2e;
  line-height: 1.6;
}

/* Header */
.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem;
  text-align: center;
}

.header h1 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
}

.header p {
  margin: 0;
  opacity: 0.9;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* Card */
.card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.card-title {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  color: #1a1a2e;
}

.card-description {
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  color: #4a4a68;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  position: relative;
}

.card-description::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2em;
  background: linear-gradient(transparent, white);
  pointer-events: none;
}

.card-description ul, .card-description ol {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

.card-actions {
  display: flex;
  gap: 0.5rem;
}

/* Vote count */
.vote-count {
  font-weight: 600;
  color: #667eea;
  font-size: 0.9rem;
}

/* Buttons */
.btn {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: #f0f0f5;
  color: #4a4a68;
}

.btn-secondary:hover {
  background: #e5e5ed;
}

/* Modal */
.modal {
  padding: 0;
  border: none;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  display: flex;
  flex-direction: column;
}

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

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #999;
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  color: #333;
}

.modal-body {
  padding: 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
}

.modal-body h2 {
  font-size: 1.1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.modal-body h2:first-child {
  margin-top: 0;
}

.modal-body ul, .modal-body ol {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.modal-body p {
  margin: 0.5rem 0;
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-top: 1px solid #eee;
  background: #f9f9fb;
  border-radius: 0 0 12px 12px;
}

/* Form */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #333;
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
}

/* Response states */
.response-pending {
  padding: 1rem;
  background: #e8f4fd;
  border-radius: 6px;
  color: #1a73e8;
  text-align: center;
}

.response-success {
  padding: 1rem;
  background: #e6f4ea;
  border-radius: 6px;
  color: #1e8e3e;
  text-align: center;
}

.response-error {
  padding: 1rem;
  background: #fce8e6;
  border-radius: 6px;
  color: #d93025;
  text-align: center;
}

.response-already {
  padding: 1rem;
  background: #fef7e0;
  border-radius: 6px;
  color: #f9ab00;
  text-align: center;
}

/* Responsive */
@media (max-width: 640px) {
  .container {
    padding: 1rem;
  }
  
  .card-grid {
    grid-template-columns: 1fr;
  }
  
  .card-footer {
    flex-direction: column;
    gap: 1rem;
  }
  
  .card-actions {
    width: 100%;
  }
  
  .card-actions .btn {
    flex: 1;
  }
}
