/* Forms List Page - Light Theme */

/* ==========================================================================
   CSP-Compliant Visibility Utilities
   Use these classes instead of inline style="display: none/flex/block"
   ========================================================================== */

/* Hide element - use instead of style="display: none" */
.hidden {
  display: none !important;
}

/* Tab Navigation */
.tab-nav {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 2px solid #E5E7EB;
}

.tab-nav a {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  color: #6B7280;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.tab-nav a:hover {
  color: #0F766E;
}

.tab-nav a.active {
  color: #0F766E;
  border-bottom-color: #0F766E;
}

.tab-nav .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: #ef4444;
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  margin-left: 8px;
}

/* Page Header */
.page-header {
  margin-bottom: 24px;
}

.page-title {
  font-size: 24px;
  font-weight: 600;
  color: #1F2937;
  margin: 0 0 6px 0;
}

.page-subtitle {
  font-size: 15px;
  color: #6B7280;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* Primary Button */
.btn-primary {
  padding: 12px 20px;
  background: linear-gradient(135deg, #14B8A6 0%, #0F766E 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(20, 184, 166, 0.4);
  background: linear-gradient(135deg, #0F766E 0%, #115E59 100%);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(20, 184, 166, 0.3);
}

.btn-primary span:first-child {
  font-size: 16px;
  font-weight: 500;
}

/* Secondary Button */
.btn-secondary {
  padding: 12px 20px;
  background: white;
  color: #374151;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: #F9FAFB;
  border-color: #0F766E;
  color: #0F766E;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.1);
}

.btn-secondary span:first-child {
  font-size: 16px;
  font-weight: 400;
}

/* Action Bar */
.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

/* Search Box */
.search-box {
  flex: 1;
  max-width: 400px;
  position: relative;
}

.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9CA3AF;
  display: flex;
  align-items: center;
}

.search-box input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  font-size: 14px;
  background: white;
  color: #1F2937;
  transition: all 0.2s;
}

.search-box input::placeholder {
  color: #9CA3AF;
}

.search-box input:focus {
  outline: none;
  border-color: #0F766E;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

/* Table Card */
.table-card {
  background: white;
  border-radius: 12px;
  border: 1px solid #E5E7EB;
  overflow: visible;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Data Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background: #F9FAFB;
  border-bottom: 1px solid #E5E7EB;
}

.data-table th {
  padding: 14px 20px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table tbody tr {
  border-bottom: 1px solid #F3F4F6;
  transition: all 0.2s;
}

.data-table tbody tr:hover {
  background: #F9FAFB;
}

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

.data-table td {
  padding: 16px 20px;
  font-size: 14px;
  color: #374151;
  vertical-align: middle;
}

.data-table td:first-child {
  font-weight: 500;
  color: #1F2937;
}

/* Form Description Cell */
.form-description {
  max-width: 350px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #6B7280;
  font-size: 13px;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.status-badge.draft {
  background: #F3F4F6;
  color: #6B7280;
}

.status-badge.published {
  background: #D1FAE5;
  color: #059669;
}

.status-badge.archived {
  background: #FEE2E2;
  color: #DC2626;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Date Display */
.date-display {
  color: #6B7280;
  font-size: 13px;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.action-btn {
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: #6B7280;
}

.action-btn:hover {
  background: #F3F4F6;
  color: #1F2937;
}

.action-btn.edit:hover {
  background: #EBF8FF;
  color: #3B82F6;
}

.action-btn.delete:hover {
  background: #FEE2E2;
  color: #DC2626;
}

/* More Menu */
.more-menu-wrapper {
  position: relative;
}

.more-btn {
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: #6B7280;
  font-size: 18px;
  font-weight: bold;
}

.more-btn:hover {
  background: #F3F4F6;
  color: #1F2937;
}

.more-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  width: 200px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid #E5E7EB;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.15s ease;
  z-index: 100;
  overflow: hidden;
}

.more-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.more-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.more-menu-item:hover {
  background: #F9FAFB;
}

.more-menu-item svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}

.more-menu-item.danger {
  color: #DC2626;
}

.more-menu-item.danger:hover {
  background: #FEF2F2;
}

.more-menu-divider {
  height: 1px;
  background: #E5E7EB;
  margin: 4px 0;
}

/* Dropdown opens upward when near bottom of viewport */
.more-menu.open-upward {
  top: auto;
  bottom: calc(100% + 4px);
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 16px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #E5E7EB;
  border-top-color: #0F766E;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-state p {
  color: #6B7280;
  font-size: 14px;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  background: white;
  border-radius: 12px;
  border: 1px solid #E5E7EB;
}

.empty-icon {
  width: 64px;
  height: 64px;
  background: #F3F4F6;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.empty-icon svg {
  width: 32px;
  height: 32px;
  stroke: #9CA3AF;
  stroke-width: 1.5;
  fill: none;
}

.empty-state h3 {
  font-size: 18px;
  color: #1F2937;
  margin: 0 0 8px 0;
  font-weight: 600;
}

.empty-state p {
  font-size: 14px;
  color: #6B7280;
  margin: 0 0 24px 0;
  max-width: 400px;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: white;
  border-radius: 16px;
  max-width: 560px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid #E5E7EB;
}

.modal-header h2 {
  font-size: 18px;
  color: #1F2937;
  font-weight: 600;
  margin: 0;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  color: #9CA3AF;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: #F3F4F6;
  color: #1F2937;
}

.modal-body {
  padding: 24px;
}

.modal-subtitle {
  font-size: 14px;
  color: #6B7280;
  margin-bottom: 24px;
  line-height: 1.6;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid #E5E7EB;
  background: #F9FAFB;
}

/* Upload Area */
.upload-area {
  margin-bottom: 20px;
}

.upload-placeholder {
  border: 2px dashed #E5E7EB;
  border-radius: 12px;
  padding: 48px 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: #F9FAFB;
}

.upload-placeholder:hover {
  border-color: #0F766E;
  background: rgba(15, 118, 110, 0.02);
}

.upload-icon {
  width: 48px;
  height: 48px;
  background: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  border: 1px solid #E5E7EB;
}

.upload-icon svg {
  width: 24px;
  height: 24px;
  stroke: #6B7280;
  stroke-width: 1.5;
  fill: none;
}

.upload-placeholder p {
  color: #1F2937;
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 4px 0;
}

.upload-hint {
  color: #9CA3AF !important;
  font-size: 13px !important;
  font-weight: 400 !important;
}

.upload-file-info {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: #F9FAFB;
  border: 1px solid #0F766E;
  border-radius: 10px;
}

.file-icon {
  width: 40px;
  height: 40px;
  background: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #E5E7EB;
}

.file-icon svg {
  width: 20px;
  height: 20px;
  stroke: #0F766E;
  stroke-width: 1.5;
  fill: none;
}

.file-details {
  flex: 1;
}

.file-name {
  font-size: 14px;
  font-weight: 500;
  color: #1F2937;
  margin: 0 0 2px 0;
}

.file-size {
  font-size: 12px;
  color: #6B7280;
  margin: 0;
}

.file-remove {
  background: transparent;
  border: none;
  font-size: 20px;
  color: #9CA3AF;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.file-remove:hover {
  background: #FEE2E2;
  color: #DC2626;
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 6px;
  background: #E5E7EB;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #14B8A6 0%, #0F766E 100%);
  width: 0%;
  transition: width 0.3s;
  animation: progressPulse 1.5s ease-in-out infinite;
}

@keyframes progressPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.progress-text {
  font-size: 13px;
  color: #6B7280;
  text-align: center;
  margin: 0;
}

/* Upload Error */
.upload-error {
  padding: 12px 16px;
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  border-radius: 8px;
  color: #DC2626;
  font-size: 13px;
  line-height: 1.5;
  margin-top: 16px;
}

/* ==========================================================================
   Form Type Tabs (All / Wellness / Consents)
   ========================================================================== */

.form-type-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.form-type-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #6B7280;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.form-type-tab:hover {
  color: #374151;
  background: #F3F4F6;
  border-color: #D1D5DB;
}

.form-type-tab.active {
  color: #0F766E;
  background: #F0FDFA;
  border-color: #0F766E;
}

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: #E5E7EB;
  color: #6B7280;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
}

.form-type-tab.active .tab-count {
  background: #CCFBF1;
  color: #0F766E;
}

/* ==========================================================================
   Type Badge (in table rows)
   ========================================================================== */

.type-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.type-badge.type-form {
  background: #EFF6FF;
  color: #2563EB;
}

.type-badge.type-consent {
  background: #FFF7ED;
  color: #C2410C;
}

/* ==========================================================================
   Create Form Dropdown
   ========================================================================== */

.create-dropdown-wrapper {
  position: relative;
}

.create-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  z-index: 100;
  min-width: 280px;
  padding: 8px;
  animation: fadeInDown 0.15s ease;
}

.create-dropdown-menu.active {
  display: block;
}

.create-dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 12px;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 14px;
  color: #374151;
  transition: background 0.15s;
}

.create-dropdown-item:hover {
  background: #F9FAFB;
}

.create-dropdown-item svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: #0F766E;
}

/* ==========================================================================
   Secondary Small Button (used in consent table)
   ========================================================================== */

.btn-secondary-small {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  background: white;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.btn-secondary-small:hover {
  background: #F9FAFB;
  border-color: #9CA3AF;
}

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

