/* ==========================================================================
   FRIDAY 5S WEB APPLICATION STYLESHEET
   Aesthetics: Premium Clean Slate & Energetic Clean-Green Accent
   ========================================================================== */

/* Design Tokens & Theme Variables */
:root {
  --font-primary: 'Outfit', 'Mitr', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Color Palette */
  --bg-app: #f4f7f6;
  --bg-card: #ffffff;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  
  --primary: #10b981; /* Emerald Green */
  --primary-hover: #059669;
  --primary-light: #ecfdf5;
  
  --secondary: #2563eb; /* Cobalt Blue */
  --secondary-hover: #1d4ed8;
  --secondary-light: #eff6ff;

  --accent-orange: #f59e0b;
  --accent-orange-light: #fffbeb;
  
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-light: #fef2f2;

  --border-color: #e5e7eb;
  --border-focus: #10b981;
  
  /* Shadows & Radius */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(16, 185, 129, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

/* Reset & Global */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar (Premium Aesthetic) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.02);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb {
  background: rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-full);
  transition: var(--transition-normal);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(16, 185, 129, 0.6);
}

/* Specific scrolling containers */
.table-container, .breakdown-list, .stat-breakdown-panel.show {
  scrollbar-width: thin;
  scrollbar-color: rgba(16, 185, 129, 0.4) transparent;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Typography Utilities */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: #111827;
}

.text-center { text-align: center; }
.text-green { color: var(--primary) !important; }
.text-blue { color: var(--secondary) !important; }
.text-orange { color: var(--accent-orange) !important; }
.hidden { display: none !important; }
.mt-2 { margin-top: 8px; }

.badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  background-color: var(--primary-light);
  color: var(--primary);
  margin-bottom: 12px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* App Header & Navigation */
