/* User App Styles - Material Design 3 */

/* Page Layout */
.page-container {
  min-height: 100vh;
  padding: 2rem 1rem;
  background-color: var(--md-sys-color-background);
}

.content-wrapper {
  max-width: 800px;
  margin: 0 auto;
}

/* Messages */
.messages-container {
  margin-bottom: 20px;
}

.message {
  padding: 12px 16px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px solid;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.message-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.message-text {
  flex: 1;
  margin-right: 10px;
}

.message-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.message-close:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

.message-error {
  background-color: #fee;
  border-color: #fcc;
  color: #c33;
}

.message-success {
  background-color: #efe;
  border-color: #cfc;
  color: #3c3;
}

.message-warning {
  background-color: #ffd;
  border-color: #ffc;
  color: #c63;
}

.message-info {
  background-color: #eef;
  border-color: #ccf;
  color: #33c;
}

/* Dark theme support */
[data-theme="dark"] .message-error {
  background-color: #3a1a1a;
  border-color: #5a2a2a;
  color: #ff6b6b;
}

[data-theme="dark"] .message-success {
  background-color: #1a3a1a;
  border-color: #2a5a2a;
  color: #6bff6b;
}

[data-theme="dark"] .message-warning {
  background-color: #3a3a1a;
  border-color: #5a5a2a;
  color: #ffff6b;
}

[data-theme="dark"] .message-info {
  background-color: #1a1a3a;
  border-color: #2a2a5a;
  color: #6b6bff;
}

[data-theme="dark"] .message-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Form Styles */
.form-card {
  background-color: var(--md-sys-color-surface);
  border-radius: 16px;
  box-shadow: var(--md-sys-elevation-level1);
  overflow: hidden;
  margin-bottom: 2rem;
}

.form-header {
  background-color: var(--md-sys-color-surface-container);
  padding: 1.5rem;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
}

/* Header Actions */
.header-actions {
  display: flex;
  gap: 0.5rem;
}

.form-content {
  padding: 1.5rem;
}

.form-section {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: flex-end;
}

.form-field {
  flex: 1;
  margin-bottom: 1rem;
  min-width: 0;
}

.field-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  font-size: 0.9rem;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 8px;
  background-color: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  font-size: 1rem;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
  min-height: 2.5rem;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 2px var(--md-sys-color-primary-container);
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 8px;
  background-color: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  font-size: 1rem;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
  min-height: 2.5rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 2px var(--md-sys-color-primary-container);
}

