/* ======================================================
   Account Modal (Login/Register) - PRESERVED AS-IS
====================================================== */

.account-modal {
  display: none; /* Allow JS to override */
  position: fixed;
  z-index: 1002;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  animation: fadeBg 0.3s ease forwards;
}

.account-modal-content {
  background-color: #202123;
  margin: 6% auto;
  padding: 2rem;
  border-radius: 16px;
  width: 340px;
  max-width: 95%;
  max-height: 95vh;
  overflow-y: auto;
  color: #fff;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  transform: scale(0.95);
  opacity: 0;
  animation: modalOpen 0.35s forwards;
}

@keyframes modalOpen {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Profile Modal Content - Adjusted for better fitting */
.profile-modal-content {
  background-color: #1a1a1c;
  margin: 2% auto;
  padding: 25px;
  border-radius: 15px;
  width: auto;
  max-width: 900px;
  min-height: auto;
  max-height: 90vh;
  overflow-y: auto;
  color: #d1d1d1 !important;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  position: relative;
  box-sizing: border-box;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.profile-modal-content::-webkit-scrollbar {
  display: none;
}

#welcomeMessage {
  display: none;
  visibility: visible;
  color: hotpink;
  font-size: 16px;
  margin-right: 10px;
}
#welcomeMessage[style*="display: inline"] {
  display: inline !important;
}

/* Add to css/base.css or css/auth.css */
.profile-input {
  width: 100%;
  padding: 0.7rem;
  background: #2c2c2c;
  border: 1px solid #555;
  border-radius: 6px;
  color: #fff;
  font-size: 0.95rem;
}

.profile-input:focus {
  border-color: #10a37f;
  outline: none;
}

.btn-small {
  padding: 8px 16px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-small:hover {
  background: #0056b3;
}

#editProfileModal .form-group select,
#editProfileModal .form-group textarea {
  width: 100%;
  padding: 0.7rem;
  background: #2c2c2c;
  border: 1px solid #555;
  border-radius: 6px;
  color: #fff;
  font-size: 0.95rem;
}

#editProfileModal .form-group textarea {
  min-height: 100px;
  resize: vertical;
}

#editProfileModal .form-group select:focus,
#editProfileModal .form-group textarea:focus {
  border-color: #10a37f;
  outline: none;
}

#editProfileModal .form-group select:not(:placeholder-shown) + label,
#editProfileModal .form-group textarea:not(:placeholder-shown) + label {
  top: -0.5rem;
  left: 0.5rem;
  font-size: 0.7rem;
  color: #10a37f;
  background: #202123;
  padding: 0 4px;
}

/* Reviews Modal: Centered, compact, smooth animation */
#reviewsModal.account-modal {
  display: none; /* Hidden by default, JS toggles to block */
  position: fixed;
  z-index: 1002;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  animation: fadeModal 0.35s ease forwards;
}

.reviews-modal-content {
  font-family: Arial, sans-serif;
  background-color: #1a1a1c;
  margin: 2% auto;
  padding: 25px;
  border-radius: 15px;
  width: auto;
  max-width: 600px;
  min-height: auto;
  max-height: 90vh;
  overflow-y: auto;
  color: #d1d1d1 !important;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  position: relative;
  box-sizing: border-box;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.reviews-modal-content::-webkit-scrollbar {
  display: none;
}

.reviews-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.review {
  margin-bottom: 10px;
  background: #1a1a1c;
  border-radius: 10px;
  padding: 20px;
  border: 1px solid #2a2a2c;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease;
  width: 100%;
  max-width: 550px;
  box-sizing: border-box;
  color: #d1d1d1 !important;
}

.review:hover {
  transform: translateY(-2px);
}

.review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  text-align: left;
}

.review-user {
  font-weight: 600;
  font-size: 0.95rem;
  color: #d1d1d1 !important;
}

.review-meta {
  font-size: 0.8rem;
  color: #888;
}

.stars {
  color: #00b67a;
  font-size: 1rem;
  margin: 6px 0;
  text-align: left;
}

.review-text {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #d1d1d1 !important;
  margin-bottom: 10px;
  text-align: left;
}

.comments-thread {
  margin-top: 12px;
  padding: 14px;
  background: #2a2a2c;
  border-radius: 8px;
  border-left: 3px solid #9c27b0;
  text-align: left;
}

