/* =============================================
   PMK Customer Satisfaction — Google Theme
   ============================================= */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&family=Google+Sans:wght@400;500;700&display=swap');

:root {
  /* Google Brand Colors */
  --google-blue:   #1A73E8;
  --google-blue-dk:#1557B0;
  --google-blue-lt:#E8F0FE;
  --google-red:    #EA4335;
  --google-yellow: #F9AB00;
  --google-green:  #1E8E3E;

  --primary:        var(--google-blue);
  --primary-dark:   var(--google-blue-dk);
  --primary-light:  var(--google-blue-lt);
  --success:        var(--google-green);
  --warning:        var(--google-yellow);
  --danger:         var(--google-red);

  /* Stat card gradients — Google 4 colors */
  --grad-blue:   linear-gradient(135deg, #4285F4 0%, #1A73E8 100%);
  --grad-red:    linear-gradient(135deg, #EA4335 0%, #C5221F 100%);
  --grad-yellow: linear-gradient(135deg, #FBBC05 0%, #F9AB00 100%);
  --grad-green:  linear-gradient(135deg, #34A853 0%, #1E8E3E 100%);

  --sidebar-bg:  #ffffff;
  --body-bg:     #F8F9FA;
  --card-bg:     #ffffff;
  --text-dark:   #202124;
  --text-muted:  #5F6368;
  --border:      #DADCE0;
  --shadow-sm:   0 1px 3px rgba(60,64,67,0.12), 0 1px 2px rgba(60,64,67,0.08);
  --shadow:      0 2px 6px rgba(60,64,67,0.15), 0 1px 3px rgba(60,64,67,0.10);
  --radius:      12px;
  --radius-sm:   8px;
}

/* ===== RESET & BASE ===== */
* { box-sizing: border-box; font-family: 'Roboto', sans-serif; }
body { margin: 0; background: var(--body-bg); color: var(--text-dark); }

/* ===== WRAPPER ===== */
.wrapper { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
#sidebar {
  width: 256px; min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 1050; transition: width 0.25s ease;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
#sidebar.collapsed { width: 72px; }
#sidebar.collapsed .sidebar-header h5,
#sidebar.collapsed .sidebar-header small,
#sidebar.collapsed .nav-section,
#sidebar.collapsed a span,
#sidebar.collapsed .user-info div,
#sidebar.collapsed .logout-btn span { display: none; }

.sidebar-header {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.brand-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--google-blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; color: white; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(26,115,232,0.35);
}
.sidebar-header h5 { color: var(--text-dark); font-weight: 700; margin: 0; font-size: 0.92rem; font-family: 'Google Sans', 'Roboto', sans-serif; line-height: 1.2; }
.sidebar-header small { color: var(--text-muted); font-size: 0.72rem; display: block; }

.sidebar-nav { list-style: none; padding: 8px 0; margin: 0; flex: 1; overflow-y: auto; }
.sidebar-nav .nav-section {
  color: #1A73E8; font-size: 0.67rem; font-weight: 700;
  padding: 14px 20px 4px; text-transform: uppercase; letter-spacing: 0.12em;
}
.sidebar-nav a {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 12px 10px 16px; color: var(--text-muted);
  text-decoration: none; font-size: 0.875rem;
  transition: all 0.15s; border-radius: 0 24px 24px 0;
  margin: 1px 8px 1px 0; font-weight: 400;
}
.sidebar-nav a:hover {
  background: #F1F3F4;
  color: var(--text-dark);
}
.sidebar-nav a.active {
  background: var(--google-blue-lt);
  color: var(--google-blue);
  font-weight: 700;
}
.sidebar-nav a i { font-size: 1.1rem; min-width: 22px; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.user-info { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--google-blue);
  color: white; display: flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0; font-size: 0.9rem;
  font-family: 'Google Sans', sans-serif;
}
.user-info .fw-semibold { color: var(--text-dark); font-size: 0.87rem; font-weight: 500; }
.logout-btn {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-muted); text-decoration: none; font-size: 0.83rem;
  transition: color 0.15s; font-weight: 400;
  padding: 6px 8px; border-radius: var(--radius-sm);
}
.logout-btn:hover { color: var(--google-red); background: #FEF2F2; }

/* ===== CONTENT ===== */
#content {
  margin-left: 256px; flex: 1;
  display: flex; flex-direction: column;
  transition: margin-left 0.25s;
}
#content.expanded { margin-left: 72px; }

.top-bar {
  height: 60px; background: white;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px; position: sticky; top: 0; z-index: 990;
  box-shadow: var(--shadow-sm);
}
#sidebarToggle {
  background: none; border: none; font-size: 1.4rem;
  cursor: pointer; color: var(--text-muted); padding: 6px;
  border-radius: 50%;
  transition: background 0.15s, color 0.15s;
}
#sidebarToggle:hover { background: #F1F3F4; color: var(--text-dark); }
.breadcrumb-area { font-weight: 700; color: var(--google-blue); font-size: 1rem; font-family: 'Google Sans', sans-serif; letter-spacing: 0.01em; }

.main-content { padding: 24px; flex: 1; }

/* ===== STAT CARDS ===== */
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 16px;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s, transform 0.2s;
}
.stat-card:hover {
  box-shadow: 0 4px 12px rgba(60,64,67,0.20);
  transform: translateY(-2px);
}

/* Coloured stat-card variant */
.stat-card.card-blue   { background: var(--grad-blue);   border: none; }
.stat-card.card-red    { background: var(--grad-red);    border: none; }
.stat-card.card-yellow { background: var(--grad-yellow); border: none; }
.stat-card.card-green  { background: var(--grad-green);  border: none; }

.stat-card.card-blue   .stat-value,
.stat-card.card-red    .stat-value,
.stat-card.card-yellow .stat-value,
.stat-card.card-green  .stat-value  { color: white; }
.stat-card.card-blue   .stat-label,
.stat-card.card-red    .stat-label,
.stat-card.card-yellow .stat-label,
.stat-card.card-green  .stat-label  { color: rgba(255,255,255,0.85); }

.stat-icon {
  width: 50px; height: 50px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.45rem; flex-shrink: 0;
}
/* icon on plain card */
.stat-icon.blue   { background: #E8F0FE; color: var(--google-blue); }
.stat-icon.red    { background: #FCE8E6; color: var(--google-red); }
.stat-icon.yellow { background: #FEF7E0; color: var(--google-yellow); }
.stat-icon.green  { background: #E6F4EA; color: var(--google-green); }
/* icon on coloured card */
.stat-card.card-blue   .stat-icon,
.stat-card.card-red    .stat-icon,
.stat-card.card-yellow .stat-icon,
.stat-card.card-green  .stat-icon  {
  background: rgba(255,255,255,0.22); color: white; font-size: 1.3rem;
}

.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--text-dark); line-height: 1; font-family: 'Google Sans', sans-serif; }
.stat-label { color: var(--text-muted); font-size: 0.82rem; margin-top: 4px; font-weight: 400; }

/* ===== CHART / GENERIC CARD ===== */
.chart-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.chart-card h6 { font-weight: 500; color: var(--text-dark); margin-bottom: 16px; font-size: 0.9rem; font-family: 'Google Sans', sans-serif; }

/* ===== TABLE CARD ===== */
.table-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}
.table-card .card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: white;
  border-left: 4px solid var(--google-blue);
}
.table-card .card-header span { color: var(--text-dark); font-weight: 700; font-family: 'Google Sans', sans-serif; font-size:0.95rem; }
.table thead th {
  background: #E8F0FE;
  font-weight: 600;
  font-size: 0.78rem;
  color: #1A73E8;
  border: none;
  padding: 11px 16px;
  border-bottom: 2px solid #C5D9F7;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.table tbody td {
  padding: 11px 16px; vertical-align: middle;
  border-color: var(--border); color: var(--text-dark);
  font-size: 0.875rem;
}
.table-hover tbody tr:hover > * { background: #F8F9FA !important; }

/* ===== BADGE / SCORE ===== */
.score-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 20px; font-weight: 500; font-size: 0.82rem;
}
.score-high   { background: #E6F4EA; color: #1E8E3E; }
.score-medium { background: #FEF7E0; color: #B06000; }
.score-low    { background: #FCE8E6; color: #C5221F; }

/* ===== FORM CONTROLS ===== */
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-dark);
  padding: 9px 13px;
  font-family: 'Roboto', sans-serif;
  background: white;
  font-size: 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--google-blue);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.15);
  outline: none;
}
.form-label { color: var(--text-dark); font-weight: 500; font-size: 0.85rem; }

/* ===== BUTTONS ===== */
.btn-primary {
  background: var(--google-blue);
  border: none; border-radius: var(--radius-sm);
  padding: 9px 22px; font-family: 'Roboto', sans-serif; font-weight: 500;
  color: white;
  box-shadow: 0 2px 6px rgba(26,115,232,0.30);
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  letter-spacing: 0.01em;
}
.btn-primary:hover {
  background: var(--google-blue-dk);
  box-shadow: 0 4px 12px rgba(26,115,232,0.40);
  transform: translateY(-1px); color: white;
}
.btn-primary:active { transform: translateY(0); }

.btn-success {
  background: var(--google-green); border: none; border-radius: var(--radius-sm);
  padding: 9px 22px; font-family: 'Roboto', sans-serif; font-weight: 500; color: white !important;
  box-shadow: 0 2px 6px rgba(30,142,62,0.30); transition: background 0.15s, box-shadow 0.15s, transform 0.1s; letter-spacing: 0.01em;
}
.btn-success:hover { background: #177132; box-shadow: 0 4px 12px rgba(30,142,62,0.40); transform: translateY(-1px); color: white !important; }
.btn-success:active { transform: translateY(0); }

.btn-danger {
  background: var(--google-red); border: none; border-radius: var(--radius-sm);
  padding: 9px 22px; font-family: 'Roboto', sans-serif; font-weight: 500; color: white !important;
  box-shadow: 0 2px 6px rgba(234,67,53,0.30); transition: background 0.15s, box-shadow 0.15s, transform 0.1s; letter-spacing: 0.01em;
}
.btn-danger:hover { background: #CE352A; box-shadow: 0 4px 12px rgba(234,67,53,0.40); transform: translateY(-1px); color: white !important; }
.btn-danger:active { transform: translateY(0); }

.btn-warning {
  background: var(--google-yellow); border: none; border-radius: var(--radius-sm);
  padding: 9px 22px; font-family: 'Roboto', sans-serif; font-weight: 500; color: white !important;
  box-shadow: 0 2px 6px rgba(249,171,0,0.30); transition: background 0.15s, box-shadow 0.15s, transform 0.1s; letter-spacing: 0.01em;
}
.btn-warning:hover { background: #E09900; box-shadow: 0 4px 12px rgba(249,171,0,0.40); transform: translateY(-1px); color: white !important; }
.btn-warning:active { transform: translateY(0); }

.btn-outline-primary {
  border: 1px solid var(--google-blue); color: var(--google-blue);
  border-radius: var(--radius-sm); background: transparent;
  font-weight: 500; font-family: 'Roboto', sans-serif; font-size: 0.875rem;
}
.btn-outline-primary:hover { background: var(--google-blue-lt); color: var(--google-blue); border-color: var(--google-blue); }

.btn-outline-secondary {
  border: 1px solid var(--border); color: var(--text-muted);
  border-radius: var(--radius-sm); background: transparent;
  font-weight: 500; font-family: 'Roboto', sans-serif; font-size: 0.875rem;
}
.btn-outline-secondary:hover { background: #F1F3F4; color: var(--text-dark); border-color: #BDC1C6; }

.btn-outline-success {
  border: 1px solid #34A853; color: #1E8E3E;
  border-radius: var(--radius-sm); background: transparent;
  font-weight: 500; font-family: 'Roboto', sans-serif; font-size: 0.875rem;
}
.btn-outline-success:hover { background: #E6F4EA; color: #1E8E3E; }

.btn-outline-danger {
  border: 1px solid #EA4335; color: #C5221F;
  border-radius: var(--radius-sm); background: transparent;
  font-size: 0.875rem;
}
.btn-outline-danger:hover { background: #FCE8E6; color: #C5221F; }

.btn-secondary {
  background: #F1F3F4; border: 1px solid var(--border);
  color: var(--text-muted); border-radius: var(--radius-sm);
  font-family: 'Roboto', sans-serif; font-size: 0.875rem;
}
.btn-secondary:hover { background: #E8EAED; color: var(--text-dark); }

/* ===== MODAL ===== */
.modal-content {
  background: white; border: none;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(60,64,67,0.20);
}
.modal-header { border-bottom: 1px solid var(--border); padding: 16px 24px; }
.modal-footer { border-top: 1px solid var(--border); padding: 12px 24px; }
.modal-title { color: var(--text-dark); font-weight: 500; font-family: 'Google Sans', sans-serif; }

/* ===== ALERT ===== */
.alert-info    { background: #E8F0FE; border: 1px solid #AECBFA; color: #174EA6; border-radius: var(--radius); }
.alert-success { background: #E6F4EA; border: 1px solid #A8D5B5; color: #1E8E3E; }
.alert-danger  { background: #FCE8E6; border: 1px solid #F5C6C4; color: #C5221F; }

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: #F8F9FA;
  padding: 20px;
}
.login-card {
  background: white; border-radius: 16px;
  padding: 48px 40px; width: 100%; max-width: 420px;
  box-shadow: 0 4px 16px rgba(60,64,67,0.20);
  border: 1px solid var(--border);
}
.login-logo {
  width: 64px; height: 64px; border-radius: 14px;
  background: var(--google-blue);
  box-shadow: 0 4px 14px rgba(26,115,232,0.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: white; margin: 0 auto 20px;
}

/* ===== SURVEY FORM ===== */
.survey-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #E8F0FE 0%, #F8F9FA 50%, #E6F4EA 100%);
  padding: 20px;
}
.survey-card {
  background: white; border-radius: 16px;
  max-width: 720px; margin: 0 auto;
  box-shadow: 0 4px 20px rgba(60,64,67,0.15);
  overflow: hidden;
  border: 1px solid var(--border);
}
.survey-header {
  background: var(--google-blue);
  padding: 28px; color: white;
}
.survey-body { padding: 28px; }
.survey-step { border-left: 3px solid var(--google-blue); padding-left: 16px; margin-bottom: 26px; }
.survey-step label { font-weight: 500; color: var(--text-dark); margin-bottom: 8px; display: block; }
.survey-step .required { color: var(--google-red); }

/* Star Rating */
.star-rating { display: flex; gap: 6px; }
.star-rating input { display: none; }
.star-rating label {
  font-size: 2rem; cursor: pointer; color: #DADCE0;
  transition: color 0.15s; user-select: none;
}
.star-rating { flex-direction: row-reverse; }
.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label { color: var(--google-yellow); }

/* ===== RANK BADGE ===== */
.rank-badge {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
  font-family: 'Google Sans', sans-serif;
}
.rank-1     { background: #FEF7E0; color: #B06000; }
.rank-2     { background: #F1F3F4; color: #3C4043; }
.rank-3     { background: #FCE8E6; color: #C5221F; }
.rank-other { background: #F1F3F4; color: #5F6368; }

/* ===== BADGE overrides ===== */
.badge.bg-light { background: #F1F3F4 !important; color: #5F6368 !important; border: 1px solid var(--border); }
.badge.bg-info  { background: #E8F0FE !important; color: #174EA6 !important; }
.badge.bg-primary { background: var(--google-blue) !important; }

/* ===== INPUT GROUP ===== */
.input-group-text {
  border: 1px solid var(--border); font-size: 0.875rem; background: white;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.input-group .form-control { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group-text + .form-control { border-left: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  #sidebar { transform: translateX(-100%); width: 256px !important; transition: transform 0.25s ease; border-right:none; }
  #sidebar.mobile-open { transform: translateX(0); }
  
  #sidebar.collapsed .sidebar-header h5,
  #sidebar.collapsed .sidebar-header small,
  #sidebar.collapsed .nav-section,
  #sidebar.collapsed a span,
  #sidebar.collapsed .user-info div,
  #sidebar.collapsed .logout-btn span { display: block; }

  #content { margin-left: 0 !important; width: 100%; transition: margin 0.25s ease; }
  #content.expanded { margin-left: 0 !important; }
  .main-content { padding: 16px; }
  .top-bar { padding: 0 16px; }

  /* Stat Cards adjustments */
  .stat-card {
    padding: 14px 12px; gap: 10px;
    flex-direction: column; text-align: center;
    align-items: center; justify-content: center;
  }
  .stat-icon { width: 42px; height: 42px; font-size: 1.25rem; }
  .stat-value { font-size: 1.25rem; }
  .stat-label { font-size: 0.75rem; margin-top: 0; }
}

#sidebar-backdrop {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 1040;
  opacity: 0; transition: opacity 0.25s ease;
}
#sidebar-backdrop.show { display: block; opacity: 1; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #F1F3F4; }
::-webkit-scrollbar-thumb { background: #BDC1C6; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--google-blue); }
