/* Session Closed Modal Styles */
.session-closed-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  z-index: 1;
}
.modal-content {
  position: relative;
  z-index: 2;
  background: var(--bg-primary);
  color: var(--text-primary);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 2rem 2.5rem;
  max-width: 400px;
  width: 90vw;
  text-align: center;
}
.modal-content h2 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
  font-weight: 700;
}
.modal-content p {
  margin-bottom: 2rem;
  font-size: 1rem;
}
.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}
.app-main {
  scrollbar-width: none;
}
.app-main::-webkit-scrollbar {
  display: none;
}
@media (max-width: 640px) {
  html,
  body {
    overflow: hidden !important;
    height: 100vh !important;
    /* Hide scrollbar visually */
    scrollbar-width: none;
  }
  html::-webkit-scrollbar,
  body::-webkit-scrollbar {
    display: none;
  }
  .app-main,
  .content-header {
    scrollbar-width: none;
  }
  .app-main::-webkit-scrollbar,
  .content-header::-webkit-scrollbar {
    display: none;
  }
}
@media (max-width: 640px) {
  html,
  body {
    overflow: hidden !important;
    height: 100vh !important;
  }
  .app-main {
    flex: 1;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    /* Remove overflow: auto to prevent static scrollbar */
  }
  .email-detail-panel {
    flex: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;
  }
  .email-detail-content {
    flex: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;
  }
}
/* MailBin - Sidebar Layout Styles */

/* Alpine.js cloak to prevent FOUC (Flash of Unstyled Content) */
[x-cloak] {
  display: none !important;
}

:root {
  --sidebar-width: 240px;
  --primary-color: #0969da;
  --primary-hover: #0550ae;
  --success-color: #1a7f37;
  --danger-color: #cf222e;
  --bg-primary: #ffffff;
  --bg-secondary: #f6f8fa;
  --bg-active: #ddf4ff;
  --border-color: #d0d7de;
  --text-primary: #24292f;
  --text-secondary: #57606a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* Dark theme colors */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary-color: #539bf5;
    --primary-hover: #6cb6ff;
    --success-color: #3fb950;
    --danger-color: #f85149;
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-active: #1c2d41;
    --border-color: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8d96a0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
  }
}

/* Manual dark theme override */
:root[data-theme="dark"] {
  --primary-color: #539bf5;
  --primary-hover: #6cb6ff;
  --success-color: #3fb950;
  --danger-color: #f85149;
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-active: #1c2d41;
  --border-color: #30363d;
  --text-primary: #e6edf3;
  --text-secondary: #8d96a0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
}

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

/* Skip to main content link for accessibility and SEO */
.skip-to-main {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: 1rem 1.5rem;
  background: var(--primary-color);
  color: white;
  text-decoration: none;
  font-weight: 600;
  border-radius: 0 0 6px 0;
}

.skip-to-main:focus {
  left: 0;
  top: 0;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica,
    Arial, sans-serif;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-secondary);
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Icon styles for custom lightweight SVG icons */
.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: middle;
}

.icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Sidebar Styles */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-primary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-header .logo-icon {
  color: var(--primary-color);
  flex-shrink: 0;
  width: 32px;
  height: 32px;
}

.logo-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.logo-text .tagline {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 0;
  transition: opacity 0.3s ease-in-out;
}

.theme-toggle {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0.5rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.theme-toggle .icon {
  width: 20px;
  height: 20px;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  position: relative;
}

.nav-tab i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-tab:hover {
  background: var(--bg-secondary);
  color: var(--primary-color);
}

.nav-tab.active {
  background: var(--bg-active);
  color: var(--primary-color);
  font-weight: 600;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger-color);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 12px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6e7781;
  flex-shrink: 0;
}

.status-dot.connected {
  background: var(--success-color);
  box-shadow: 0 0 0 3px rgba(26, 127, 55, 0.1);
}

.status-dot.disconnected {
  background: var(--danger-color);
}

/* Main Content Area */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tab-content {
  display: none;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.tab-content.active {
  display: flex;
}

.content-header {
  padding: 1.5rem 2rem;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex-shrink: 0;
  position: relative;
}

.content-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.content-header h2 i {
  width: 24px;
  height: 24px;
}

.new-address-btn {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  flex-shrink: 0;
}

.header-title {
  flex: 1;
  min-width: 0;
  padding-right: 1rem;
}

.email-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.email-address-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 500px;
  background: var(--bg-primary);
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  padding: 0.75rem 0.875rem;
  transition: all 0.2s ease;
  cursor: pointer;
  user-select: none;
}