.comment {
  margin-bottom: 12px;
}

.comment-meta {
  font-size: 0.8rem;
  color: #aaa;
  margin-bottom: 6px;
}

.comment p {
  font-size: 0.9rem;
  color: #d1d1d1 !important;
  margin: 0;
}

.reply-form {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reply-input {
  width: 100%;
  min-height: 50px;
  max-height: 150px;
  padding: 10px;
  border: 1px solid #444;
  border-radius: 6px;
  box-sizing: border-box;
  font-size: 0.9rem;
  resize: vertical;
  background: #2a2a2c;
  color: #d1d1d1 !important;
}

.reply-input:focus {
  outline: none;
  border-color: #00b67a;
  box-shadow: 0 0 5px rgba(0, 182, 122, 0.3);
}

.save-reply-btn {
  align-self: flex-end;
  background: #00b67a;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.save-reply-btn:hover {
  background: #00915f;
}

@keyframes fadeModal {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.hidden {
  display: none !important;
}

@keyframes fadeBg {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.account-modal-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  color: #ffffff !important;
  padding-bottom: 0.1rem;
  border-bottom: 2px solid #10a37f;
}

.auth-close {
  position: absolute;
  top: 0px;
  right: 12px;
  color: #aaa;
  font-size: 30px;
  cursor: pointer;
  transition: color 0.3s ease;
}

.auth-close:hover {
  color: #fff;
}

/* Auth Form Section */
.auth-form-section {
  text-align: center;
  padding: 0 15px;
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ff4081, #f50057);
  color: #fff;
  font-weight: 700;
  font-size: 1.5rem;
  text-transform: uppercase;
}

/* Social Login Buttons */
.social-login {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

.social-login button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  color: #fff;
  transition: all 0.2s ease;
  background: none;
}

.social-login .google-btn {
  background-color: #4285f4 !important;
}

.social-login .google-btn:hover {
  background-color: #357ae8 !important;
}

.social-login .facebook-btn {
  background-color: #1877f2 !important;
}

.social-login .facebook-btn:hover {
  background-color: #145dbf !important;
}

.social-login button i {
  font-size: 1.2rem;
}

.social-login button:hover {
  transform: translateY(-2px);
}

/* Divider and OR */
.auth-divider {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 1rem 0;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: #ccc;
}

.divider-text {
  margin: 0 10px;
  color: #666;
  font-size: 14px;
  font-weight: bold;
}

/* Form Fields */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0px;
}

.form-group {
  position: relative;
  margin-bottom: 1rem;
  text-align: left;
}

.form-group input {
  width: 100%;
  padding: 0.7rem;
  background: #2c2c2c;
  border: 1px solid #555;
  border-radius: 6px;
  color: #fff;
  font-size: 0.95rem;
}

.form-group label {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  color: #aaa;
  font-size: 0.85rem;
  pointer-events: none;
  transition: 0.2s ease all;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label {
  top: -0.5rem;
  left: 0.5rem;
  font-size: 0.7rem;
  color: #10a37f;
  background: #202123;
  padding: 0 4px;
}

/* Submit Button */
.btn-auth-submit {
  width: 100%;
  padding: 0.75rem;
  background-color: #10a37f;
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 1rem;
}

.btn-auth-submit:hover {
  background-color: #0e8a6b;
  transform: translateY(-2px);
}

/* Switch Login/Register */
.auth-switch {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: #ccc;
  text-align: center;
}

.auth-switch a {
  color: #10a37f;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* Forgot Password */
.auth-forgot {
  margin-top: 0rem;
  font-size: 0.85rem;
  color: #ccc;
  text-align: right;
}

.auth-forgot a {
  color: #10a37f;
  text-decoration: none;
}

.auth-forgot a:hover {
  text-decoration: underline;
}

/* Profile Details - Adjusted for better fitting and mobile stacking */
.account-details {
  text-align: left;
  color: #d1d1d1 !important;
  font-size: 1rem !important;
  overflow-y: auto;
  scrollbar-width: none;
  display: none;
  grid-template-areas:
    "header header"
    "group1 group2"
    "group3 group4";
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.account-details:not(.hidden) {
  display: grid !important;
}

.account-details::-webkit-scrollbar {
  display: none;
}

.account-details .profile-header {
  grid-area: header;
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 0.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #00c853;
}

.account-details .profile-header img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #ff4081;
  box-shadow: 0 4px 10px rgba(255, 64, 129, 0.3);
}

.account-details .profile-header h3 {
  font-size: 1.5rem;
  color: #ffffff !important;
  margin: 0;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  max-width: 60%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ======================================================
   FIXED Profile Field Layout - No Overflow, Tight Spacing
====================================================== */

/* FIXED: Profile Field - Tight spacing, text wrapping, vertical alignment */
.profile-field {
  display: grid; /* ✅ CHANGED: flex instead of grid */
  grid-template-columns: 120px 1fr;
  align-items: center; /* ✅ VERTICALLY CENTERED */
  gap: 0.8rem; /* ✅ TIGHTER GAP - closer to labels */
  min-height: 1.4rem; /* ✅ Consistent height */
}

.profile-field strong {
  color: #ffffff !important;
  font-weight: 600;
  flex-shrink: 0; /* ✅ Labels DON'T shrink */
  min-width: 120px; /* ✅ Fixed label width */
  font-size: 0.95rem; /* ✅ Consistent size */
  display: flex;
  align-items: center;
}

.profile-field span,
.profile-field a {
  color: #d1d1d1 !important;
  word-break: break-word; /* ✅ BREAKS LONG WORDS */
  overflow-wrap: break-word;
  line-height: 1.3; /* ✅ Tight line height */
  font-size: 0.92rem; /* ✅ Slightly smaller text */
}

/* ✅ LONG TEXT HANDLING - Multiple lines */
.profile-field span {
  display: -webkit-box;
  -webkit-line-clamp: 3; /* ✅ MAX 3 LINES */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ✅ LINKS - Handle long URLs better */
.profile-field a {
  max-width: 100%;
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ✅ EMPTY FIELDS - Better placeholder */
.profile-field span:empty::before,
.profile-field span:not(:empty):not([style*="text"]):empty::before {
  content: "Not provided";
  color: #888 !important;
  font-style: italic;
}

/* ======================================================
   Profile Group - Better spacing
====================================================== */
.profile-group {
  margin-bottom: 0; /* ✅ More breathing room between groups */
  padding: 0.8rem; /* ✅ Slightly more padding */
  background-color: #2a2a2c;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
}

.profile-group h3 {
  font-size: 1.2rem;
  color: #ff4081;
  margin: 0 0 0.8rem 0; /* ✅ More space below title */
  border-bottom: 1px solid #444;
  padding-bottom: 0.5rem;
  font-weight: 600;
}

.profile-group:hover {
  transform: translateY(-2px);
}

.badge-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge-container .badge {
  padding: 0.4rem 1rem;
  background: linear-gradient(90deg, #ff4081, #f50057);
  color: #fff;
  border-radius: 18px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: transform 0.3s ease;
}

.badge-container .badge:hover {
  transform: scale(1.05);
}

.logout-btn {
  grid-column: 1 / -1;
  width: 100%;
  padding: 12px;
  background: linear-gradient(90deg, #ff4444, #cc0000);
  border: none;
  border-radius: 6px;
  color: #ffffff !important;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1.2rem;
}

.logout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(255, 68, 68, 0.4);
}

/* ======================================================
   Pill Buttons for Account Type Selection
====================================================== */
.account-type-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 1rem;
}

.pill-btn {
  flex: 1;
  padding: 0.6rem 1rem;
  border-radius: 50px;
  border: 2px solid #555;
  background-color: #2c2c2c;
  color: #fff;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all 0.3s ease;
}

.pill-btn:hover {
  background-color: #ff4081;
  border-color: #ff4081;
  color: #fff;
  transform: translateY(-2px);
}

.pill-btn.selected {
  background-color: #ff4081;
  border-color: #ff4081;
  color: #fff;
}

/* Notification Styling for showNotification */
/* auth.css */
.notification {
  padding: 12px 24px;
  border-radius: 8px;
  color: #fff;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.3s ease; /* Only opacity transition */
  z-index: 1003;
}

body .notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: fit-content; /* Size to text content */
  min-width: 150px; /* Prevent overly narrow notifications */
  text-align: center;
}

.account-modal-content .notification {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: fit-content;
  min-width: 150px;
  text-align: center;
}

.notification.show {
  opacity: 1;
}

/* Success and error styles */
.notification.success {
  background-color: #10a37f;
}
.notification.error {
  background-color: #ff4444;
}

/* Invoice Modal - Add to your existing CSS */
.invoice-modal-content {
  max-width: 950px;
  max-height: 90vh;
  overflow-y: auto;
}

.invoice-summary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 10px;
  padding: 25px;
  margin-bottom: 20px;
}

.invoice-summary h3 {
  margin: 0 0 10px 0;
}
.invoice-summary h2 {
  color: #ffd700;
  margin: 15px 0;
}

.badge.pending {
  background-color: #ffc107 !important;
  color: #000 !important;
}
.badge.paid {
  background-color: #28a745 !important;
  color: white !important;
}
.badge.overdue {
  background-color: #dc3545 !important;
  color: white !important;
}
.badge.cancelled {
  background-color: #6c757d !important;
  color: white !important;
}

.table {
  margin-bottom: 0;
}
.table th {
  background-color: #f8f9fa;
}
.table-info {
  background-color: #d1ecf1 !important;
}

.btn {
  margin: 5px;
  border-radius: 5px;
}
.btn i {
  margin-right: 5px;
}

/* Responsive - Enhanced for Profile Stacking and Modal Sizing */
@media (max-width: 768px) {
  /* Login Modal: No changes - preserved as-is */
  .account-modal-content {
    width: 85%;
    padding: 1.2rem;
    max-height: 80vh;
    border-radius: 12px;
  }

  /* Profile Modal: Stack details vertically, adjust size for fitting */
  .profile-modal-content {
    max-width: 95%;
    width: 95%;
    padding: 20px;
    margin: 5% auto;
  }

  .account-details {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "header"
      "group1"
      "group2"
      "group3"
      "group4" !important;
  }

  /* Reviews Modal: Compact sizing, hidden scrolling */
  #reviewsModal.account-modal {
    padding: 5px;
  }

  .reviews-modal-content {
    max-width: 95%;
    padding: 15px;
    max-height: 80vh;
  }

  .review {
    max-width: 90%;
  }

  .reply-input {
    min-height: 40px;
    font-size: 0.85rem;
  }

  .save-reply-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
  }

  .profile-group {
    padding: 1rem;
  }

  .profile-field {
    grid-template-columns: 1fr 2fr !important;
    gap: 0.4rem;
  }

  .profile-field strong {
    min-width: auto; /* ✅ Full width on mobile */
    font-size: 0.9rem;
    font-weight: 500;
  }

  .profile-field span,
  .profile-field a {
    font-size: 0.9rem;
    width: 100%; /* ✅ Full width on mobile */
  }

  /* invoice   */
  .invoice-summary {
    padding: 15px;
  }
  .row > .col-md-6 {
    margin-bottom: 15px;
  }
}

@media (max-width: 480px) {
  /* Login Modal: No changes - preserved as-is */
  .account-modal-content {
    width: 90%;
    padding: 0.8rem;
    max-height: 75vh;
    border-radius: 10px;
  }

  .account-modal-content h2 {
    font-size: 1.3rem;
  }

  .btn-auth-submit {
    font-size: 0.9rem;
    padding: 0.65rem;
  }

  .social-login button {
    font-size: 0.85rem;
    padding: 0.65rem;
  }

  .form-group input {
    font-size: 0.9rem;
    padding: 0.6rem;
  }

  .form-group label {
    font-size: 0.8rem;
  }

  .auth-close {
    font-size: 30px;
    top: 0px;
    right: 10px;
  }

  /* Profile Modal: Further stacking and compact sizing */
  .profile-modal-content {
    max-width: 98%;
    width: 98%;
    padding: 15px;
    margin: 3% auto;
    max-height: 85vh;
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .profile-header img {
    width: 60px;
    height: 60px;
  }

  .profile-header h3 {
    font-size: 1.2rem;
    max-width: 100%;
  }

  /* Reviews Modal: Ultra-compact for small screens */
  .reviews-modal-content {
    max-width: 98%;
    padding: 10px;
    max-height: 75vh;
  }

  .review {
    padding: 15px;
    max-width: 95%;
  }

  .reply-input {
    min-height: 35px;
    font-size: 0.8rem;
  }

  .save-reply-btn {
    padding: 5px 10px;
    font-size: 0.8rem;
  }
}