.app-header {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  background: linear-gradient(135deg, var(--primary) 0%, #059669 100%);
  color: white;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.logo-area h1 {
  font-size: 1.35rem;
  line-height: 1.2;
}

.logo-area .subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tab-navigation {
  display: flex;
  gap: 12px;
}

.nav-btn, .chart-tab-btn {
  background: transparent;
  border: none;
  font-family: var(--font-primary);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.nav-btn, .chart-tab-btn:hover {
  background-color: #f3f4f6;
  color: var(--text-main);
}

.nav-btn, .chart-tab-btn.active {
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

/* Main Content Wrapper */
.main-content {
  padding-top: 40px;
  padding-bottom: 60px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

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

/* Section Title */
.section-title-area {
  margin-bottom: 32px;
}

.section-title-area h2 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.section-title-area p {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* Form Styles */
.form-wrapper {
  max-width: 960px;
  margin: 0 auto;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
  margin-bottom: 32px;
}

.form-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-size: 1.15rem;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #f3f4f6;
  padding-bottom: 12px;
}

.card-title i {
  color: var(--primary);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: #374151;
}

.required {
  color: var(--danger);
  margin-left: 2px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon i {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 1rem;
}

.input-with-icon input,
.input-with-icon select,
.modern-form textarea {
  width: 100%;
  padding: 12px 14px 12px 42px;
  font-family: var(--font-primary);
  font-size: 0.95rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: #fafbfa;
  color: var(--text-main);
  outline: none;
  transition: var(--transition-fast);
}

.modern-form textarea {
  padding: 12px 14px;
  resize: vertical;
}

.input-with-icon input:focus,
.input-with-icon select:focus,
.modern-form textarea:focus {
  border-color: var(--border-focus);
  background-color: var(--bg-card);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

/* Radio Toggle Cards */
.radio-card-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.radio-card {
  position: relative;
  cursor: pointer;
}

.radio-card input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.radio-card-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  background-color: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.radio-card input:checked + .radio-card-content {
  border-color: var(--primary);
  background-color: var(--primary-light);
  color: var(--primary);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.15);
}

.radio-card-content i {
  font-size: 1.2rem;
}

.subcategory-group {
  margin-top: 8px;
}

.small-card .radio-card-content {
  padding: 10px;
  font-size: 0.9rem;
}

/* Upload Photo Boxes */
.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.upload-box-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.before-label {
  background-color: var(--danger-light);
  color: var(--danger);
}

.after-label {
  background-color: var(--primary-light);
  color: var(--primary);
}

.upload-box {
  position: relative;
  aspect-ratio: 1 / 1.1;
  border: 2px dashed #d1d5db;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  overflow: hidden;
  background-color: #fafafa;
  transition: var(--transition-normal);
}

.upload-box:hover {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 5;
}

.upload-placeholder {
  text-align: center;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.upload-placeholder i {
  font-size: 2.2rem;
  margin-bottom: 12px;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.upload-box:hover .upload-placeholder i {
  color: var(--primary);
  transform: scale(1.1);
}

.upload-placeholder p {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 4px;
}

.file-size-hint {
  font-size: 0.7rem;
}

.preview-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  background-color: #000;
}

.img-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.remove-img-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background-color: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.9rem;
  z-index: 15;
  transition: var(--transition-fast);
}

.remove-img-btn:hover {
  background-color: var(--danger);
  transform: scale(1.1);
}

.image-compress-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Submit Actions */
.form-actions {
  margin-top: 32px;
}

.submit-btn {
  font-family: var(--font-primary);
  background: linear-gradient(135deg, var(--primary) 0%, #059669 100%);
  color: white;
  font-size: 1.05rem;
  font-weight: 500;
  border: none;
  padding: 14px 44px;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(16, 185, 129, 0.2);
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 20px rgba(16, 185, 129, 0.3);
}

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

/* Dashboard Header & Controls */
.dashboard-header-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  background-color: var(--bg-card);
  padding: 16px 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.dashboard-subtitle {
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.time-filter-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
}

.time-filter-wrapper select {
  padding: 8px 12px;
  font-family: var(--font-primary);
  font-size: 0.85rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  background-color: var(--bg-card);
  cursor: pointer;
  transition: var(--transition-fast);
}

.time-filter-wrapper select:focus {
  border-color: var(--primary);
}

/* Public View Notice */
.public-view-notice {
  background-color: var(--secondary-light);
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  color: var(--secondary);
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}

.public-view-notice i {
  font-size: 1.3rem;
  flex-shrink: 0;
}

/* Dashboard Styles - Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.04);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
}

#submissions-stat-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.stat-card-main {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.expand-breakdown-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-fast), color var(--transition-fast), transform var(--transition-normal);
  margin-left: auto;
  outline: none;
}

.expand-breakdown-btn:hover {
  background-color: var(--primary-light);
  color: var(--primary);
}

.expand-breakdown-btn.active {
  transform: rotate(180deg);
}

.stat-breakdown-panel {
  margin-top: 16px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal) ease-out, opacity var(--transition-normal) ease-out;
  opacity: 0;
}

.stat-breakdown-panel.show {
  max-height: 400px;
  opacity: 1;
  overflow-y: auto;
}

.breakdown-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.breakdown-search-wrapper i {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.breakdown-search-wrapper input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  font-family: var(--font-primary);
  font-size: 0.85rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  background-color: #fafbfa;
  transition: border-color var(--transition-fast);
}

.breakdown-search-wrapper input:focus {
  border-color: var(--primary);
  background-color: #fff;
}

.breakdown-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 250px;
  overflow-y: auto;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  transition: background-color var(--transition-fast);
}

.breakdown-item:hover {
  background-color: var(--primary-light);
}

.breakdown-item-name {
  font-weight: 500;
  color: var(--text-main);
}

.breakdown-item-count {
  font-weight: 600;
  background-color: var(--secondary-light);
  color: var(--secondary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.6rem;
}

.bg-light-green { background-color: var(--primary-light); }
.bg-light-blue { background-color: var(--secondary-light); }
.bg-light-orange { background-color: var(--accent-orange-light); }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-info h3 {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 2px 0;
}

.stat-subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Dashboard Visual Rows */
.dashboard-visual-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  margin-bottom: 40px;
}

.visual-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.04);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.visual-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
}

.chart-card {
  min-height: 380px;
}

.chart-dept-checklist-panel {
  margin-top: 16px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.checklist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.checklist-actions {
  display: flex;
  gap: 8px;
}

.checklist-action-btn {
  background-color: #f3f4f6;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.checklist-action-btn:hover {
  background-color: var(--primary-light);
  color: var(--primary);
}

.checklist-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-height: 180px;
  overflow-y: auto;
  padding: 4px;
}

@media (max-width: 900px) {
  .checklist-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .checklist-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  cursor: pointer;
  user-select: none;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.checklist-item:hover {
  background-color: #f9fafb;
}

.checklist-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
}

.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}

@media (max-width: 640px) {
  .chart-card-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

.chart-mode-select {
  padding: 6px 12px;
  font-family: var(--font-primary);
  font-size: 0.82rem;
  font-weight: 500;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  background-color: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition-fast);
}

.chart-mode-select:focus {
  border-color: var(--primary);
}

.chart-container {
  position: relative;
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Leaderboard Table Styles */
.leaderboard-card {
  min-height: 380px;
}

.leaderboard-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.leaderboard-card .card-title {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.leaderboard-card .table-container {
  max-height: 420px;
  overflow-y: auto;
  flex-grow: 1;
}

.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 16px;
}

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

.leaderboard-col {
  display: flex;
  flex-direction: column;
  background-color: #fafbfa;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
}

.leaderboard-col-title {
  font-size: 0.95rem;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modern-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.modern-table th {
  background-color: #f9fafb;
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4b5563;
  border-bottom: 1.5px solid var(--border-color);
}

.modern-table td {
  padding: 12px 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid #f3f4f6;
  color: var(--text-main);
  vertical-align: middle;
}

.modern-table tbody tr:hover {
  background-color: #fafafa;
}

.trophy-1 { color: #f59e0b; font-weight: 600; }
.trophy-2 { color: #9ca3af; font-weight: 600; }
.trophy-3 { color: #b45309; font-weight: 600; }
.rank-badge {
  display: inline-flex;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  justify-content: center;
  align-items: center;
  font-size: 0.8rem;
  background-color: #f3f4f6;
  color: var(--text-muted);
}

.trophy-1 .rank-badge { background-color: #fef3c7; color: #d97706; }
.trophy-2 .rank-badge { background-color: #f3f4f6; color: #4b5563; }
.trophy-3 .rank-badge { background-color: #ffedd5; color: #c2410c; }

/* Champion Campaign Styles */
.champion-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 4px;
  display: block;
}

.champion-podium-container {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 20px;
  margin: 40px 0 30px;
  min-height: 200px;
}

.podium-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 130px;
  transition: transform 0.3s ease;
}

.podium-item:hover {
  transform: translateY(-5px);
}

.podium-rank {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.podium-rank-1 { color: #f59e0b; font-size: 2rem; text-shadow: 0 0 15px rgba(245, 158, 11, 0.4); }
.podium-rank-2 { color: #9ca3af; }
.podium-rank-3 { color: #b45309; }

.podium-dept-name {
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  color: var(--text-main);
  margin-bottom: 4px;
}

.podium-avg {
  font-size: 1.2rem;
  font-weight: 800;
}

.podium-avg-1 { color: #d97706; }
.podium-avg-2 { color: #4b5563; }
.podium-avg-3 { color: #9a3412; }

.podium-capita {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: center;
}

.podium-bar {
  width: 100%;
  border-radius: 8px 8px 0 0;
  margin-top: 12px;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
}

.podium-bar-1 { height: 120px; background: linear-gradient(135deg, #fcd34d, #f59e0b); }
.podium-bar-2 { height: 80px; background: linear-gradient(135deg, #e5e7eb, #9ca3af); }
.podium-bar-3 { height: 60px; background: linear-gradient(135deg, #fed7aa, #ea580c); }

.champion-table th, .champion-table td {
  text-align: center;
}
.champion-table th:first-child, .champion-table td:first-child {
  text-align: left;
}
.champion-avg-cell {
  font-weight: 700;
  color: var(--primary);
  background-color: rgba(37, 99, 235, 0.05);
}

.empty-state {
  color: var(--text-muted);
  padding: 40px 0 !important;
  animation: fadeInOut 2s infinite alternate;
}

@keyframes fadeInOut {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

/* Gallery Feed Header */
.feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.feed-title {
  font-size: 1.25rem;
}

.filter-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box i {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.search-box input {
  padding: 8px 12px 8px 34px;
  font-family: var(--font-primary);
  font-size: 0.85rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  width: 220px;
  transition: var(--transition-fast);
}

.search-box input:focus {
  border-color: var(--primary);
  width: 280px;
}

.filter-controls select {
  padding: 8px 12px;
  font-family: var(--font-primary);
  font-size: 0.85rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  background-color: var(--bg-card);
}

/* Submissions Feed & Gallery */
.submissions-feed {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.empty-feed {
  grid-column: 1 / -1;
  padding: 80px 24px;
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-color);
  color: var(--text-muted);
  animation: pulseLight 3s infinite alternate;
}

@keyframes pulseLight {
  from { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
  to { box-shadow: 0 0 15px 0 rgba(16, 185, 129, 0.1); }
}

.empty-feed i {
  font-size: 3rem;
  margin-bottom: 16px;
  color: #d1d5db;
  animation: bounceSlow 2s infinite ease-in-out;
}

@keyframes bounceSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); color: var(--primary); }
}

/* Submission Card */
.feed-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.feed-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

/* Card Visual Comparison (Before / After side-by-side) */
.card-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  aspect-ratio: 16 / 10;
  position: relative;
  background-color: #eaeaea;
  cursor: pointer;
}

.card-img-wrapper {
  position: relative;
  overflow: hidden;
  height: 100%;
}

.card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.card-comparison:hover img {
  transform: scale(1.05);
}

.card-tag {
  position: absolute;
  top: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  color: white;
  z-index: 10;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.card-before-tag {
  left: 8px;
  background-color: rgba(239, 68, 68, 0.85);
}

.card-after-tag {
  right: 8px;
  background-color: rgba(16, 185, 129, 0.85);
}

.card-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background-color: white;
  z-index: 15;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
}

.card-category-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  color: white;
  z-index: 10;
  letter-spacing: 0.2px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cat-badge-common { background-color: rgba(16, 185, 129, 0.9); }
.cat-badge-personal { background-color: rgba(59, 130, 246, 0.9); }
.cat-badge-workspace { background-color: rgba(245, 158, 11, 0.9); }

/* Card Metadata */
.card-content {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-dept-tag {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: var(--secondary-light);
  color: var(--secondary);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
}

.card-desc {
  font-size: 0.88rem;
  color: var(--text-main);
  font-weight: 500;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.8em;
}

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

.card-author {
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-author i {
  color: var(--text-muted);
}

.card-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Success Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 480px;
  width: 90%;
  box-shadow: var(--shadow-xl);
  transform: scale(0.9);
  transition: transform var(--transition-normal);
}

.modal.open .modal-content {
  transform: scale(1);
}

.success-icon {
  width: 72px;
  height: 72px;
  background-color: var(--primary-light);
  border-radius: var(--radius-full);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  color: var(--primary);
  font-size: 2.2rem;
  margin-bottom: 24px;
  border: 2px solid rgba(16, 185, 129, 0.15);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.1);
}

.modal-content h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.modal-content p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 28px;
}

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-btn {
  font-family: var(--font-primary);
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: var(--transition-fast);
}

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

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

.modal-btn.btn-secondary {
  background-color: #f3f4f6;
  color: var(--text-main);
}

.modal-btn.btn-secondary:hover {
  background-color: #e5e7eb;
}

/* Lightbox Comparison Viewer */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(8px);
  z-index: 300;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.4rem;
  transition: var(--transition-fast);
}

.lightbox-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.lightbox-content {
  max-width: 1100px;
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 24px;
  transform: translateY(20px);
  transition: transform var(--transition-normal);
}

.lightbox.open .lightbox-content {
  transform: translateY(0);
}

.lightbox-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.lightbox-photo-wrapper {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: #111;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-photo-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lightbox-tag {
  position: absolute;
  top: 16px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  color: white;
  letter-spacing: 0.5px;
}

.before-tag {
  left: 16px;
  background-color: var(--danger);
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.4);
}

.after-tag {
  right: 16px;
  background-color: var(--primary);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.4);
}

.lightbox-info {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 24px;
  border-radius: var(--radius-lg);
  color: white;
}

.lightbox-info h4 {
  color: white;
  font-size: 1.25rem;
  margin-bottom: 4px;
}

.lightbox-meta {
  color: #9ca3af;
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.lightbox-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #e5e7eb;
}

/* App Footer */
.app-footer {
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-card);
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */

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

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
  
  .header-container {
    flex-direction: column;
    height: auto;
    padding: 16px 0;
    gap: 16px;
  }
  
  .tab-navigation {
    width: 100%;
  }
  
  .nav-btn, .chart-tab-btn {
    flex-grow: 1;
    justify-content: center;
    padding: 8px 12px;
    font-size: 0.85rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .stat-card {
    padding: 16px;
  }
  
  .submissions-feed {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .feed-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .filter-controls {
    width: 100%;
    flex-direction: column;
  }
  
  .search-box, .search-box input {
    width: 100% !important;
  }
  
  .filter-controls select {
    width: 100%;
  }

  .lightbox-comparison {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .lightbox-photo-wrapper {
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 480px) {
  .submissions-feed {
    grid-template-columns: 1fr;
  }
  
  .upload-grid {
    grid-template-columns: 1fr;
  }
  
  .upload-box {
    aspect-ratio: 4/3;
  }

  .modal-content {
    padding: 24px 16px;
  }
}
