/* ==========================================================
   SIMRS Rating & Survey System - Modern UI Stylesheet
   ========================================================== */

:root {
  --primary: #0284c7;
  --primary-dark: #0369a1;
  --primary-light: #e0f2fe;
  --teal: #0d9488;
  --teal-dark: #0f766e;
  --emerald: #10b981;
  --amber: #f59e0b;
  --gold: #fbbf24;
  --rose: #f43f5e;
  
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #0e3a53 50%, #042f2e 100%);
  --card-bg: rgba(255, 255, 255, 0.98);
  --card-border: rgba(255, 255, 255, 0.2);
  
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 25px rgba(251, 191, 36, 0.4);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-gradient);
  min-height: 100vh;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  overflow-x: hidden;
}

/* Background animated decorative orbs */
.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
}
.bg-orb-1 {
  top: -10%;
  left: -5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #0284c7, transparent);
}
.bg-orb-2 {
  bottom: -10%;
  right: -5%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #10b981, transparent);
}

/* Container */
.survey-wrapper {
  width: 100%;
  max-width: 580px;
  position: relative;
  z-index: 10;
  animation: fadeIn 0.5s ease-out;
}

/* Main Card */
.survey-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  padding: 36px 32px;
  overflow: hidden;
  position: relative;
}

/* Header */
.survey-header {
  text-align: center;
  margin-bottom: 28px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.brand-badge svg {
  width: 16px;
  height: 16px;
}

.survey-header h1 {
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
  margin-bottom: 8px;
}

.survey-header p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Star Rating Section (Google Style) */
.star-rating-section {
  text-align: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 24px 16px;
  margin-bottom: 24px;
  transition: var(--transition);
}

.star-rating-section:focus-within,
.star-rating-section.active {
  border-color: #cbd5e1;
  background: #ffffff;
  box-shadow: var(--shadow-md);
}

.star-rating-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 14px;
}

/* Google-style Star Interactive Buttons */
.stars-container {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  direction: ltr;
}

.star-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.star-btn svg {
  width: 44px;
  height: 44px;
  fill: #e2e8f0;
  stroke: #cbd5e1;
  stroke-width: 1;
  transition: fill 0.2s ease, stroke 0.2s ease, filter 0.2s ease;
}

.star-btn:hover {
  transform: scale(1.25);
}

.star-btn:active {
  transform: scale(1.1);
}

/* Active & Hover states for stars */
.star-btn.is-active svg,
.star-btn.is-hover svg {
  fill: var(--gold);
  stroke: #d97706;
  filter: drop-shadow(0 2px 8px rgba(245, 158, 11, 0.45));
}

/* Emotion / Rating dynamic pill */
.rating-expression {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  transition: var(--transition);
  background: #f1f5f9;
  color: var(--text-muted);
  min-height: 32px;
}

.rating-expression.star-1 { background: #ffe4e6; color: #e11d48; }
.rating-expression.star-2 { background: #ffedd5; color: #ea580c; }
.rating-expression.star-3 { background: #fef3c7; color: #d97706; }
.rating-expression.star-4 { background: #e0f2fe; color: #0284c7; }
.rating-expression.star-5 { background: #dcfce7; color: #16a34a; }

/* Quick Suggestion Chips */
.quick-chips-wrapper {
  margin-bottom: 18px;
}
.chips-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.chip-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
  border-color: #cbd5e1;
}
.chip-btn.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35);
}

/* Form Group */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 8px;
}

.form-label .required {
  color: var(--rose);
  margin-left: 2px;
}

.form-textarea,
.form-input,
.form-select {
  width: 100%;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  color: #1e293b;
  background: #ffffff;
  transition: var(--transition);
  outline: none;
}

.form-textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}

.form-textarea:focus,
.form-input:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.form-textarea.is-invalid,
.form-input.is-invalid {
  border-color: var(--rose);
  background-color: #fff1f2;
}

.form-meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 500px) {
  .form-meta-row {
    grid-template-columns: 1fr;
  }
}

.anon-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  cursor: pointer;
  user-select: none;
}

.anon-toggle-wrapper input {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}

.anon-toggle-label {
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}

/* Submit Button */
.btn-submit {
  width: 100%;
  background: linear-gradient(135deg, #0284c7 0%, #0d9488 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--transition);
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.45);
  background: linear-gradient(135deg, #0369a1 0%, #0f766e 100%);
}

.btn-submit:active:not(:disabled) {
  transform: translateY(0);
}

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

/* Spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
}

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

/* Alert Notification */
.alert-box {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
  display: none;
  animation: slideDown 0.3s ease;
}

.alert-box.error {
  display: block;
  background: #ffe4e6;
  border: 1px solid #fecdd3;
  color: #be123c;
}

.alert-box.success {
  display: block;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

/* Success Card View */
.success-card {
  display: none;
  text-align: center;
  padding: 24px 8px;
  animation: scaleUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.success-icon-wrap {
  width: 72px;
  height: 72px;
  background: #dcfce7;
  border: 4px solid #bbf7d0;
  color: #16a34a;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  animation: pulse 1.5s infinite;
}

.success-card h2 {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
}

.success-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.success-summary {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
  text-align: left;
}

.success-summary-stars {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
  font-size: 22px;
  color: var(--gold);
}

.success-summary-text {
  font-size: 13px;
  color: #334155;
  font-style: italic;
}

.btn-secondary {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Footer link to admin */
.survey-footer {
  margin-top: 24px;
  text-align: center;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: var(--transition);
}

.admin-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
