/* Survey System Styles */

:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--gray-800);
  background: var(--gray-50);
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Header */
header {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 1.5rem 0;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

header p {
  color: var(--gray-600);
  font-size: 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--gray-200);
  color: var(--gray-700);
}

.btn-secondary:hover {
  background: var(--gray-300);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

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

/* Google Login Button */
.google-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.google-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.google-btn img {
  width: 20px;
  height: 20px;
}

/* Progress Bar */
.progress-container {
  margin-bottom: 2rem;
}

.progress-bar {
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s ease;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-600);
}

/* Form Sections */
.form-section {
  background: white;
  border-radius: 0.75rem;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.25rem;
}

.section-description {
  color: var(--gray-600);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

/* Form Fields */
.form-field {
  margin-bottom: 1.5rem;
}

.form-field label {
  display: block;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.form-field label .required {
  color: var(--danger);
  margin-left: 0.25rem;
}

input[type="text"],
input[type="email"],
textarea,
select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

/* Radio and Checkbox Groups */
.option-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.option-group label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 400;
  cursor: pointer;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.option-group label:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.option-group input[type="radio"],
.option-group input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--primary);
}

/* Scale Rating */
.scale-rating {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.scale-option {
  flex: 1;
  text-align: center;
  padding: 1rem 0.5rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
}

.scale-option:hover {
  border-color: var(--primary);
  background: var(--gray-50);
}

.scale-option.selected {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.1);
}

.scale-option input {
  display: none;
}

.scale-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.scale-label {
  font-size: 0.75rem;
  color: var(--gray-600);
  margin-top: 0.25rem;
}

/* Navigation Buttons */
.form-navigation {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
}

.form-navigation .btn {
  flex: 1;
}

/* Loading State */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  color: var(--gray-600);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Error and Success Messages */
.message {
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.message-success {
  background: rgba(16, 185, 129, 0.1);
  color: #065f46;
  border: 1px solid var(--success);
}

.message-error {
  background: rgba(239, 68, 68, 0.1);
  color: #991b1b;
  border: 1px solid var(--danger);
}

.message-info {
  background: rgba(37, 99, 235, 0.1);
  color: #1e40af;
  border: 1px solid var(--primary);
}

/* Admin Dashboard */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.survey-grid {
  display: grid;
  gap: 1.5rem;
}

.survey-card {
  background: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--gray-200);
}

.survey-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.survey-card .stats {
  display: flex;
  gap: 2rem;
  margin: 1rem 0;
}

.survey-card .stat {
  font-size: 0.875rem;
  color: var(--gray-600);
}

.survey-card .stat-value {
  font-weight: 700;
  color: var(--gray-900);
}

.survey-card .actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Response Table */
.response-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.response-table th,
.response-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.response-table th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-700);
  font-size: 0.875rem;
}

.response-table td {
  font-size: 0.875rem;
}

.response-table tr:hover {
  background: var(--gray-50);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.pagination button {
  padding: 0.5rem 1rem;
  border: 1px solid var(--gray-300);
  background: white;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s;
}

.pagination button:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.pagination button.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Responsive */
@media (max-width: 640px) {
  .container {
    padding: 1rem;
  }

  .form-section {
    padding: 1.5rem;
  }

  .scale-rating {
    flex-wrap: wrap;
  }

  .scale-option {
    min-width: calc(33.333% - 0.5rem);
  }

  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .survey-card .stats {
    flex-direction: column;
    gap: 0.5rem;
  }
}
