/* ==========================================================================
   LIVE REAL-LOOKING EMAIL INBOX & PREVIEW DEMO COMPONENT
   Supports: HTML Email Templates & Clickable Email Signatures
   100% Fully Responsive for Mobile, Tablet, and Desktop
   ========================================================================== */

.email-inbox-section {
  background-color: var(--color-card-bg);
  border-radius: 2rem;
  padding: 2rem 1.25rem;
  border: 1px solid var(--color-border);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

@media (min-width: 1024px) {
  .email-inbox-section {
    padding: 3.5rem 3rem;
  }
}

.inbox-header-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .inbox-header-box {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
}

/* Tab filter switcher: All / Email Templates / Email Signatures */
.inbox-type-tabs {
  display: inline-flex;
  background: var(--color-card-soft);
  padding: 0.35rem;
  border-radius: 9999px;
  gap: 0.35rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  align-self: flex-start;
}

.inbox-tab-btn {
  padding: 0.5rem 1.15rem;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 200ms ease;
  user-select: none;
  font-family: inherit;
}

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

.inbox-tab-btn.active {
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

/* ==========================================================================
   THE EMAIL CLIENT APP CONTAINER (Realistic Gmail / Apple Mail Style UI)
   ========================================================================== */

.email-client-mockup {
  background: #ffffff;
  border-radius: 1.5rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Window Chrome Titlebar */
.email-client-titlebar {
  background: #f1f5f9;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  user-select: none;
}

.window-dots {
  display: flex;
  gap: 0.4rem;
}

.window-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.window-dot.red { background: #ef4444; }
.window-dot.yellow { background: #f59e0b; }
.window-dot.green { background: #10b981; }

.window-app-title {
  font-size: 0.825rem;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.window-status-pill {
  font-size: 0.725rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.window-status-pill::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

/* Two-Panel Layout (Sidebar List & Reading Pane) */
.email-client-body {
  display: flex;
  flex-direction: column;
  min-height: 580px;
}

@media (min-width: 900px) {
  .email-client-body {
    flex-direction: row;
    height: 680px;
  }
}

/* LEFT SIDEBAR: Email Items List */
.email-inbox-sidebar {
  width: 100%;
  background: #f8fafc;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
}

@media (min-width: 900px) {
  .email-inbox-sidebar {
    width: 320px;
    min-width: 300px;
    max-width: 340px;
    border-bottom: none;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
  }
}

@media (min-width: 1200px) {
  .email-inbox-sidebar {
    width: 360px;
    max-width: 380px;
  }
}

.sidebar-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-heading {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.sidebar-count-badge {
  font-size: 0.75rem;
  font-weight: 700;
  background: #e2e8f0;
  color: #475569;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
}

/* Sidebar Search Box */
.sidebar-search-box {
  position: relative;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: #f8fafc;
}

.sidebar-search-input {
  width: 100%;
  padding: 0.5rem 0.85rem 0.5rem 2.25rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #ffffff;
  font-family: inherit;
  font-size: 0.8rem;
  color: #0f172a;
  outline: none;
  transition: all 150ms ease;
}

.sidebar-search-input:focus {
  border-color: #0f172a;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.08);
}

.sidebar-search-icon {
  position: absolute;
  left: 1.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.sidebar-items-list {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  max-height: 320px;
}

@media (min-width: 900px) {
  .sidebar-items-list {
    max-height: 100%;
  }
}

/* Sidebar Pagination Bar */
.sidebar-pagination-bar {
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.sidebar-page-info {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 600;
}

.sidebar-nav-btns {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.sidebar-page-btn {
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #ffffff;
  color: #0f172a;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 150ms ease;
  user-select: none;
}

.sidebar-page-btn:hover:not(:disabled) {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.sidebar-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Individual Email Row in List */
.inbox-row-item {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: all 200ms ease;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: relative;
  text-align: left;
  background: transparent;
  border-left: 3px solid transparent;
}

.inbox-row-item:hover {
  background: #f1f5f9;
}

.inbox-row-item.active {
  background: #ffffff;
  border-left-color: #0f172a;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.inbox-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.inbox-row-sender {
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inbox-row-date {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 600;
  white-space: nowrap;
}

.inbox-row-subject {
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.inbox-row-item.active .inbox-row-subject {
  color: #0f172a;
  font-weight: 700;
}

.inbox-row-preview {
  font-size: 0.775rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inbox-row-badge {
  display: inline-block;
  align-self: flex-start;
  margin-top: 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  letter-spacing: 0.02em;
}

.inbox-row-badge.template {
  background: #e0f2fe;
  color: #0369a1;
}

.inbox-row-badge.signature {
  background: #fef3c7;
  color: #b45309;
}

/* ==========================================================================
   RIGHT PANE: Realistic Email Reading Box
   ========================================================================== */

.email-preview-pane {
  flex: 1;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Message Header Info */
.email-pane-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #ffffff;
}

@media (min-width: 768px) {
  .email-pane-header {
    padding: 1.5rem 2rem;
  }
}

.email-subject-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.email-sender-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.sender-profile-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sender-avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #0f172a;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sender-details {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.sender-name-full {
  font-size: 0.925rem;
  font-weight: 700;
  color: #0f172a;
}

.sender-recipient-text {
  font-size: 0.8rem;
  color: #64748b;
}

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

.toolbar-btn {
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #f8fafc;
  color: #334155;
  font-size: 0.775rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all 150ms ease;
  user-select: none;
}

.toolbar-btn:hover {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

/* Mail Body Canvas */
.email-canvas-scroll {
  flex: 1;
  padding: 1.5rem 1rem;
  overflow-y: auto;
  background: #f1f5f9;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 768px) {
  .email-canvas-scroll {
    padding: 2.5rem 2rem;
  }
}

.email-render-wrapper {
  max-width: 640px;
  margin: 0 auto;
}

/* Empty or Loading State */
.email-pane-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #94a3b8;
  gap: 1rem;
  padding: 3rem;
  text-align: center;
}
