/* Submissions List - Advanced Premium Design */

/* CSS Custom Properties for Design System */
:root {
  --primary-50: #fff7ed;
  --primary-100: #ffedd5;
  --primary-200: #fed7aa;
  --primary-400: #fb923c;
  --primary-500: #f21b23;
  --primary-600: #d91820;
  --primary-700: #c2410c;
  
  --neutral-50: #fafafa;
  --neutral-100: #e5e5e5;
  --neutral-200: #e5e5e5;
  --neutral-300: #d4d4d4;
  --neutral-400: #a3a3a3;
  --neutral-500: #737373;
  --neutral-600: #525252;
  --neutral-700: #404040;
  --neutral-800: #262626;
  --neutral-900: #171717;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Main Container */
.submissions-list-container {
  padding: 2.5rem 3rem;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 1.5rem;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Header */
.submissions-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--neutral-200);
}

.submissions-list-title {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--neutral-800) 0%, var(--neutral-600) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

/* Search bar */
.submissions-search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.submissions-search-input {
  flex: 1;
  min-width: 12rem;
  padding: 0.625rem 1rem;
  font-size: 0.9375rem;
  border: 2px solid var(--neutral-200);
  border-radius: 0.5rem;
  background: white;
  color: var(--neutral-800);
  transition: border-color 0.2s ease;
}

.submissions-search-input::placeholder {
  color: var(--neutral-400);
}

.submissions-search-input:focus {
  outline: none;
  border-color: var(--primary-500);
}

.submissions-search-btn {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
}

.submissions-clear-btn {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
}

.submissions-search-result-hint {
  font-size: 0.875rem;
  color: var(--neutral-600);
  margin: 0 0 0.75rem 0;
}

.submissions-empty-row {
  text-align: center;
  padding: 2rem !important;
  color: var(--neutral-500);
}

/* View tabs - clear choice between "All" and "Group by form" */
.submissions-view-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.25rem;
  background: var(--neutral-100);
  border-radius: 0.75rem;
  border: 1px solid var(--neutral-200);
  width: fit-content;
}

.submissions-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  min-width: 10rem;
}

.submissions-tab:hover {
  background: var(--neutral-200);
}

.submissions-tab.active {
  background: white;
  color: var(--neutral-800);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--neutral-200);
}

.submissions-tab-label {
  font-size: 1rem;
  font-weight: 600;
  color: inherit;
  display: block;
  margin-bottom: 0.15rem;
}

.submissions-tab-desc {
  font-size: 0.75rem;
  color: var(--neutral-500);
  font-weight: 400;
}

.submissions-tab.active .submissions-tab-desc {
  color: var(--neutral-600);
}

/* Grouped view (by form) */
.submissions-group-hint {
  font-size: 0.9375rem;
  color: var(--neutral-600);
  margin: 0 0 1.25rem 0;
  padding: 0.75rem 1rem;
  background: var(--neutral-50);
  border-radius: 0.5rem;
  border-left: 4px solid var(--primary-400);
}

.submissions-by-version {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.submissions-version-section {
  background: white;
  border: 1px solid var(--neutral-200);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.submissions-version-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--neutral-800);
  margin: 0 0 1rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--neutral-200);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.submissions-version-count {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--neutral-500);
  background: var(--neutral-100);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
}

/* Card view for submissions */
.submissions-cards {
  margin-top: 0.5rem;
}

.submissions-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.submission-card {
  background: white;
  border-radius: 1rem;
  border: 1px solid var(--neutral-200);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.submission-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-200);
}

.submission-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.submission-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--neutral-800);
  margin: 0;
}

.submission-card-id {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--neutral-500);
}

.submission-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.submission-card-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.submission-card-label {
  font-weight: 600;
  color: var(--neutral-500);
}

.submission-card-value {
  color: var(--neutral-800);
  text-align: right;
}

.submission-card-actions {
  margin-top: 0.75rem;
  display: flex;
  justify-content: flex-end;
}

/* Table Container */
.submissions-table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0.875rem;
  border: 2px solid var(--neutral-200);
  background: white;
}

.submissions-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.submissions-table thead {
  background: linear-gradient(135deg, var(--primary-50) 0%, var(--primary-100) 100%);
}

.submissions-table th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-weight: 700;
  color: var(--neutral-800);
  text-transform: uppercase;
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--primary-200);
}

.submissions-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--neutral-200);
  color: var(--neutral-700);
}

.submissions-table tbody tr {
  transition: all 0.2s ease;
}

.submissions-table tbody tr:hover {
  background: var(--primary-50);
}

.submissions-table tbody tr:last-child td {
  border-bottom: none;
}

/* Buttons */
.btn {
  padding: 0.875rem 2rem;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  letter-spacing: 0.03em;
}

.btn-secondary {
  background: linear-gradient(135deg, #ffffff 0%, var(--neutral-50) 100%);
  color: var(--neutral-700);
  border: 2px solid var(--neutral-200);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, var(--neutral-50) 0%, var(--neutral-100) 100%);
  border-color: var(--neutral-300);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(255, 152, 0, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-400) 0%, var(--primary-500) 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 152, 0, 0.4);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
}