.email-address-display:hover {
  border-color: var(--primary-color);
  background: #f8fafc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.email-address-display:active {
  transform: scale(0.99);
}

.email-address-display.copied {
  border-color: var(--success-color);
  background: #dcfce7;
}

.email-address-value {
  flex: 1;
  min-width: 0;
}

.email-text {
  display: block;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica,
    Arial, sans-serif;
  font-size: 1.125rem;
  color: var(--primary-color);
  font-weight: 600;
  letter-spacing: 0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-email-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.copy-email-btn:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.copy-email-btn.copied {
  background: var(--success-color);
  border-color: var(--success-color);
  color: white;
}

.copy-email-btn .check-icon {
  color: white;
}

.copy-email-btn i {
  width: 18px;
  height: 18px;
}

.primary-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.primary-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.primary-btn .btn-icon {
  width: 16px;
  height: 16px;
}

.content-body {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

.tab-footer {
  padding: 0.5rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
  background: var(--bg-primary);
  margin-top: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.linkedin-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}

.linkedin-link:hover {
  background: #e8f4fd;
  color: #0077b5;
}

.linkedin-icon {
  flex-shrink: 0;
  vertical-align: middle;
}

/* Inbox View */
.inbox-view {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.inbox-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 0;
  overflow: hidden;
}

.emails-list-panel {
  border-right: 1px solid var(--border-color);
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.emails-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.message-count {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 400;
}

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

.action-btn {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-btn:hover:not(:disabled) {
  background: var(--bg-secondary);
  border-color: var(--primary-color);
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.delete-btn:hover:not(:disabled) {
  background: #ffebe9;
  border-color: var(--danger-color);
}

#emails-list {
  flex: 1;
  overflow-y: auto;
}

.email-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.15s ease;
}

.email-item:hover {
  background: var(--bg-secondary);
}

.email-item.selected {
  background: var(--bg-active);
  border-left: 3px solid var(--primary-color);
}

.email-item.unread {
  background: var(--bg-secondary);
}

.email-item.unread .email-subject {
  font-weight: 600;
}

.email-checkbox {
  margin-top: 0.25rem;
  cursor: pointer;
}

.email-content {
  flex: 1;
  min-width: 0;
}

.email-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.email-from {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.email-subject {
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-body-preview {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
  color: var(--text-secondary);
}

.empty-icon-large {
  width: 64px;
  height: 64px;
  color: var(--text-secondary);
  opacity: 0.5;
  margin-bottom: 1rem;
}

.empty-state p {
  font-size: 1rem;
  margin: 0.5rem 0;
}

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

/* Email Detail Panel */
.email-detail-panel {
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.email-detail-content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

.no-selection {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-secondary);
}

.no-selection-icon i {
  width: 64px;
  height: 64px;
  opacity: 0.5;
}

.no-selection p {
  margin-top: 1rem;
  font-size: 1rem;
}

.email-detail-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.email-detail-subject {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.email-detail-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.email-meta-row {
  display: flex;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.email-meta-label {
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 60px;
}

.email-meta-value {
  color: var(--text-primary);
}

.email-detail-body {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Email View Toggle */
.email-view-toggle {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
  padding: 0.25rem;
  background: var(--bg-secondary);
  border-radius: 6px;
  width: fit-content;
}

.view-toggle-btn {
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.view-toggle-btn:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
}

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

/* HTML Email Iframe */
.email-html-frame {
  width: 100%;
  min-height: 400px;
  border: none;
  background: var(--bg-primary);
  color-scheme: light dark;
}

/* Email Attachments */
.email-attachments {
  margin: 1.5rem 0;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
}

.email-attachments-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text-primary);
  user-select: none;
  transition: background 0.2s;
}

.email-attachments-summary:hover {
  background: var(--border-color);
}

.email-attachments-summary svg {
  color: var(--text-secondary);
}

.email-attachments-list {
  padding: 0.5rem;
  background: var(--bg-primary);
}

.attachment-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 4px;
  transition: background 0.2s;
}

.attachment-item:hover {
  background: var(--bg-secondary);
}

.attachment-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: 4px;
  color: var(--text-secondary);
}

.attachment-info {
  flex: 1;
  min-width: 0;
}

.attachment-filename {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.125rem;
}

.attachment-size {
  font-weight: 500;
}

.attachment-note {
  padding: 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border-radius: 4px;
  text-align: center;
}

/* Developers Tab */
.dev-intro {
  background: var(--bg-active);
  border-left: 3px solid var(--primary-color);
  padding: 1rem 1.5rem;
  border-radius: 6px;
  margin-bottom: 2rem;
}

.dev-intro p {
  margin: 0;
  color: var(--text-primary);
}

.credentials-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.credentials-card h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.125rem;
}

.smtp-credential-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.smtp-credential-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.smtp-credential-row label {
  font-weight: 600;
  color: var(--text-primary);
  min-width: 90px;
  font-size: 0.875rem;
}

.credential-value {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
}

.credential-value code {
  flex: 1;
  font-family:
    ui-monospace, "SF Mono", Monaco, "Cascadia Mono", "Segoe UI Mono",
    "Roboto Mono", "Oxygen Mono", "Ubuntu Monospace", "Source Code Pro",
    "Fira Mono", "Droid Sans Mono", "Courier New", monospace;
  font-size: 0.8125rem;
  color: var(--text-primary);
  word-break: break-all;
}

.credential-value code.password-field {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.copy-credential-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
}

.copy-credential-btn:hover {
  color: var(--primary-color);
  background: var(--bg-active);
  border-radius: 4px;
}

.copy-credential-btn.copied {
  color: var(--success-color);
  background: #dcfce7;
  border-radius: 4px;
}

.copy-credential-btn .check-icon {
  color: var(--success-color);
}

.copy-credential-btn i {
  width: 16px;
  height: 16px;
}

.dev-docs {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.doc-section {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
}

.doc-section h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.125rem;
  color: var(--text-primary);
}

.doc-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.doc-section li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.doc-section li:before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--primary-color);
}

.doc-section code {
  background: var(--bg-secondary);
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  font-family:
    ui-monospace, "SF Mono", Monaco, "Cascadia Mono", "Segoe UI Mono",
    "Roboto Mono", "Oxygen Mono", "Ubuntu Monospace", "Source Code Pro",
    "Fira Mono", "Droid Sans Mono", "Courier New", monospace;
  font-size: 0.875rem;
  color: var(--danger-color);
}

.doc-section pre {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  margin-top: 0.5rem;
}

.doc-section pre code {
  background: none;
  padding: 0;
  color: #24292e;
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* Code Examples Styling */
.code-example-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.language-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.language-selector label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.language-dropdown {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  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='%2357606a' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
}

.language-dropdown:hover {
  border-color: var(--primary-color);
  background-color: var(--bg-secondary);
}

.language-dropdown:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.1);
}

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

