:root {
  /* Main Theme Colors */
  --primary-color: #0369b1;
  --primary-hover: #025a99;
  --secondary-color: #026ab1;
  --text-color: #2b3940;
  --text-light: #6b6e6f;
  --text-lighter: #7e8989;
  --bg-color: #f8f9fa;
  --bg-light: #ffffff;
  --border-color: #e5e5e5;
  --border-light: #f0f0f0;
  --success-color: #00b074;
  --error-color: #f71e3f;
  --warning-color: #faca50;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --transition: all 0.3s ease;
  --border-radius: 8px;
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  font-weight: 400;
}

.container {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-color);
}

/* Sidebar Styles */
.sidebar {
  width: 320px;
  background: #112f5f;
  padding: 1.5rem 1.25rem;
  color: #e2e8f0;
  position: relative;
  overflow-y: auto;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 1;
  display: flex;
  flex-direction: column;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  /* background: linear-gradient(90deg, #4361ee, #3f37c9); */
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1rem;
}

.logo::before {
  content: '';
  font-size: 1.25em;
}

/* User Profile Section */
.user-profile {
  text-align: center;
  padding: 1.5rem 0.5rem;
  margin: 0.5rem 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.user-avatar {
  width: 80px;
  height: 80px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-name {
  color: #fff;
  font-size: 1.25rem;
  margin: 0.5rem 0 0.25rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 1rem;
}

.user-email {
  color: #a0aec0;
  font-size: 0.85rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 1rem;
}

.contact-info {
  margin-top: 1rem;
  padding: 1.5rem 0.75rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.contact-info h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 1rem;
  font-weight: 600;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-detail {
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.contact-detail label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.contact-detail label i {
  width: 16px;
  text-align: center;
  color: #4f9cf1;
}

.contact-detail span {
  color: #e2e8f0;
  font-size: 0.9rem;
  font-weight: 500;
  display: block;
  word-break: break-word;
  line-height: 1.5;
  padding-left: 1.5rem;
}

.contact-actions {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-sign-out {
  width: 100%;
  padding: 0.65rem 1rem;
  background-color: #e53e3e;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-sign-out:hover {
  background-color: #c53030;
  transform: translateY(-1px);
}

.btn-sign-out:active {
  transform: translateY(0);
}

.btn-sign-out i {
  font-size: 0.9em;
}

.contact-detail:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 1px var(--primary-color);
  transform: translateY(-2px);
}

.contact-detail label {
  display: block;
  font-size: 0.7rem;
  color: #94a3b8;
  margin-bottom: 0.25rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.contact-detail span {
  color: #e2e8f0;
  font-size: 0.85rem;
  font-weight: 500;
  display: block;
  word-break: break-word;
  line-height: 1.5;
}

/* Main Content Styles */
.main-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  background-color: #f5f7fa;
  min-height: 100vh;
}

/* Form Styles */
.form-grid {
  display: grid;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
  background: var(--bg-light);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  margin-bottom: 1.5rem;
}

.form-row:hover {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 1px var(--primary-color);
}

.form-row.single {
  grid-template-columns: 1fr;
}

.form-row.double {
  grid-template-columns: repeat(2, 1fr);
}

.form-group {
  display: flex;
  flex-direction: column;
  position: relative;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.5rem;
  display: block;
  position: relative;
  padding-left: 0.25rem;
}

.form-group.required label::after {
  content: '*';
  color: var(--error-color);
  margin-left: 0.25rem;
  font-weight: 700;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-color);
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  transition: var(--transition);
  appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  color: var(--text-color);
  background-color: #fff;
  border-color: var(--primary-color);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(3, 105, 177, 0.25);
}

.form-group input::placeholder {
  color: var(--text-light);
  opacity: 0.7;
}

/* File Input Styles */
.file-input {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.file-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  width: fit-content;
}

.file-btn:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.file-btn:active {
  transform: translateY(0);
}

.file-status {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.25rem;
  font-style: italic;
}

.file-input input[type="file"] {
  display: none;
}

.file-btn {
  padding: 0.5rem 1rem;
  background: var(--primary-color);
  color: #ffffff !important; /* Force white text */
  border: 1px solid var(--primary-color);
  border-radius: var(--border-radius);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
  width: auto;
  min-width: 120px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.file-btn:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  color: #ffffff !important; /* Ensure text stays white on hover */
}

.file-btn:active {
  transform: translateY(0);
}

.file-status {
  font-size: 0.8rem;
  color: var(--text-light);
  font-style: italic;
}

/* Textarea Styles */
textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
  font-family: inherit;
}

/* Select Styles */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='%236b6e6f' d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  padding-right: 2.5rem !important;
  cursor: pointer;
}

select option:first-child {
  color: var(--text-light);
}

/* Form Footer */
.form-footer {
  margin-top: 2rem;
  text-align: left;
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Button Styles */
.btn-submit {
  background-color: var(--primary-color);
  color: white;
  padding: 0.75rem 2rem;
  border: 1px solid var(--primary-color);
  border-radius: var(--border-radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  vertical-align: middle;
  user-select: none;
  line-height: 1.5;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-submit:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit:disabled {
  background: #e9ecef;
  color: #adb5bd;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Message Styles */
.message-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  max-width: 350px;
  width: 100%;
}

.success-message, .error-message {
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  border-radius: var(--border-radius);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideIn 0.3s ease-out forwards;
  opacity: 0;
  transform: translateX(20px);
  box-shadow: var(--shadow-md);
  position: relative;
  border-left: 4px solid transparent;
}

.success-message {
  background-color: #f0fdf4;
  color: #166534;
  border-left: 4px solid var(--success-color);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-6 w-6' fill='none' viewBox='0 0 24 24' stroke='%2316a34a'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 13l4 4L19 7' /%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 1rem center;
  background-size: 1.25rem;
  padding-left: 3.5rem;
}

.error-message {
  background-color: #fef2f2;
  color: #991b1b;
  border-left: 4px solid var(--error-color);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-6 w-6' fill='none' viewBox='0 0 24 24' stroke='%23dc2626'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 18L18 6M6 6l12 12' /%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 1rem center;
  background-size: 1.25rem;
  padding-left: 3.5rem;
}

@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Responsive Styles */
@media (max-width: 991.98px) {
  .container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    padding: 1.25rem;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .main-content {
    padding: 1.5rem;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.25rem;
  }
  
  .form-row.double {
    grid-template-columns: 1fr;
  }
  
  .form-footer {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  
  .btn-submit {
    width: 100%;
  }
}

@media (max-width: 575.98px) {
  .main-content {
    padding: 1rem;
  }
  
  .form-row {
    padding: 1rem;
  }
  
  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
  }
  
  .file-btn {
    width: 100%;
    justify-content: center;
  }
  
  .success-message,
  .error-message {
    padding: 0.75rem 1rem 0.75rem 3rem;
    background-position: 0.75rem center;
  }
}

/* Form Footer Styles */
.form-footer {
  margin-top: 2rem;
  padding: 1.5rem;
  background-color: var(--bg-light);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.form-footer .btn {
  padding: 0.625rem 1.5rem;
  border-radius: 4px;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.form-footer .btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.form-footer .btn-primary:hover {
  background-color: var(--primary-hover);
}

.form-footer .btn-secondary {
  background-color: #f0f0f0;
  color: var(--text-color);
}

.form-footer .btn-secondary:hover {
  background-color: #e0e0e0;
}

/* Make sure the sign-out button is visible when user is signed in */
#form-sign-out-btn {
  display: inline-flex !important; /* Override inline style */
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Ensure the auth status is visible */
#auth-status {
  color: var(--primary-color);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  font-weight: 500;
  padding: 0.5rem;
  background-color: rgba(3, 105, 177, 0.1);
  border-radius: 4px;
  display: inline-block;
}

/* Button container in form footer */
.form-footer > div {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}