/* No Submissions */
.no-submissions {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--neutral-500);
  font-size: 1.125rem;
}

/* Error Message */
.error-message {
  padding: 1.125rem 1.5rem;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  color: #b91c1c;
  border-radius: 0.75rem;
  border: 1px solid #fecaca;
  font-size: 0.875rem;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
  .submissions-list-container {
    padding: 1.5rem;
  }

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

  .submissions-search-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .submissions-search-input {
    min-width: 0;
  }

  .submissions-view-tabs {
    width: 100%;
  }

  .submissions-tab {
    flex: 1;
    min-width: 0;
  }

  .submissions-version-section {
    padding: 1rem;
  }

  .submissions-version-title {
    font-size: 1.1rem;
  }

  .submissions-table {
    font-size: 0.875rem;
  }

  .submissions-table {
    min-width: 500px;
  }

  .submissions-table th,
  .submissions-table td {
    padding: 0.75rem;
  }
}

@media (max-width: 480px) {
  .submissions-list-container {
    padding: 1rem;
  }

  .submissions-list-title {
    font-size: 1.25rem;
  }

  .submissions-table {
    min-width: 440px;
    font-size: 0.8125rem;
  }

  .submissions-table th,
  .submissions-table td {
    padding: 0.5rem 0.375rem;
  }
}

/* ================================ DARK THEME (night mode) ================================ */
body.night-mode .submissions-list-container {
  background: rgba(58, 56, 56, 0.95);
  border-color: rgba(255, 255, 255, 0.1);
}
body.night-mode .submissions-list-header {
  border-bottom-color: rgba(255, 255, 255, 0.15);
}
body.night-mode .submissions-list-title {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.85) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
body.night-mode .submissions-search-input {
  background: rgba(58, 56, 56, 1);
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.95);
}
body.night-mode .submissions-search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}
body.night-mode .submissions-search-input:focus {
  border-color: rgba(248, 113, 113, 0.6);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
}
body.night-mode .submissions-section-title {
  color: rgba(255, 255, 255, 0.9);
}
body.night-mode .submissions-empty,
body.night-mode .no-submissions p,
body.night-mode .submissions-empty-row {
  color: rgba(255, 255, 255, 0.85);
}
body.night-mode .no-submissions {
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 0.75rem;
  padding: 2rem;
}
body.night-mode .submissions-search-result-hint {
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0.75rem;
}
body.night-mode .submissions-view-tabs {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}
body.night-mode .submissions-tab {
  color: rgba(255, 255, 255, 0.85);
  background: transparent;
  border: 1px solid transparent;
}
body.night-mode .submissions-tab:hover {
  background: rgba(255, 255, 255, 0.1);
}
body.night-mode .submissions-tab.active {
  color: rgba(255, 255, 255, 0.98);
  background: rgba(248, 113, 113, 0.2);
  border-color: rgba(248, 113, 113, 0.5);
  box-shadow: 0 2px 8px rgba(248, 113, 113, 0.2);
}
body.night-mode .submissions-tab-label {
  color: inherit;
}
body.night-mode .submissions-tab-desc {
  color: rgba(255, 255, 255, 0.7);
}
body.night-mode .submissions-tab.active .submissions-tab-desc {
  color: rgba(255, 255, 255, 0.85);
}
body.night-mode .submissions-table-container {
  background: rgba(58, 56, 56, 0.8);
  border-color: rgba(255, 255, 255, 0.15);
  border-radius: 0.875rem;
}
body.night-mode .submissions-table thead {
  background: rgba(255, 255, 255, 0.1);
}
body.night-mode .submissions-table th {
  color: rgba(255, 255, 255, 0.95);
  border-bottom-color: rgba(255, 255, 255, 0.15);
}
body.night-mode .submissions-table td {
  color: rgba(255, 255, 255, 0.9);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
body.night-mode .submissions-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.06);
}
body.night-mode .submissions-list-container .btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 255, 255, 0.25);
}
body.night-mode .submissions-list-container .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.5);
}
body.night-mode .submission-card {
  background: rgba(58, 56, 56, 0.8);
  border-color: rgba(255, 255, 255, 0.1);
}
body.night-mode .submission-card:hover {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(255, 255, 255, 0.06);
}
body.night-mode .submission-card-title {
  color: rgba(255, 255, 255, 0.98);
}
body.night-mode .submission-card-id {
  color: rgba(255, 255, 255, 0.8);
}
body.night-mode .submission-card-label {
  color: rgba(255, 255, 255, 0.75);
}
body.night-mode .submission-card-value {
  color: rgba(255, 255, 255, 0.95);
}
body.night-mode .error-message {
  background: rgba(248, 113, 113, 0.15) !important;
  color: #fca5a5 !important;
  border-color: rgba(248, 113, 113, 0.4);
}
body.night-mode .submissions-loading,
body.night-mode .submissions-loading p {
  color: rgba(255, 255, 255, 0.9);
}
.submissions-loading {
  text-align: center;
  padding: 2rem;
}