.code-example pre {
  margin: 0;
  background: #2d2d2d;
  border: 1px solid #1a1a1a;
}

.code-example pre code {
  color: #f8f8f2;
  font-size: 0.8125rem;
}

/* About Tab */
.about-intro {
  background: var(--bg-active);
  border-left: 3px solid var(--primary-color);
  padding: 1rem 1.5rem;
  border-radius: 6px;
  margin-bottom: 2rem;
}

.about-intro p {
  margin: 0;
  font-size: 1rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.feature-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.2s ease;
}

.feature-card:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.feature-card-icon {
  width: 32px;
  height: 32px;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.feature-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  color: var(--text-primary);
}

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

.faq-section {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2rem;
}

.faq-section h3 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.faq-item h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.faq-item p {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* Bottom Navigation (Mobile Only) */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  padding: 0.5rem 0;
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem 0.25rem;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  flex: 1;
}

.bottom-nav-item .icon {
  width: 24px;
  height: 24px;
}

.bottom-nav-item span {
  font-size: 0.6875rem;
}

.bottom-nav-item:active {
  transform: scale(0.95);
}

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

.bottom-nav-item.active::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: var(--primary-color);
  border-radius: 0 0 3px 3px;
}

.bottom-nav-badge {
  position: absolute;
  top: 0.25rem;
  right: 25%;
  background: var(--danger-color);
  color: white;
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* Mobile Header (Mobile Only) */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  padding-top: max(0.75rem, env(safe-area-inset-top));
  z-index: 50;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.mobile-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mobile-logo .logo-icon {
  width: 28px;
  height: 28px;
  color: var(--primary-color);
}

.mobile-logo-text {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.mobile-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mobile-theme-toggle {
  margin-left: 0;
  padding: 0.5rem;
}

.mobile-theme-toggle .icon {
  width: 20px;
  height: 20px;
}

.mobile-connection-status {
  display: flex;
  align-items: center;
}

.mobile-connection-status .status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #6e7781;
}

.mobile-connection-status .status-dot.connected {
  background: var(--success-color);
  box-shadow: 0 0 0 3px rgba(26, 127, 55, 0.1);
}

.mobile-connection-status .status-dot.disconnected {
  background: var(--danger-color);
}

/* Home Tab (Mobile Only) */
.home-tab {
  display: none;
}

.home-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 2rem 1.5rem;
  text-align: center;
}

