:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  background-image: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
}

.container {
  width: 100%;
  max-width: 1400px;
  padding: 2rem;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .input-row {
    flex-direction: column;
  }
  
  .action-buttons {
    width: 100%;
  }
  
  .action-buttons button {
    flex: 1;
  }
}

header {
  text-align: center;
  margin-bottom: 2.5rem;
}

h1 {
  font-size: 2.8rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: -1px;
}

header p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.email-generator {
  margin-bottom: 2rem;
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 1rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
}

.input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: stretch;
}

.custom-input {
  display: flex;
  align-items: center;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 0.25rem 0.5rem;
  flex: 1;
  min-width: 250px;
  transition: all 0.3s;
}

.custom-input:focus-within {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.custom-input input, .custom-input select {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 1.1rem;
  outline: none;
  padding: 0.5rem;
}

.custom-input input {
  flex: 1;
  min-width: 80px;
  width: 100%;
  font-weight: 500;
}

.custom-input select {
  cursor: pointer;
  font-weight: 600;
  color: var(--primary);
}

.custom-input select option {
  background: #ffffff;
  color: var(--text-main);
}

.at-symbol {
  color: var(--text-muted);
  font-weight: bold;
  font-size: 1.2rem;
  margin: 0 0.25rem;
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

button {
  padding: 0.8rem 1.5rem;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

button:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 8px -1px rgba(79, 70, 229, 0.3);
}

button:active {
  transform: scale(0.98);
}

.secondary-btn {
  background-color: #cbd5e1;
  color: #334155;
  box-shadow: none;
}

.secondary-btn:hover {
  background-color: #94a3b8;
  box-shadow: none;
}

.mailbox {
  background: var(--card-bg);
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  min-height: 400px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
  color: var(--text-main);
}

#status-badge {
  font-size: 0.85rem;
  padding: 0.3rem 0.8rem;
  border-radius: 1rem;
  font-weight: 600;
}

.status-offline { background: #e2e8f0; color: #475569; }
.status-online { background: #d1fae5; color: #059669; animation: pulse 2s infinite; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  margin-top: 3rem;
  font-style: italic;
}

.email-item {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1rem;
  animation: slideDown 0.4s ease-out;
  transition: transform 0.2s, box-shadow 0.2s;
}

.email-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.email-from {
  font-weight: 700;
  color: var(--primary);
  background: #e0e7ff;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.9rem;
}

.email-date {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.email-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.delete-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 0.25rem;
  transition: all 0.2s;
  box-shadow: none;
}

.delete-btn:hover {
  background: #fee2e2;
  color: #ef4444;
  transform: none;
  box-shadow: none;
}

.email-subject {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.email-body {
  color: #334155;
  background: #ffffff;
  padding: 1.5rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  overflow-x: auto;
  line-height: 1.6;
}

/* Tabs Styles */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab-btn {
  background-color: var(--card-bg);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  box-shadow: none;
  font-weight: 600;
  padding: 0.8rem 1.5rem;
}

.tab-btn:hover {
  background-color: #f1f5f9;
  color: var(--text-main);
  transform: none;
  box-shadow: none;
}

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

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* API Docs Styles */
.api-docs {
  background: var(--card-bg);
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
  margin-top: 0;
}

.api-docs h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  border-bottom: none;
  padding-bottom: 0;
}

.api-docs p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  margin-top: 0;
}

.api-endpoint {
  background: #f1f5f9;
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  word-break: break-all;
}

.api-endpoint strong {
  color: #059669;
  margin-right: 0.5rem;
}

.api-endpoint code {
  color: #0f172a;
  font-family: monospace;
  font-size: 1.1rem;
}

.api-endpoint code span {
  color: var(--primary);
  font-weight: bold;
}

.code-example {
  margin-bottom: 1rem;
}

.code-example h4 {
  margin: 0 0 0.5rem 0;
  color: var(--text-main);
}

.code-example pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  font-family: monospace;
  font-size: 0.95rem;
  margin: 0;
}
