:root {
  /* Colors - Salmon theme */
  --primary: #fa8072;
  --primary-hover: #ff6347;
  --primary-dark: #e6735f;
  --accent: #ff7f50;
  --bg-color: #fdfcfc;
  --card-bg: #ffffff;
  --text-color: #2d2d2d;
  --text-light: #6b7280;
  --border-color: rgba(250, 128, 114, 0.2);
  --error: #ef4444;
  --success: #10b981;
  
  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-size-sm: 12px;
  --font-size-base: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 18px;
  --font-size-2xl: 20px;
  --font-size-3xl: 24px;
  --font-size-4xl: 30px;
  
  /* Spacing */
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  
  /* Effects */
  --radius: 8px;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  --transition: all 0.2s ease;
}

/* Tabs */
.tab-container {
  margin-bottom: var(--space-lg);
}

.tabs {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: var(--space-lg);
  background: var(--card-bg);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab {
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: var(--font-size-base);
  color: var(--text-light);
  border-bottom: 3px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  min-width: 120px;
  text-align: center;
}

.tab:hover {
  background: rgba(33, 138, 141, 0.05);
  color: var(--primary);
}

.tab.active {
  border-bottom-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
  background: rgba(33, 138, 141, 0.08);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Base styles */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.5;
  margin: 0;
  padding: var(--space-lg);
  max-width: 1024px;
  margin: 0 auto;
  min-height: 100vh;
}

/* Header styling - purple gradient like the image */
.header {
  text-align: center;
  margin: var(--space-md) auto var(--space-sm);
  padding: var(--space-sm) 0;
}

.header .main-title {
  font-size: clamp(1.6rem, 4vw, 2.2rem); /* Original desktop size */
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
  display: flex;
  flex-direction: column;
  gap: 2px; /* super tight spacing */
}

.header .subtitle {
  font-size: clamp(0.8rem, 2vw, 1rem); /* Original desktop size */
  font-weight: 400;
  color: var(--text-light);
  line-height: 1.1;
  margin: 0;
}


@keyframes float {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.1); }
}

/* Typography */
h1 {
  font-size: var(--font-size-4xl);
  font-weight: 600;
  text-align: center;
  margin-bottom: var(--space-lg);
  color: var(--accent);
}

h2 {
  font-size: var(--font-size-3xl);
  color: #2563eb; /* Blue color for h2 */
  margin-bottom: var(--space-md);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: var(--space-sm);
  font-weight: 600;
}

h3 {
  font-size: var(--font-size-xl);
  color: #0891b2; /* Cyan/teal color for h3 */
  margin: var(--space-lg) 0 var(--space-md);
  font-weight: 600;
}

/* Job post specific heading styles */
.job-post h2 {
  color: #0e7490; /* Stronger blue for job post h2 */
  background: linear-gradient(135deg, #0e7490, #2563eb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid rgba(29, 78, 216, 0.2);
  position: relative;
  font-weight: 700;
}

.job-post h2::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, #0e7490, #2563eb);
  border-radius: var(--radius-sm);
}

.job-post h3 {
  color: #0e7490; /* Darker cyan for job post h3 */
  font-size: var(--font-size-xl);
  margin: var(--space-lg) 0 var(--space-md);
  font-weight: 600;
  position: relative;
  padding-left: var(--space-md);
}

.job-post h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 24px;
  background: linear-gradient(135deg, #0891b2, #06b6d4);
  border-radius: var(--radius-sm);
}

.job-post h4 {
  color: #374151; /* Dark gray for h4 */
  font-size: var(--font-size-lg);
  margin: var(--space-md) 0 var(--space-sm);
  font-weight: 600;
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Forms */
label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: 500;
  color: var(--text-color);
}

input, textarea, select {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: var(--font-size-base);
  font-family: inherit;
  background: #faf9f8; /* Changed to milky/off-white color for better visibility */
  color: var(--text-color);
  margin-bottom: var(--space-md);
  transition: var(--transition);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(33, 138, 141, 0.1);
}

textarea {
  min-height: 150px;
  resize: vertical;
}

/* Enhanced buttons with salmon theme */
button, .apply-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border: none;
  border-radius: 50px;
  color: white;
  font-weight: 600;
  font-size: var(--font-size-base);
  padding: 0 var(--space-xl);
  line-height: 44px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(250, 128, 114, 0.3);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: var(--font-size-sm);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

button::before, .apply-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

button:hover, .apply-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(250, 128, 114, 0.4);
  background: linear-gradient(135deg, var(--primary-hover) 0%, #ff6347 100%);
}

button:hover::before, .apply-btn:hover::before {
  left: 100%;
}

button:active, .apply-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(250, 128, 114, 0.3);
}