.home-header {
  margin-bottom: 2rem;
}

.home-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.home-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

.home-email-card {
  width: 100%;
  max-width: 500px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.home-email-card .email-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
}

.home-email-card .email-address-display {
  width: 100%;
}

.home-refresh-btn {
  width: 100%;
  max-width: 500px;
  justify-content: center;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
}

.home-footer {
  margin-top: auto;
  padding-top: 2rem;
}

.home-footer p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0.5rem 0;
}

.home-footer-info {
  font-size: 0.75rem !important;
  color: var(--text-secondary);
}

.home-footer .linkedin-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}

.home-footer .linkedin-link:hover {
  background: #e8f4fd;
  color: #0077b5;
}

.home-footer .linkedin-icon {
  flex-shrink: 0;
  vertical-align: middle;
}

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

.copy-url-btn.copied {
  background: var(--success-color);
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .inbox-layout {
    grid-template-columns: 350px 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 200px;
  }

  .sidebar-header {
    padding: 1rem 0.75rem;
  }

  .logo-text h1 {
    font-size: 1.125rem;
  }

  .content-header {
    padding: 1rem 1.5rem;
    flex-wrap: wrap;
  }

  .content-body {
    padding: 1.5rem;
  }

  .inbox-layout {
    grid-template-columns: 1fr;
    position: relative;
  }

  .email-detail-panel {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
  }

  .email-detail-panel.mobile-visible {
    display: flex;
  }

  .emails-list-panel.mobile-hidden {
    display: none;
  }

  .mobile-back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    width: auto;
    max-width: 320px;
    align-self: flex-start;
  }

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

  .mobile-back-btn:active {
    transform: scale(0.98);
  }

  .features-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) {
  .mobile-back-btn {
    display: none;
  }
}

@media (max-width: 640px) {
  :root {
    --sidebar-width: 0;
  }

  body {
    padding-top: 0;
    padding-bottom: 0;
  }

  /* Hide sidebar completely on mobile */
  .app-sidebar {
    display: none;
  }

  /* Show mobile header */
  .mobile-header {
    display: block;
  }

  /* Show bottom navigation */
  .bottom-nav {
    display: flex;
  }

  /* Hide tab footer on mobile */
  .tab-footer {
    display: none;
  }

  /* Adjust main content to full width */
  .app-main {
    width: 100%;
    padding-top: max(64px, calc(64px + env(safe-area-inset-top)));
    padding-bottom: max(90px, calc(90px + env(safe-area-inset-bottom)));
  }

  /* Hide entire content header on mobile (email address and button are in Home tab) */
  .content-header {
    display: none;
  }

  .content-body {
    padding: 1rem;
    padding-bottom: 2rem;
  }

  .email-address-display {
    width: 100%;
    max-width: none;
    padding: 0.5rem 0.625rem;
    gap: 0.375rem;
  }

  .email-text {
    font-size: 0.9375rem;
  }

  .copy-email-btn {
    padding: 0.375rem;
    flex-shrink: 0;
  }

  .copy-email-btn .icon {
    width: 18px;
    height: 18px;
  }

  .emails-header {
    padding: 0.75rem 1rem;
  }

  .email-item {
    padding: 0.75rem 1rem;
  }

  #emails-list {
    padding-bottom: 1rem;
  }

  .email-detail-content {
    padding: 1rem;
    padding-bottom: 2rem;
  }
}
