/* ============================================
   MYPEAS Dashboard Styles
   ============================================ */

:root {
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --secondary-color: #64748b;
  --success-color: #22c55e;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --bg-white: #ffffff;
  --bg-light: #f8fafc;
  --bg-gray: #f1f5f9;
  --border-color: #e2e8f0;
  --border-radius: 8px;
  --border-radius-lg: 12px;
  --box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-light);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ============================================
   Navigation
   ============================================ */

.navbar {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-logo {
  height: 32px;
}

/* Desktop Nav Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-left: 3rem;
  flex: 1;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0;
  position: relative;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link.active {
  color: var(--primary-color);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary-color);
  border-radius: 1px;
}

/* User Menu & Avatar */
.nav-user {
  position: relative;
}

.nav-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
  border: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.nav-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.nav-avatar:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Dropdown Menu */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--box-shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.nav-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  padding: 1rem;
}

.dropdown-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.dropdown-email {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.125rem;
  word-break: break-all;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
}

.dropdown-item:hover {
  background: var(--bg-light);
}

.dropdown-icon {
  font-size: 1rem;
  opacity: 0.7;
}

.dropdown-logout {
  color: var(--danger-color);
}

.dropdown-logout:hover {
  background: #fef2f2;
}

/* Hamburger Menu Button */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--border-radius);
  transition: background 0.2s;
}

.nav-hamburger:hover {
  background: var(--bg-light);
}

.hamburger-line {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s;
}

.nav-hamburger.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu */
.nav-mobile-menu {
  display: none;
  background: var(--bg-white);
  border-top: 1px solid var(--border-color);
  padding: 1rem 1.5rem 1.5rem;
}

.nav-mobile-menu.show {
  display: block;
}

.mobile-link {
  display: block;
  width: 100%;
  padding: 0.875rem 0;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: color 0.2s;
}

.mobile-link:hover {
  color: var(--primary-color);
}

.mobile-link.active {
  color: var(--primary-color);
}

.mobile-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.5rem 0;
}

.mobile-user-info {
  padding: 0.75rem 0;
}

.mobile-user-name {
  font-weight: 600;
  color: var(--text-primary);
}

.mobile-user-email {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.mobile-logout {
  color: var(--danger-color);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-user {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }
}

/* ============================================
   Main Content
   ============================================ */

.dashboard-main {
  padding: 2rem 0 4rem;
}

/* ============================================
   Welcome Section
   ============================================ */

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

.welcome-section h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.welcome-section h1 span {
  color: var(--primary-color);
}

.welcome-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* ============================================
   Service Cards
   ============================================ */

.services-section {
  margin-bottom: 2.5rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.service-card {
  background: var(--bg-white);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--box-shadow);
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--border-color);
}

.service-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--box-shadow-lg);
}

.service-card-featured {
  border: 2px solid var(--primary-color);
  position: relative;
}

.service-card-featured::before {
  content: 'RECOMMENDED';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary-color);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.service-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.service-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.service-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s;
}

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

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

.btn-secondary {
  background: var(--bg-gray);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--border-color);
}

.btn-danger {
  background: var(--danger-color);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0;
}

.btn-text:hover {
  color: var(--primary-color);
}

/* ============================================
   Custom Profile Generation Section
   ============================================ */

.custom-profile-generation-section {
  margin-bottom: 2.5rem;
}

.custom-profile-progress-card {
  background: var(--bg-white);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--box-shadow);
  border: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.custom-profile-progress-card.complete {
  border-color: var(--success-color);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.05) 0%, var(--bg-white) 100%);
}

.custom-profile-progress-card.failed {
  border-color: var(--danger-color);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, var(--bg-white) 100%);
}

.progress-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.progress-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge.success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success-color);
}

.status-badge.error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger-color);
}

.status-badge.warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning-color);
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: var(--bg-gray);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color) 0%, #8b5cf6 100%);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
}

.progress-message {
  color: var(--text-secondary);
}

.progress-percent {
  font-weight: 600;
  color: var(--primary-color);
}

.progress-info {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.progress-info.error-text {
  color: var(--danger-color);
}

.progress-actions {
  display: flex;
  gap: 0.75rem;
}

/* ============================================
   My Profile Section
   ============================================ */

.my-profile-section {
  margin-bottom: 2.5rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.profile-card {
  background: var(--bg-white);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--box-shadow);
  border: 1px solid var(--border-color);
}

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

.profile-job-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.profile-industry {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.profile-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
}

.profile-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.profile-segments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.segment-tag {
  background: var(--bg-gray);
  color: var(--text-secondary);
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.profile-actions {
  display: flex;
  gap: 0.75rem;
}

/* ============================================
   Recently Viewed Section
   ============================================ */

.recently-viewed-section {
  margin-bottom: 2.5rem;
}

.recently-viewed-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.recent-job-card {
  background: var(--bg-white);
  border-radius: var(--border-radius);
  padding: 1rem;
  box-shadow: var(--box-shadow);
  border: 1px solid var(--border-color);
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.recent-job-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--box-shadow-lg);
}

.recent-job-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recent-job-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ============================================
   Job Search Section
   ============================================ */

.job-search-section {
  background: var(--bg-white);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--box-shadow);
}