/* Status messages with salmon theme */
.status {
  margin-top: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-radius: 12px;
  font-size: var(--font-size-base);
  font-weight: 500;
  min-height: auto;
  border: none;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.status:empty {
  display: none;
}

.error {
  color: #dc2626;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-left: 4px solid #dc2626;
}

.error::before {
  content: "⚠";
  background: #dc2626;
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  flex-shrink: 0;
}

.success {
  color: #059669;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-left: 4px solid #10b981;
}

.success::before {
  content: "✓";
  background: #10b981;
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  flex-shrink: 0;
}

.processing {
  color: var(--primary-dark);
  background: linear-gradient(135deg, #fff5f5 0%, #fef2f2 100%);
  border-left: 4px solid var(--primary);
}

.processing::before {
  content: "⏳";
  background: var(--primary);
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Footer */
.footer {
  margin-top: var(--space-xl);
  padding: var(--space-xl) var(--space-lg);
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  text-align: center;
  color: #64748b;
}

.footer-title {
  font-size: var(--font-size-lg);
  color: #2d3748;
  font-weight: 600;
  margin-bottom: var(--space-md);
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.6;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
  text-align: left;
}

.footer-grid p {
  font-size: var(--font-size-sm);
  margin: 0;
  color: #4a5568;
}

.footer-bottom {
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
  font-size: var(--font-size-sm);
  color: #718096;
}

.footer-bottom .heart {
  color: #e53e3e;
  font-size: var(--font-size-base);
}

/* Output container */
.output-container {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-top: var(--space-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.output-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  background: rgba(33, 138, 141, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.output-content {
  padding: var(--space-lg);
}

/* Job post styling */
.job-post p {
  margin-bottom: var(--space-md);
}

.job-post ul {
  margin-bottom: var(--space-md);
  padding-left: var(--space-lg);
}

.job-post li {
  margin-bottom: var(--space-sm);
}

.bracket-text {
  color: var(--accent);
  font-style: italic;
}

.round-bracket-text {
  color: var(--accent);
  font-style: italic;
}

/* Layout */
.row {
  display: flex;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.col {
  flex: 1;
}

/* Processing messages */
.processing-message {
  background: linear-gradient(135deg, #fff5f5 0%, #fef2f2 100%);
  border: 1px solid rgba(250, 128, 114, 0.2);
  border-radius: 12px;
  padding: var(--space-lg);
  margin: var(--space-md) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.processing-message::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(250, 128, 114, 0.1), transparent);
  animation: shimmer 2s infinite;
}

.processing-message .message-content {
  position: relative;
  z-index: 2;
}

.processing-message .main-text {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: var(--space-sm);
  display: block;
}

.processing-message .sub-text {
  font-size: var(--font-size-base);
  color: var(--text-light);
  font-weight: 400;
  margin-bottom: var(--space-md);
}

.processing-message .dots {
  display: inline-flex;
  gap: 4px;
}

.processing-message .dot {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: bounce 1.4s ease-in-out infinite both;
}

.processing-message .dot:nth-child(1) { animation-delay: -0.32s; }
.processing-message .dot:nth-child(2) { animation-delay: -0.16s; }
.processing-message .dot:nth-child(3) { animation-delay: 0s; }

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* Job post meta information */
.job-post .meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding: var(--space-sm) var(--space-md);
  background: linear-gradient(135deg, #fff5f5 0%, #fef2f2 100%);
  border-radius: var(--radius);
  border: 1px solid rgba(250, 128, 114, 0.1);
  font-size: var(--font-size-sm);
}

.job-post .meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-light);
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: var(--transition);
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.5);
}

.job-post .meta-item:hover {
  color: var(--primary);
  background: rgba(250, 128, 114, 0.1);
  transform: translateY(-1px);
}

.job-post .meta-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Icon sizing controls */
svg {
  width: 16px;
  height: 16px;
}

.output-header svg {
  width: 14px;
  height: 14px;
}

.action-buttons svg {
  width: 14px;
  height: 14px;
}

/* Action buttons - fixed overlapping and different colors */
.action-buttons {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-md);
  flex-wrap: wrap;
  justify-content: flex-start;
}

.output-header .action-buttons {
  gap: var(--space-sm);
}

/* Copy button - keep salmon theme */
.btn-secondary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border: none;
  border-radius: 50px;
  color: white;
  font-weight: 600;
  font-size: var(--font-size-sm);
  padding: 0 var(--space-lg);
  line-height: 36px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 3px 10px rgba(250, 128, 114, 0.3);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  gap: var(--space-sm);
  min-width: 100px;
}

/* Download PDF button - purple theme */
.btn-download {
  background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
  border: none;
  border-radius: 50px;
  color: white;
  font-weight: 600;
  font-size: var(--font-size-sm);
  padding: 0 var(--space-lg);
  line-height: 36px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 3px 10px rgba(139, 92, 246, 0.3);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  gap: var(--space-sm);
  min-width: 120px;
}

.btn-secondary::before, .btn-download::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(250, 128, 114, 0.4);
  background: linear-gradient(135deg, var(--primary-hover) 0%, #ff6347 100%);
}

.btn-download:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(139, 92, 246, 0.4);
  background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%);
}

