/* =====================================================
   Design Tokens
   ===================================================== */

:root {
  --primary: #4285F4;
  --dark: #202124;
  --gray: #5f6368;
  --light: #f8f9fa;
  --border: #e0e0e0;
}

/* =====================================================
   Global Reset
   ===================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--light);
  color: var(--dark);
}

/* =====================================================
   Landing Page
   ===================================================== */

#landing-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, #fff 0%, #e8f0fe 100%);
}

/* Google Button */

.g-btn {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 4px;
  cursor: pointer;
  transition: box-shadow .2s;
}

.g-btn:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 3px rgba(60,64,67,.3);
}

.g-btn-icon {
  padding: 11px;
  display: flex;
}

.g-btn-text {
  padding: 0 12px;
  font-weight: 500;
  color: #3c4043;
}

/* =====================================================
   App Shell (FULL WIDTH)
   ===================================================== */

#app-shell {
  display: none;
  flex-direction: column;
  width: 100%;
  min-height: 100%;
}

/* =====================================================
   Top Navigation (Gmail-like)
   ===================================================== */

nav {
  height: 64px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-pic {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #eee;
}

/* =====================================================
   App Area
   ===================================================== */

#app {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* View switching */

.view {
  display: none;
  width: 100%;
  height: 100%;
}

.view.active {
  display: block;
}

/* =====================================================
   Inbox (Thread List)
   ===================================================== */

.thread-list {
  width: 100%;
  background: #fff;
}

.thread-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.thread-row.unread {
  background: #f2f6fc;
  font-weight: 600;
}

.thread-main {
  flex: 1;
  display: flex;
  gap: 12px;
  overflow: hidden;
  white-space: nowrap;
}

.thread-senders {
  min-width: 220px;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-subject {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #333;
}

/* Hover snippet (Gmail-style preview) */

/* .thread-row:hover::after {
  content: attr(data-snippet);
  position: absolute;
  left: 280px;
  top: 100%;
  max-width: 70%;
  background: #fff;
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid #ccc;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  white-space: normal;
  z-index: 20;
} */

/* =====================================================
   Thread View (Conversation)
   ===================================================== */

.thread-toolbar {
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

#thread-content {
  display: flex;
  flex-direction: column;
  align-items: center; /* center horizontally */
}

/* #thread-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #fafafa;
} */

/* =====================================================
   Messages
   ===================================================== */

.message {
  margin-bottom: 24px;
  width: 100%;
  max-width: 960px; /* Gmail reading width */
}

.message.collapsed .message-body {
  display: none;
}

.message-header {
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 6px;
  cursor: pointer;
}

.message-body {
  background: #fff;
  padding: 12px;
  border-radius: 6px;
  overflow: hidden;
}

.message-frame {
  width: 100%;
  height: 70vh;       /* or min-height: 300px */
  border: none;
}


/* =====================================================
   Email Iframe (IMPORTANT)
   ===================================================== */

.message-frame {
  width: 100%;
  border: none;
  display: block;
}

/* =====================================================
   Footer
   ===================================================== */

footer {
  background: var(--dark);
  color: #fff;
  padding: 20px;
  text-align: center;
}

.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.pagination-bar select {
  margin: 0 6px;
}

.pagination-bar button {
  padding: 6px 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
}

.pagination-bar button:disabled {
  opacity: 0.5;
  cursor: default;
}