.job-search-section h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  color: var(--text-primary);
  text-align: center;
}

.job-search-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin: 0 0 1.5rem 0;
  font-size: 0.95rem;
}

.job-search-bar {
  display: flex;
  gap: 0.75rem;
  max-width: 600px;
  margin: 0 auto 1rem auto;
}

.job-search-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 0.95rem;
  background: var(--bg-white);
}

.job-search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.popular-jobs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.popular-jobs span {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.popular-job-btn {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.popular-job-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.job-search-results {
  margin-top: 1.5rem;
}

.job-search-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.job-search-results-header h3 {
  text-align: left;
  margin: 0;
  font-size: 1rem;
}

.job-search-results-count {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.job-results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.job-result-card {
  background: var(--bg-white);
  border-radius: var(--border-radius);
  padding: 1rem;
  border: 1px solid var(--border-color);
  text-decoration: none;
  transition: all 0.2s;
  display: block;
}

.job-result-card:hover {
  border-color: var(--primary-color);
  box-shadow: var(--box-shadow);
}

.job-result-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.job-result-description {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.job-result-meta {
  font-size: 0.75rem;
  color: var(--primary-color);
  font-weight: 500;
}

.job-search-no-results {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

/* CTA Card within Search Results */
.job-result-cta-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  min-height: 140px;
}

.job-result-cta-card .cta-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255, 255, 255, 0.25);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.job-result-cta-card .cta-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.job-result-cta-card .cta-description {
  font-size: 0.8rem;
  opacity: 0.9;
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.btn-cta-small {
  background: white;
  color: #667eea;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.75rem;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-block;
  text-align: center;
  width: fit-content;
}

.btn-cta-small:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ============================================
   Modal Styles
   ============================================ */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-white);
  border-radius: var(--border-radius-lg);
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--box-shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

/* Account Modal Specific */
.account-user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.account-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 1.25rem;
}

.account-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.account-email {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.account-section {
  margin-bottom: 1.5rem;
}

.account-section:last-child {
  margin-bottom: 0;
}

.account-section h4 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.subscription-info {
  background: var(--bg-gray);
  border-radius: var(--border-radius);
  padding: 1rem;
}

.subscription-plan {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.plan-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.plan-value {
  font-weight: 600;
  color: var(--text-primary);
}

.account-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ============================================
   Toast
   ============================================ */

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-primary);
  color: white;
  padding: 0.875rem 1.5rem;
  border-radius: var(--border-radius);
  font-size: 0.9rem;
  box-shadow: var(--box-shadow-lg);
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  z-index: 2000;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success {
  background: var(--success-color);
}

.toast.error {
  background: var(--danger-color);
}

/* ============================================
   Loading Spinner
   ============================================ */

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 0.8s linear infinite;
}

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

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

@media (max-width: 900px) {
  .services-grid {
    grid-template-columns: 1fr;
  }

  .recently-viewed-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .job-results-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .nav-menu {
    gap: 1rem;
  }

  .nav-link {
    font-size: 0.85rem;
  }

  .welcome-section h1 {
    font-size: 1.5rem;
  }

  .job-search-bar {
    flex-direction: column;
  }

  .recently-viewed-grid {
    grid-template-columns: 1fr;
  }

  .job-results-grid {
    grid-template-columns: 1fr;
  }

  .modal-content {
    margin: 1rem;
    max-width: calc(100% - 2rem);
  }
}

/* ============================================
   Enhanced Account Modal Styles
   ============================================ */

.modal-account {
  max-width: 480px;
}

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

/* Form Styles */
.account-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input {
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--bg-white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-input:read-only {
  background: var(--bg-gray);
  color: var(--text-secondary);
  cursor: not-allowed;
}

.form-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

select.form-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.form-error {
  font-size: 0.75rem;
  color: var(--danger-color);
}

.form-message {
  font-size: 0.85rem;
  padding: 0.5rem;
  border-radius: var(--border-radius);
  text-align: center;
}

.form-message.success {
  background: #dcfce7;
  color: #16a34a;
}

.form-message.error {
  background: #fef2f2;
  color: var(--danger-color);
}

/* Subscription Details */
.subscription-details {
  flex: 1;
}

.subscription-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.subscription-status {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Billing History */
.billing-history {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.invoices-list {
  background: var(--bg-gray);
  border-radius: var(--border-radius);
  padding: 0.75rem;
  max-height: 200px;
  overflow-y: auto;
}

.invoice-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

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

.invoice-date {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.invoice-link {
  font-size: 0.8rem;
  color: var(--primary-color);
  text-decoration: none;
  cursor: pointer;
}

.invoice-link:hover {
  text-decoration: underline;
}

.no-invoices {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
  padding: 1rem 0;
}

/* Notification Toggle */
.notification-toggle {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.notification-label {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.opt-loading {
  display: flex;
  align-items: center;
}

.spinner-small {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Danger Zone */
.account-danger-zone {
  border-top: 1px solid var(--danger-color);
  padding-top: 1.5rem;
  margin-top: 1.5rem;
}

.account-danger-zone h4 {
  color: var(--danger-color);
}

.danger-warning {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.btn-danger-outline {
  background: transparent;
  border: 1px solid var(--danger-color);
  color: var(--danger-color);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger-outline:hover {
  background: var(--danger-color);
  color: white;
}

/* Delete Account Modal */
.delete-warning {
  margin-bottom: 1rem;
}

.delete-warning p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.delete-warning strong {
  color: var(--danger-color);
}

.delete-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.delete-actions .btn {
  flex: 1;
}

/* Modal Spinner Overlay */
.modal-spinner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-lg);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.modal-content {
  position: relative;
}

/* Responsive adjustments for account modal */
@media (max-width: 500px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .subscription-info {
    flex-direction: column;
    align-items: flex-start;
  }

  .subscription-info .btn {
    width: 100%;
  }

  .notification-toggle {
    flex-wrap: wrap;
  }

  .delete-actions {
    flex-direction: column;
  }
}

/* Add KPI Modal */
.modal-description {
  color: #666;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.form-actions .btn {
  min-width: 100px;
}

/* ============================================
   Custom Profile Card - Enhanced Styles
   ============================================ */

.custom-profile-card {
  position: relative;
}

.profile-summary-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* KPIs Section in Profile Card */
.profile-kpis-section {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.profile-kpis-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.profile-kpis-header h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.profile-kpis-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.profile-kpi-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 0.875rem;
  background: var(--bg-gray);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.profile-kpi-item:hover {
  background: #e5e7eb;
  border-color: var(--primary-color);
}

.kpi-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-score {
  font-size: 0.75rem;
  font-weight: 600;
  color: #059669;
  background: #d1fae5;
  padding: 0.125rem 0.5rem;
  border-radius: 10px;
  margin-left: 0.5rem;
}

/* KPI Empty State - New Design */
.profile-kpis-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem 1rem;
  background: var(--bg-gray);
  border-radius: var(--border-radius);
  border: 1px dashed var(--border-color);
}

.kpi-empty-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.kpi-empty-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.375rem 0;
}

.kpi-empty-subheading {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0 0 1rem 0;
}

.btn-add-kpi {
  font-weight: 500;
}

/* Legacy class - keep for backwards compatibility */
.profile-kpis-empty {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  padding: 0.75rem;
  background: var(--bg-gray);
  border-radius: var(--border-radius);
  text-align: center;
}

/* Profile Generation Info */
.profile-generation-info {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.generation-count {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Regenerate Modal Warning */
.regenerate-warning {
  text-align: center;
  padding: 1rem;
}

.regenerate-warning .warning-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.regenerate-warning p {
  margin: 0.5rem 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.regenerate-warning strong {
  color: var(--text-primary);
}

.regenerate-warning .warning-note {
  font-size: 0.85rem;
  color: #d97706;
  margin-top: 1rem;
}

/* Text button variant */
.btn-text {
  background: transparent;
  color: var(--primary-color);
  border: none;
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 500;
}

.btn-text:hover {
  text-decoration: underline;
}

.btn-text.btn-sm {
  font-size: 0.8rem;
}

/* Add Task button styling */
.btn-add-task {
  white-space: nowrap;
}

/* Profile Actions Row - Improved layout */
.profile-actions-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.profile-actions-row .btn {
  flex-shrink: 0;
}

.regenerations-info {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-left: auto;
  padding: 0.375rem 0.75rem;
  background: var(--bg-gray);
  border-radius: 20px;
}

@media (max-width: 500px) {
  .profile-actions-row {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-actions-row .btn {
    width: 100%;
  }

  .regenerations-info {
    margin-left: 0;
    text-align: center;
  }
}

/* Profile Loading Skeleton */
.profile-loading-skeleton {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.skeleton-card {
  background: white;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
}

.skeleton-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.skeleton-line {
  background: var(--bg-gray);
  border-radius: 4px;
  height: 1rem;
}

.skeleton-title {
  width: 60%;
  height: 1.25rem;
}

.skeleton-badge {
  width: 48px;
  height: 24px;
  background: var(--bg-gray);
  border-radius: 12px;
}

.skeleton-text {
  width: 100%;
  margin-bottom: 0.5rem;
}

.skeleton-text.short {
  width: 70%;
}

.skeleton-tags {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.skeleton-tag {
  width: 80px;
  height: 24px;
  background: var(--bg-gray);
  border-radius: 12px;
}

.skeleton-kpis {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.skeleton-kpi-header {
  margin-bottom: 0.75rem;
}

.skeleton-kpi-title {
  width: 40%;
  height: 1rem;
}

.skeleton-kpi-item {
  height: 42px;
  background: var(--bg-gray);
  border-radius: var(--border-radius);
  margin-bottom: 0.5rem;
}

/* ============================================
   Full Page Loading Overlay
   ============================================ */

.page-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.page-loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.page-loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.loading-logo {
  height: 48px;
  animation: pulse 2s ease-in-out infinite;
}

.loading-spinner-large {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
}

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