/* Component Styles */

/* Button Component */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  font-family: inherit;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--blue-mid, #2563eb);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--blue, #1e40af);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #6b7280;
  color: #fff;
}

.btn-secondary:hover:not(:disabled) {
  background: #4b5563;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--blue-mid, #2563eb);
  border: 2px solid var(--blue-mid, #2563eb);
}

.btn-outline:hover:not(:disabled) {
  background: var(--blue-mid, #2563eb);
  color: #fff;
  transform: translateY(-1px);
}

.btn-danger {
  background: #ef4444;
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
  transform: translateY(-1px);
}

.btn-small {
  padding: 8px 16px;
  font-size: 14px;
}

.btn-large {
  padding: 16px 32px;
  font-size: 16px;
}

.btn-loading {
  position: relative;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 8px;
}

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

/* Data Table Component */
.table-container {
  background: var(--bg-card, #ffffff);
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-ui, #e2e8f0);
  overflow: hidden;
  margin-top: 25px;
}

.table-header-toolbar {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-ui, #e2e8f0);
  flex-wrap: wrap;
  gap: 15px;
}

.table-title-group h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark, #1e293b);
}

.table-title-group p {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: var(--text-muted, #64748b);
}

.table-search-input {
  padding: 8px 14px;
  border: 1px solid var(--border-ui, #cbd5e1);
  border-radius: 8px;
  font-size: 14px;
  width: 280px;
  box-sizing: border-box;
}

.responsive-table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.citizen-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.citizen-data-table th {
  background-color: #f8fafc;
  color: var(--text-muted, #64748b);
  font-weight: 600;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-ui, #e2e8f0);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.citizen-data-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-ui, #e2e8f0);
  color: var(--text-dark, #1e293b);
  vertical-align: middle;
}

.citizen-data-table tr:hover {
  background-color: #f1f5f9;
}

.user-name-cell {
  font-weight: 600;
  color: #0f172a;
}

.user-id-badge {
  font-family: monospace;
  font-size: 12px;
  background-color: #f1f5f9;
  padding: 4px 8px;
  border-radius: 4px;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-role {
  background-color: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
  font-weight: 600;
}

.badge-verified {
  background-color: #ecfdf5;
  color: #047857;
}

.badge-pending {
  background-color: #fef3c7;
  color: #b45309;
}

.badge-resident {
  background-color: #eff6ff;
  color: #1d4ed8;
}

.badge-non-resident {
  background-color: #f5f3ff;
  color: #6d28d9;
}

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

.action-icon-btn {
  background: none;
  border: 1px solid var(--border-ui, #cbd5e1);
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
  color: var(--text-muted, #64748b);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.action-icon-btn:hover {
  border-color: var(--primary, #0284c7);
  color: var(--primary, #0284c7);
  background-color: #f0f9ff;
}

@media (max-width: 768px) {
  .table-header-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .table-search-input {
    width: 100%;
  }
}

/* FormField Component */
.form-input-wrapper {
  position: relative;
}

.form-input-error {
  border-color: #ef4444 !important;
}

.form-input-error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.form-required {
  color: #ef4444;
}

/* Toast Component */
.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 300px;
  max-width: 400px;
  padding: 16px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-left: 4px solid;
}

.toast-success {
  border-left-color: #10b981;
}

.toast-error {
  border-left-color: #ef4444;
}

.toast-warning {
  border-left-color: #f59e0b;
}

.toast-info {
  border-left-color: #3b82f6;
}

.toast-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-success .toast-icon {
  color: #10b981;
  background: #d1fae5;
  border-radius: 50%;
}

.toast-error .toast-icon {
  color: #ef4444;
  background: #fee2e2;
  border-radius: 50%;
}

.toast-warning .toast-icon {
  color: #f59e0b;
  background: #fef3c7;
  border-radius: 50%;
}

.toast-info .toast-icon {
  color: #3b82f6;
  background: #dbeafe;
  border-radius: 50%;
}

.toast-content {
  flex: 1;
}

.toast-message {
  font-size: 14px;
  color: #1f2937;
  line-height: 1.5;
}

.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 20px;
  color: #9ca3af;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

.toast-close:hover {
  background: #f3f4f6;
  color: #4b5563;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.toast-top-right,
.toast-bottom-right {
  animation: toastSlideIn 0.3s ease-out;
}

.toast-top-left,
.toast-bottom-left {
  animation: toastSlideInLeft 0.3s ease-out;
}

@keyframes toastSlideInLeft {
  from {
    opacity: 0;
    transform: translateX(-100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Modal Component Enhancements */
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  margin-bottom: 0;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark, #111827);
  margin: 0;
}

.modal-body {
  padding: 24px;
}

.modal-content-small {
  max-width: 400px;
}

.modal-content-medium {
  max-width: 500px;
}

.modal-content-large {
  max-width: 700px;
}

@media (min-width: 768px) {
  .modal-content-large {
    max-width: 800px;
  }
}

/* Card Component */
.card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border, #e5e7eb);
  overflow: hidden;
  transition: all 0.2s ease;
}

.card-hoverable:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.card-clickable:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.card-small {
  padding: 16px;
}

.card-medium {
  padding: 24px;
}

.card-large {
  padding: 32px;
}

.card-content-wrapper {
  flex: 1;
}

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

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark, #111827);
  margin: 0;
}

.card-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.card-badge-success {
  background: #d1fae5;
  color: #065f46;
}

.card-badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.card-badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.card-badge-info {
  background: #dbeafe;
  color: #1e40af;
}

.card-body {
  font-size: 15px;
  color: var(--text-medium, #4b5563);
  line-height: 1.6;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border, #e5e7eb);
}

.card-footer-text {
  font-size: 13px;
  color: var(--text-light, #9ca3af);
}

.card-footer-action {
  background: none;
  border: none;
  color: var(--primary-color, #2563eb);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.card-footer-action:hover {
  text-decoration: underline;
}

/* Summary Card Variant */
.card-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
}

.card-icon-blue {
  background: #eff6ff;
  color: #3b82f6;
}

.card-icon-green {
  background: #d1fae5;
  color: #10b981;
}

.card-icon-yellow {
  background: #fef3c7;
  color: #f59e0b;
}

.card-icon-purple {
  background: #ede9fe;
  color: #8b5cf6;
}

.card-icon-red {
  background: #fee2e2;
  color: #ef4444;
}

/* Service Card Variant */
.card-service {
  padding: 32px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.card-service:hover {
  border-color: var(--primary-color, #2563eb);
  box-shadow: 0 8px 30px rgba(37, 99, 235, 0.1);
  transform: translateY(-4px);
}

.card-service .card-header {
  margin-bottom: 12px;
}

.card-service .card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

/* Activity Card Variant */
.card-activity {
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.card-activity .card-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.card-activity .card-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.card-activity .card-body {
  font-size: 13px;
  margin-bottom: 4px;
}

/* Announcement Card Variant */
.card-announcement {
  padding: 16px;
  background: var(--bg-light, #f9fafb);
  border-radius: 8px;
  border-left: 4px solid var(--border, #e5e7eb);
}

.card-announcement.card-announcement-urgent {
  border-left-color: #ef4444;
  background: #fef2f2;
}

.card-announcement .card-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.card-announcement .card-body {
  font-size: 13px;
  margin-bottom: 8px;
  line-height: 1.5;
}
