/**
 * Custom HTML Forms - Frontend User Styles
 */

/* ============================================
   General Form Styles
   ============================================ */

.chf-form,
.chf-login-container,
.chf-register-container,
.chf-profile-container,
.chf-dashboard {
  max-width: 600px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  color: #333;
}

.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #222;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group textarea,
.form-group select {
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="tel"]:focus,
.form-group input[type="date"]:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
}

.form-group small {
  font-size: 0.875rem;
  color: #666;
  margin-top: 0.25rem;
}

.form-group label input[type="checkbox"] {
  margin-right: 0.5rem;
}

.form-note {
  font-size: 0.875rem;
  color: #666;
  margin-top: 1rem;
  text-align: center;
}

.form-note a {
  color: #1d4ed8;
  text-decoration: none;
}

.form-note a:hover {
  text-decoration: underline;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

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

/* ============================================
   Buttons
   ============================================ */

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s;
  text-align: center;
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.2);
}

.btn-primary {
  background-color: #1d4ed8;
  color: white;
}

.btn-primary:hover {
  background-color: #1e40af;
}

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

.btn-secondary:hover {
  background-color: #4b5563;
}

.btn-danger {
  background-color: #dc2626;
  color: white;
}

.btn-danger:hover {
  background-color: #b91c1c;
}

/* ============================================
   Messages
   ============================================ */

.chf-message {
  margin: 1rem 0;
  padding: 1rem;
  border-radius: 4px;
}

.chf-message .success-message {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin: 0;
}

.chf-message .error-message {
  background-color: #fee2e2;
  color: #7f1d1d;
  border: 1px solid #fca5a5;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin: 0;
}

/* ============================================
   Login & Register
   ============================================ */

.chf-login-container,
.chf-register-container {
  background-color: #f9fafb;
  padding: 2rem;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.chf-login-container h2,
.chf-register-container h2 {
  margin-top: 0;
  color: #1f2937;
}

/* ============================================
   Dashboard
   ============================================ */

.chf-dashboard {
  max-width: 100%;
}

.chf-dashboard-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem;
  border-radius: 8px;
  margin-bottom: 2rem;
}

.chf-dashboard-header h1 {
  margin: 0 0 0.5rem;
}

.chf-dashboard-header p {
  margin: 0 0 1rem;
  opacity: 0.95;
}

.chf-dashboard-header .btn {
  margin-right: 0.5rem;
  margin-top: 0.5rem;
}

.chf-dashboard-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

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

.chf-submissions-panel,
.chf-messages-panel {
  background-color: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
}

.chf-submissions-panel h2,
.chf-messages-panel h2 {
  margin-top: 0;
  color: #1f2937;
}

.chf-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.chf-filters select,
.chf-filters input {
  flex: 1;
  min-width: 150px;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.875rem;
}

.chf-filters .btn-secondary {
  flex: 0;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .chf-filters {
    flex-direction: column;
  }

  .chf-filters select,
  .chf-filters input {
    width: 100%;
  }
}

/* ============================================
   Submissions Table
   ============================================ */

.chf-submissions-table {
  width: 100%;
  border-collapse: collapse;
}

.chf-submissions-table thead {
  background-color: #f3f4f6;
}

.chf-submissions-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #e5e7eb;
}

.chf-submissions-table td {
  padding: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.chf-submissions-table tbody tr:hover {
  background-color: #f9fafb;
}

.chf-submissions-table a {
  color: #1d4ed8;
  text-decoration: none;
}

.chf-submissions-table a:hover {
  text-decoration: underline;
}

/* ============================================
   Pagination
   ============================================ */

.chf-pagination {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.chf-pagination .page {
  padding: 0.5rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  color: #1d4ed8;
}

.chf-pagination .page:hover {
  background-color: #f3f4f6;
}

.chf-pagination .page.current {
  background-color: #1d4ed8;
  color: white;
  border-color: #1d4ed8;
  cursor: default;
}

/* ============================================
   Messages List
   ============================================ */

.chf-messages-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chf-message-item {
  padding: 1rem;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
}

.chf-message-item .message-text {
  margin: 0 0 0.5rem;
  color: #1f2937;
  line-height: 1.5;
}

.chf-message-item .message-meta {
  margin: 0;
  font-size: 0.875rem;
  color: #6b7280;
}

/* ============================================
   Profile Page
   ============================================ */

.chf-profile-container {
  background-color: white;
  padding: 2rem;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.chf-profile-container h2 {
  color: #1f2937;
  margin-top: 0;
}

.chf-profile-container hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 2rem 0;
}

.chf-danger-zone {
  padding: 1.5rem;
  background-color: #fef2f2;
  border: 1px solid #fee2e2;
  border-radius: 4px;
}

.chf-danger-zone h3 {
  color: #7f1d1d;
  margin-top: 0;
}

.chf-danger-zone p {
  color: #991b1b;
  margin-bottom: 1rem;
}

.chf-profile-container .btn-secondary {
  margin-top: 1rem;
}

/* ============================================
   Draft Notifications
   ============================================ */

.chf-draft-notification {
  padding: 1rem;
  background-color: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 4px;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chf-draft-notification p {
  margin: 0;
  color: #92400e;
}

.chf-draft-notification button {
  background-color: #f59e0b;
  color: white;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}

.chf-draft-notification button:hover {
  background-color: #d97706;
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 768px) {
  .chf-form,
  .chf-login-container,
  .chf-register-container,
  .chf-profile-container,
  .chf-dashboard {
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .chf-dashboard-header {
    padding: 1.5rem;
  }

  .chf-dashboard-header .btn {
    display: block;
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .chf-submissions-panel,
  .chf-messages-panel {
    padding: 1rem;
  }

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

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

/* ============================================
   Accessibility
   ============================================ */

.chf-form:focus-within,
.chf-login-container:focus-within,
.chf-register-container:focus-within,
.chf-profile-container:focus-within {
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
}