.btn-secondary:hover::before, .btn-download:hover::before {
  left: 100%;
}

.btn-secondary:active, .btn-download:active {
  transform: translateY(0);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Loading spinner sizing */
.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(250, 128, 114, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
}

/* Mobile-first responsive design */
@media (max-width: 768px) {
  body {
    padding: var(--space-sm);
  }
  
  .header {
    margin: var(--space-lg) 0;
    padding: var(--space-lg) var(--space-md);
    border-radius: 16px;
  }
  
  /* Header text sizes adjusted for mobile - targeting ~45% of screen */
  .header .main-title {
    font-size: clamp(1.5rem, 6vw, 2.5rem); /* Adjusted for ~45% screen coverage */
  }
  
  .header .subtitle {
    font-size: clamp(0.9rem, 3vw, 1.3rem); /* Adjusted for ~45% screen coverage */
  }
  
  .row {
    flex-direction: column;
    gap: var(--space-md);
  }
  
  .card {
    padding: var(--space-md);
    margin-bottom: var(--space-md);
  }
  
  h1 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-md);
  }
  
  h2, .job-post h2 {
    font-size: var(--font-size-xl);
  }
  
  h3, .job-post h3 {
    font-size: var(--font-size-lg);
    margin: var(--space-md) 0 var(--space-sm);
  }
  
  button, .apply-btn {
    width: 100%;
    font-size: var(--font-size-base);
    padding: 0 var(--space-lg);
    line-height: 40px;
  }
  
  /* Fix button overlapping on mobile */
  .action-buttons {
    flex-direction: column;
    gap: var(--space-sm);
    width: 100%;
  }
  
  .btn-secondary, .btn-download {
    width: 100%;
    min-width: auto;
    justify-content: center;
    padding: 0 var(--space-md);
    line-height: 40px;
  }
  
  .tabs {
    gap: 0;
    border-radius: var(--radius);
    margin-bottom: var(--space-md);
  }
  
  .tab {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
    min-width: 80px;
    flex: 1;
  }
  
  .output-header {
    padding: var(--space-md);
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-md);
  }
  
  .output-header h2 {
    margin: 0;
  }
  
  .output-content {
    padding: var(--space-md);
  }
  
  input, textarea, select {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-base);
    margin-bottom: var(--space-sm);
  }
  
  textarea {
    min-height: 120px;
  }
  
  .footer {
    margin-top: var(--space-lg);
    padding: var(--space-lg) var(--space-md);
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
    text-align: center;
  }
  
  .footer-title {
    font-size: var(--font-size-base);
  }
  
  .status {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
  }
  
  .status::before {
    width: 20px;
    height: 20px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px;
    font-size: var(--font-size-sm);
  }
  
  .header {
    padding: var(--space-md) var(--space-sm);
    border-radius: 12px;
  }
  
  /* Header sizes for very small screens - targeting ~45% coverage */
  .header .main-title {
    font-size: clamp(1.4rem, 7vw, 2.8rem); /* Balanced size for small screens */
    letter-spacing: -0.5px;
  }
  
  .header .subtitle {
    font-size: clamp(0.8rem, 3.5vw, 1.4rem); /* Balanced size for small screens */
  }
  
  .card {
    padding: var(--space-sm);
    border-radius: 12px;
  }
  
  h1 {
    font-size: var(--font-size-xl);
  }
  
  h2, .job-post h2 {
    font-size: var(--font-size-lg);
  }
  
  h3, .job-post h3 {
    font-size: var(--font-size-base);
  }
  
  .tab {
    padding: 10px 8px;
    font-size: 11px;
    min-width: 60px;
  }
  
  button, .apply-btn {
    line-height: 36px;
    font-size: var(--font-size-sm);
    padding: 0 var(--space-md);
  }
  
  .btn-secondary, .btn-download {
    line-height: 36px;
    font-size: var(--font-size-sm);
    padding: 0 var(--space-sm);
  }
  
  .output-header,
  .output-content {
    padding: var(--space-sm);
  }
  
  .footer {
    padding: var(--space-md) var(--space-sm);
    border-radius: 12px;
  }
  
  .footer-grid p {
    font-size: 11px;
  }
  
  .footer-bottom {
    font-size: 11px;
  }
  
  .status {
    padding: 10px var(--space-sm);
    border-radius: 8px;
  }
  
  .status::before {
    width: 18px;
    height: 18px;
    font-size: 11px;
  }
}