body { 
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; 
  margin:0; 
  background:#e6f3ff; 
  color:#1a1a1a; 
}

header { 
  display:flex; 
  align-items:center; 
  justify-content:space-between; 
  padding:24px 28px; 
  background:#fff; 
  border-bottom:1px solid #eee; 
  position:sticky; 
  top:0; 
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 100;
}

.logo { 
  height:180px; 
  width: auto;
  transition: transform 0.2s ease;
}

.logo:hover {
  transform: scale(1.05);
}

nav a { 
  margin-left:18px; 
  text-decoration:none; 
  color:#2c3e50; 
  font-weight:600;
  font-size:16px;
  padding:8px 12px;
  border-radius:8px;
  transition: background-color 0.2s ease;
}

nav a:hover {
  background-color:#f5f5f5;
}

nav .upgrade { 
  color:#fff; 
  background:#1e72ff; 
  padding:10px 16px; 
  border-radius:10px;
  font-size:16px;
  font-weight:600;
}

nav .upgrade:hover {
  background:#1558cc;
}

main { 
  max-width:880px; 
  margin:20px auto; 
  padding:0 16px; 
}

h1 {
  color:#2c3e50;
  margin-bottom: 20px;
}

label { 
  display:block; 
  margin-top:12px; 
  font-weight:600; 
  color:#2c3e50;
}

input, select, textarea { 
  width:100%; 
  padding:10px; 
  border:1px solid #d6d6d6; 
  border-radius:10px; 
  background:#fff; 
  font-size: 14px;
  box-sizing: border-box;
}

button, .button { 
  margin-top:14px; 
  padding:10px 14px; 
  background:#1e72ff; 
  border:none; 
  color:#fff; 
  border-radius:10px; 
  font-weight:700; 
  cursor:pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s;
  box-sizing: border-box;
}

button:hover, .button:hover {
  background:#1558cc;
  transform: translateY(-1px);
}

button:disabled {
  background: #ccc !important;
  cursor: not-allowed !important;
  transform: none !important;
}

button:active, .button:active {
  transform: translateY(0);
}

.card { 
  white-space:pre-wrap; 
  background:#fff; 
  border:1px solid #eee; 
  padding:16px; 
  border-radius:12px; 
  margin-top:16px; 
}

.apology {
  background: #f8fff8;
  border-left: 4px solid #28a745;
  padding: 16px;
  border-radius: 8px;
  line-height: 1.6;
  font-size: 16px;
}

.error {
  background: #fff5f5;
  border-left: 4px solid #dc3545;
  padding: 16px;
  border-radius: 8px;
  color: #721c24;
}

.feedback {
  background: #f8f9ff;
  border-left: 4px solid #007bff;
  padding: 16px;
  border-radius: 8px;
  line-height: 1.6;
}

.feedback-analysis h3 {
  color: #134;
  margin-top: 20px;
  margin-bottom: 10px;
}

.feedback-analysis ul {
  list-style-type: none;
  padding: 0;
}

.feedback-analysis li {
  background: #f1f3f4;
  padding: 8px 12px;
  margin: 5px 0;
  border-radius: 6px;
}

.scenario-example {
  background: #f8f9ff;
  border-left: 4px solid #007bff;
  padding: 12px 16px;
  margin: 10px 0;
  border-radius: 6px;
  font-size: 14px;
  color: #134;
}

select:disabled {
  background-color: #f5f5f5;
  color: #999;
  cursor: not-allowed;
}

button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

button:disabled:hover {
  background-color: #ccc;
}

/* Tone Selector - Mobile-friendly checkbox styling */
.tone-selector {
  margin: 16px 0;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
}

.tone-selector label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  margin: 8px 0;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.tone-selector label:hover {
  border-color: #1e72ff;
  background: #f0f7ff;
  cursor: pointer;
}

.tone-selector label:active {
  transform: scale(0.98);
}

.tone-selector input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin: 2px 0 0 0;
  cursor: pointer;
  flex-shrink: 0;
}


.tone-selector span {
  flex: 1;
  line-height: 1.5;
  user-select: none;
}

.explanation-box {
  background: #f8f9fa;
  border-left: 4px solid #1e72ff;
  padding: 16px 20px;
  border-radius: 8px;
  margin-top: 16px;
  font-size: 15px;
  line-height: 1.6;
  color: #2c3e50;
}

.explanation-box strong {
  color: #1e72ff;
  display: block;
  margin-bottom: 8px;
}

.share-section {
  background: #fff;
  border: 1px solid #eee;
  padding: 20px;
  border-radius: 12px;
  margin-top: 16px;
  text-align: center;
}

.share-section h3 {
  margin-top: 0;
  margin-bottom: 16px;
  color: #134;
  font-size: 18px;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
}

.share-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.copy-btn {
  background: #f8f9fa;
  color: #495057;
  border: 2px solid #dee2e6;
}

.copy-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.facebook-btn {
  background: #1877f2;
  color: white;
}

.facebook-btn:hover {
  background: #0c5fcd;
}

.twitter-btn {
  background: #000000;
  color: white;
}

.twitter-btn:hover {
  background: #333333;
}

.instagram-btn {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: white;
}

.instagram-btn:hover {
  opacity: 0.9;
}

.messages-btn {
  background: #007aff;
  color: white;
}

.messages-btn:hover {
  background: #0056cc;
}

.email-btn {
  background: #6c757d;
  color: white;
}

.email-btn:hover {
  background: #545b62;
}


.messenger-btn {
  background: #0084ff;
  color: white;
}

.messenger-btn:hover {
  background: #0066cc;
}

