@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Sinhala:wght@400;500;600;700&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #f6f8fc;
  --card-bg: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --color-indigo: #5c67f2;
  --color-indigo-hover: #4a54d4;
  --color-green: #10b981;
  --color-green-hover: #059669;
  --color-orange: #f59e0b;
  --color-red: #ef4444;
  --color-red-hover: #dc2626;
  --font-family: 'Noto Sans Sinhala', 'Outfit', sans-serif;
  --transition-speed: 0.3s;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 1rem;
}

/* Header Styles */
header {
  text-align: center;
  margin-bottom: 2rem;
  width: 100%;
  max-width: 800px;
}

header h1 {
  font-size: 2.2rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 500;
}

/* Main Container */
main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1000px;
  margin: 1rem 0;
}

/* Feedback Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  width: 100%;
  max-width: 900px;
}

/* Base Card Style */
.card {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.02);
  cursor: pointer;
  transition: transform var(--transition-speed) cubic-bezier(0.34, 1.56, 0.64, 1), 
              box-shadow var(--transition-speed) ease;
  border: 1px solid rgba(226, 232, 240, 0.8);
  user-select: none;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(92, 103, 242, 0.08), 0 1px 3px rgba(92, 103, 242, 0.04);
}

.card:active {
  transform: translateY(-2px);
}

/* Emoji Circle Container */
.emoji-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background-color: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem auto;
  font-size: 3.5rem;
  transition: transform var(--transition-speed) ease;
}

.card:hover .emoji-circle {
  transform: scale(1.1);
}

.card-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Success State Screen */
.success-container {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(246, 248, 252, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 1.5rem;
}

.success-card {
  text-align: center;
  background: var(--card-bg);
  border-radius: 24px;
  padding: 4rem 2rem;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(226, 232, 240, 0.8);
  animation: scaleIn var(--transition-speed) cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: default;
}

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

.success-icon {
  width: 80px;
  height: 80px;
  background-color: #ecfdf5;
  color: var(--color-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  margin: 0 auto 1.5rem auto;
  box-shadow: 0 0 0 10px #f0fdf4;
}

.success-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.success-message {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Dashboard Stats Layout */
.dashboard-container {
  width: 100%;
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  width: 100%;
}

.stat-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(226, 232, 240, 0.6);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 120px;
}

.stat-label {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  margin-top: 1rem;
}

/* Custom coloring for specific stats based on user image */
.stat-total .stat-value {
  color: var(--color-indigo);
}

.stat-very-good .stat-value {
  color: var(--color-green);
}

.stat-good .stat-value {
  color: var(--color-orange);
}

.stat-poor .stat-value {
  color: var(--color-red);
}

/* Actions Section */
.actions-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1rem;
  width: 100%;
}

.btn {
  font-family: var(--font-family);
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.85rem 1.75rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  min-width: 160px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.btn:active {
  transform: translateY(1px);
}

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

.btn-indigo:hover {
  background-color: var(--color-indigo-hover);
  box-shadow: 0 6px 12px rgba(92, 103, 242, 0.15);
}

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

.btn-green:hover {
  background-color: var(--color-green-hover);
  box-shadow: 0 6px 12px rgba(16, 185, 129, 0.15);
}

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

.btn-red:hover {
  background-color: var(--color-red-hover);
  box-shadow: 0 6px 12px rgba(239, 68, 68, 0.15);
}

/* Footer */
footer {
  width: 100%;
  max-width: 1000px;
  text-align: center;
  padding-top: 2rem;
  margin-top: 3rem;
  border-top: 1px solid rgba(226, 232, 240, 0.8);
}

footer p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
}

/* Responsive Rules */
@media (max-width: 768px) {
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  header h1 {
    font-size: 1.8rem;
  }
  
  .actions-container {
    flex-direction: column;
    align-items: stretch;
  }
  
  .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Print Styles */
@media print {
  body {
    background-color: white;
    padding: 0;
    color: black;
  }
  
  main {
    margin: 0;
  }
  
  .dashboard-container {
    gap: 1rem;
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1rem;
  }
  
  .stat-card {
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
  }

  .actions-container {
    display: none !important;
  }
  
  footer {
    border-top: 1px solid #cbd5e1 !important;
    margin-top: 2rem;
    padding-top: 1rem;
  }
}