/* Info Value Display (for profile) */
.info-value-display {
  padding: 0.75rem;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 8px;
  background-color: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  font-size: 1rem;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

.help-text {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.error-message {
  color: var(--md-sys-color-error);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

/* Member Form Styles */
.member-form {
  background-color: var(--md-sys-color-surface-container);
  border-radius: 12px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.member-header {
  background-color: var(--md-sys-color-surface-container-high);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.member-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
}

.remove-member-btn {
  background-color: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.remove-member-btn:hover {
  background-color: var(--md-sys-color-error);
  color: var(--md-sys-color-on-error);
}

.member-content {
  padding: 1rem;
}

/* Team member form specific styles */
.member-form .form-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.member-form .form-field {
  margin-bottom: 1rem;
}

/* Ensure form controls are properly styled in member forms */
.member-form .form-control {
  width: 100%;
  max-width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 8px;
  background-color: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
  min-height: 2.5rem;
}

.member-form .form-control:focus {
  outline: none;
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 2px var(--md-sys-color-primary-container);
}

.member-form .form-field {
  margin-bottom: 1rem;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.member-form .form-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.member-form .form-check-input {
  margin-right: 0.5rem;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
}

.checkbox-field {
  margin-top: 1rem;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.checkbox-label {
  color: var(--md-sys-color-on-surface);
  font-size: 0.875rem;
  cursor: pointer;
  flex: 1;
}

/* Login form specific checkbox styles */
.form-field .form-check-input {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  margin: 0;
  cursor: pointer;
}

.add-member-section {
  text-align: center;
  margin-top: 1rem;
}

.add-member-btn {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.add-member-btn:hover {
  background-color: var(--md-sys-color-secondary);
  color: var(--md-sys-color-on-secondary);
}

/* Member Info Cards (for profile) */
.members-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.member-info-card {
  background-color: var(--md-sys-color-surface-container);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--md-sys-color-outline-variant);
}

.member-info-card .member-header {
  background-color: var(--md-sys-color-surface-container-high);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.member-info-card .member-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
}

.member-info-card .member-content {
  padding: 1rem;
}

/* Button Styles */
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 2.5rem;
  box-sizing: border-box;
}

.btn-primary {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.btn-primary:hover {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.btn-secondary {
  background-color: var(--md-sys-color-secondary);
  color: var(--md-sys-color-on-secondary);
}

.btn-secondary:hover {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.btn-danger {
  background-color: var(--md-sys-color-error);
  color: var(--md-sys-color-on-error);
}

.btn-danger:hover {
  background-color: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
}

.btn-outline {
  background-color: transparent;
  color: var(--md-sys-color-primary);
  border: 1px solid var(--md-sys-color-primary);
}

.btn-outline:hover {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.full-width {
  width: 100%;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  margin-top: 2rem;
}

/* Form Footer (for login) */
.form-footer {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--md-sys-color-outline-variant);
}

.register-link {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.875rem;
  margin: 0;
}

.register-link a {
  margin-left: 0.5rem;
}

/* Status Badge */
.status-badge {
  padding: 0.75rem;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 8px;
  background-color: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  font-size: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  min-height: 2.5rem;
  box-sizing: border-box;
}

.status-badge.approved {
  background-color: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
  border-color: var(--md-sys-color-tertiary-container);
}

.status-badge.pending {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border-color: var(--md-sys-color-secondary-container);
}

.status-badge.rejected {
  background-color: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
  border-color: var(--md-sys-color-error-container);
}

/* Role Badge */
.role-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 500;
}

.role-badge.leader {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.role-badge.member {
  background-color: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}

/* Admin Management Styles */
.admin-empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--md-sys-color-on-surface-variant);
}

.admin-empty-state p {
  margin: 0;
  font-size: 1rem;
}

/* Admin Search and Filter */
.admin-search-filter-container {
  margin-bottom: 1.5rem;
}

.admin-search-form .form-row {
  align-items: flex-end;
  gap: 1rem;
}

.admin-search-form .form-field {
  flex: 1;
}

.admin-search-form .form-field:last-child {
  flex: 0 0 auto;
  display: flex;
  gap: 0.5rem;
}

/* Admin Teams List */
.admin-teams-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-team-card {
  background-color: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.admin-team-card:hover {
  box-shadow: var(--md-sys-elevation-level2);
  border-color: var(--md-sys-color-outline);
}

.admin-team-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.admin-team-info {
  flex: 1;
}

.admin-team-name {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
}

.admin-team-id {
  font-size: 0.9rem;
  color: var(--md-sys-color-on-surface-variant);
}

.admin-team-status {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-team-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}

.admin-team-details {
  flex: 1;
}

.admin-detail-row {
  display: flex;
  margin-bottom: 0.5rem;
}

.admin-detail-row:last-child {
  margin-bottom: 0;
}

.admin-detail-label {
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  min-width: 80px;
  margin-right: 0.5rem;
}

.admin-detail-value {
  color: var(--md-sys-color-on-surface-variant);
}

.admin-team-actions {
  flex-shrink: 0;
}

/* Admin Status Badge */
.admin-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.75rem;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-status-badge.approved {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.admin-status-badge.pending {
  background-color: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
}

.admin-status-badge.rejected {
  background-color: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
}

.admin-status-badge.inactive {
  background-color: var(--md-sys-color-surface-variant);
  color: var(--md-sys-color-on-surface-variant);
}

/* Admin Role Badge */
.admin-role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.admin-role-badge.leader {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.admin-role-badge.member {
  background-color: var(--md-sys-color-surface-variant);
  color: var(--md-sys-color-on-surface-variant);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--md-sys-color-on-surface-variant);
}

.empty-icon {
  font-size: 4rem;
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 1.5rem;
}

.empty-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 1rem;
}

.empty-description {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 1rem;
}

/* Approval Pending Page Styles */
.approval-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  text-align: center;
}

.approval-icon {
  font-size: 4rem;
  color: var(--md-sys-color-primary);
  margin-bottom: 1rem;
}

.approval-message {
  margin-bottom: 1rem;
}

.message-title {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 1rem;
}

.message-text {
  font-size: 1.1rem;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.6;
  margin: 0;
}

.status-info {
  margin-bottom: 1rem;
}

.status-card {
  background-color: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 12px;
  overflow: hidden;
}

.status-header {
  padding: 1rem 1.5rem;
  background-color: var(--md-sys-color-surface-container);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.status-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
}

.status-content {
  padding: 1.5rem;
}

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.status-item:last-child {
  border-bottom: none;
}

.status-label {
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  min-width: 80px;
  margin-right: 0.5rem;
}

.status-value {
  color: var(--md-sys-color-on-surface);
  font-weight: 500;
}

.status-value.pending {
  color: var(--md-sys-color-tertiary);
  font-weight: 600;
}

.contact-info {
  margin-bottom: 1rem;
}

.contact-card {
  background-color: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 12px;
  overflow: hidden;
}

.contact-header {
  padding: 1rem 1.5rem;
  background-color: var(--md-sys-color-surface-container);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.contact-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contact-content {
  padding: 1.5rem;
}

.contact-text {
  margin: 0 0 1.5rem 0;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.6;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.contact-label {
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  min-width: 80px;
  margin-right: 0.5rem;
}

.contact-value {
  color: var(--md-sys-color-primary);
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
  .form-actions {
    flex-direction: column;
  }
  
  .btn-primary,
  .btn-secondary,
  .btn-danger {
    width: 100%;
    text-align: center;
  }

  .admin-search-form .form-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .admin-search-form .form-field:last-child {
    flex-direction: row;
    justify-content: center;
  }
  
  .admin-team-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .admin-team-content {
    flex-direction: column;
    align-items: stretch;
  }
  
  .admin-team-actions {
    align-self: flex-end;
  }
  
  /* Approval pending responsive */
  .approval-content {
    gap: 1.5rem;
  }
  
  .message-title {
    font-size: 1.5rem;
  }
  
  .message-text {
    font-size: 1rem;
  }
  
  .status-item,
  .contact-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .status-label,
  .contact-label {
    min-width: auto;
    margin-right: 0;
  }
}

/* Desktop-specific fixes */
@media (min-width: 769px) {
  .form-row {
    flex-direction: row;
  }
  
  .form-row .form-field {
    flex: 1;
  }
}