.copy-feedback {
  margin-top: 12px;
  padding: 8px 16px;
  background: #d4edda;
  color: #155724;
  border-radius: 6px;
  font-weight: 600;
  display: inline-block;
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
  /* Header improvements */
  header {
    padding: 16px 20px;
    flex-wrap: wrap;
    gap: 12px;
  }
  
  /* Navigation improvements */
  nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    justify-content: center;
  }
  
  nav a {
    font-size: 14px;
    padding: 10px 14px;
    min-height: 44px; /* Touch target size */
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 1 auto;
  }
  
  nav #pwa-install-btn {
    min-height: 44px;
    padding: 10px 14px;
  }
  
  .logo {
    height: 100px;
    width: auto;
  }
  
  /* Form improvements */
  label {
    font-size: 16px;
    margin-bottom: 8px;
    margin-top: 16px;
  }
  
  input, select, textarea {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 12px;
    min-height: 44px; /* Touch target size */
    border-radius: 8px;
    -webkit-appearance: none;
    appearance: none;
  }
  
  select {
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 40px;
  }
  
  /* Button improvements */
  button, .button {
    font-size: 16px;
    padding: 14px 20px;
    min-height: 44px;
    border-radius: 8px;
    margin-top: 16px;
    width: 100%;
    box-sizing: border-box;
  }
  
  /* Content spacing */
  main {
    padding: 20px 15px;
  }
  
  h1 {
    font-size: 24px;
    margin-bottom: 20px;
  }
  
  /* Share buttons */
  .share-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .share-btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
    font-size: 14px;
  }
  
  /* Card improvements */
  .card {
    margin: 15px 0;
    padding: 16px;
    border-radius: 8px;
  }
  
  /* Example text */
  .scenario-example {
    font-size: 14px;
    padding: 12px;
    margin: 12px 0;
    border-radius: 8px;
  }
  
  /* Prevent horizontal scroll */
  body {
    overflow-x: hidden;
  }
  
  /* Form focus states for better accessibility */
  input:focus, select:focus, textarea:focus {
    outline: 2px solid #1e72ff;
    outline-offset: 2px;
  }
  
  /* Tone selector mobile improvements */
  .tone-selector {
    padding: 8px;
  }
  
  .tone-selector label {
    padding: 14px 12px;
    gap: 10px;
  }
  
  .tone-selector input[type="checkbox"] {
    width: 22px;
    height: 22px;
    min-width: 22px;
  }
  
  .tone-selector span {
    font-size: 15px;
  }
}

/* Very small screens */
@media (max-width: 480px) {
  header {
    padding: 12px 15px;
  }
  
  nav {
    gap: 6px;
  }
  
  nav a {
    font-size: 13px;
    padding: 10px 12px;
    min-height: 44px; /* Maintain touch target */
  }
  
  .logo {
    height: 80px;
    width: auto;
  }
  
  main {
    padding: 15px 12px;
  }
  
  h1 {
    font-size: 22px;
  }
  
  input, select, textarea, button {
    font-size: 16px; /* Keep at 16px to prevent zoom */
  }
  
  /* Hero sample improvements for small screens */
  .hero-sample {
    padding: 16px 18px !important;
  }
  
  .hero-sample h3 {
    font-size: 1.1rem !important;
  }
  
  /* Theory grid stacks on small screens */
  .theory-grid {
    grid-template-columns: 1fr !important;
  }
  
  /* Upgrade prompt adjustments */
  .upgrade-prompt {
    padding: 16px;
  }
  
  /* Footer mobile */
  footer {
    font-size: 0.8rem !important;
    padding: 1.5rem 1rem !important;
  }
  
  footer div {
    margin: 8px 0;
  }
}

/* Expert Analysis Styles */
.hero-section {
  text-align: center;
  margin: 30px 0;
}

.hero-title {
  font-size: 2.2em;
  color: #134;
  margin-bottom: 8px;
}

.hero-subtitle {
  font-size: 1.1em;
  color: #666;
  margin-bottom: 30px;
}

.form-section {
  margin: 30px 0;
}

.form-card {
  background: #fff;
  border: 1px solid #eee;
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.results-section {
  margin: 30px 0;
}

.results-card {
  background: #fff;
  border: 1px solid #eee;
  padding: 24px;
  border-radius: 12px;
}

.analysis-section {
  margin: 20px 0;
  padding: 16px;
  background: #f8f9ff;
  border-left: 4px solid #007bff;
  border-radius: 8px;
}

.analysis-section h4 {
  color: #134;
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 16px;
}

.analysis-section p {
  margin: 0;
  line-height: 1.6;
}

.analysis-section ul {
  margin: 8px 0;
  padding-left: 20px;
}

.analysis-section li {
  margin: 4px 0;
}

.theory-info {
  margin: 40px 0;
  background: #fff;
  border: 1px solid #eee;
  padding: 24px;
  border-radius: 12px;
}

.theory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.theory-card {
  background: #f8f9ff;
  border: 1px solid #e1e8ff;
  padding: 20px;
  border-radius: 10px;
}

.theory-card h4 {
  color: #134;
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 16px;
}

.theory-card p {
  margin: 8px 0 0 0;
  line-height: 1.5;
  font-size: 14px;
}

.upgrade-prompt {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  margin: 30px 0;
}

.upgrade-btn {
  background: #1e72ff;
  color: white;
  padding: 12px 24px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  margin-top: 10px;
  transition: background-color 0.2s;
}

.upgrade-btn:hover {
  background: #1558cc;
}

.generate-btn {
  background: #1e72ff;
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 16px;
}

.generate-btn:hover {
  background: #1558cc;
}

.generate-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

footer {
  text-align: center;
  padding: 20px;
  color: #666;
  border-top: 1px solid #eee;
  margin-top: 40px;
}