/* ============================================================
   S.C.C. MAIL — Windows 95 Retro Theme (SCC Steel Blue)
   ============================================================ */

/* SCC color palette extracted from logo:
   Desktop bg  : #7a9db5  (matches logo background)
   Window face : #c4d4dc  (light blue-gray, replaces win95 #c0c0c0)
   Title active: #1e5778  (deep SCC blue)
   Title grad  : #3478a0
   Border hi   : #dde9f2
   Border dark : #4a6878
   Border deepest: #2a4858
*/

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

body {
  font-family: 'Tahoma', 'MS Sans Serif', Arial, sans-serif;
  font-size: 11px;
  background-color: #7a9db5;
  min-height: 100vh;
  color: #000;
}

/* ── Win95 window chrome ─────────────────────────────────── */

.win-window {
  background-color: #c4d4dc;
  border-top:    2px solid #dde9f2;
  border-left:   2px solid #dde9f2;
  border-bottom: 2px solid #2a4858;
  border-right:  2px solid #2a4858;
  box-shadow: 2px 2px 0 #1a3848;
}

.win-titlebar {
  background: linear-gradient(to right, #1e5778 0%, #3478a0 100%);
  color: #fff;
  padding: 3px 4px 3px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  min-height: 20px;
}

.title-text {
  font-weight: bold;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.title-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex-shrink: 0;
}

.win-controls {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  margin-left: 6px;
}

.win-ctrl {
  width: 16px;
  height: 14px;
  background-color: #c4d4dc;
  border-top:    1px solid #dde9f2;
  border-left:   1px solid #dde9f2;
  border-bottom: 1px solid #4a6878;
  border-right:  1px solid #4a6878;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  cursor: default;
  color: #000;
  text-decoration: none;
  line-height: 1;
  font-family: 'Tahoma', Arial, sans-serif;
}

.win-ctrl:hover {
  background-color: #d4e4ec;
}

.win-ctrl.close:hover {
  background-color: #c05050;
  color: #fff;
}

/* ── Menu bar ────────────────────────────────────────────── */

.win-menubar {
  background-color: #c4d4dc;
  padding: 2px 2px;
  display: flex;
  border-bottom: 1px solid #7a9aaa;
}

.menu-item {
  padding: 2px 8px;
  cursor: default;
  font-size: 11px;
  text-decoration: none;
  color: #000;
}

.menu-item:hover {
  background-color: #1e5778;
  color: #fff;
}

/* ── Toolbar ─────────────────────────────────────────────── */

.win-toolbar {
  background-color: #c4d4dc;
  padding: 3px 4px;
  display: flex;
  align-items: center;
  gap: 3px;
  border-bottom: 1px solid #7a9aaa;
  flex-wrap: wrap;
}

.toolbar-btn {
  background-color: #c4d4dc;
  border-top:    1px solid #dde9f2;
  border-left:   1px solid #dde9f2;
  border-bottom: 1px solid #4a6878;
  border-right:  1px solid #4a6878;
  padding: 2px 8px;
  font-size: 11px;
  font-family: 'Tahoma', 'MS Sans Serif', Arial, sans-serif;
  cursor: pointer;
  text-decoration: none;
  color: #000;
  white-space: nowrap;
}

.toolbar-btn:hover {
  background-color: #d4e4ec;
}

.toolbar-btn:active {
  border-top:    1px solid #4a6878;
  border-left:   1px solid #4a6878;
  border-bottom: 1px solid #dde9f2;
  border-right:  1px solid #dde9f2;
  padding: 3px 7px 1px 9px;
}

.toolbar-sep {
  width: 1px;
  height: 18px;
  background: #7a9aaa;
  margin: 0 2px;
}

/* ── Generic Win95 raised/sunken panels ──────────────────── */

.raised {
  border-top:    2px solid #dde9f2;
  border-left:   2px solid #dde9f2;
  border-bottom: 2px solid #4a6878;
  border-right:  2px solid #4a6878;
}

.sunken {
  border-top:    2px solid #4a6878;
  border-left:   2px solid #4a6878;
  border-bottom: 2px solid #dde9f2;
  border-right:  2px solid #dde9f2;
  background-color: #fff;
}

/* ── Form controls ───────────────────────────────────────── */

.win95-btn {
  background-color: #c4d4dc;
  border-top:    2px solid #dde9f2;
  border-left:   2px solid #dde9f2;
  border-bottom: 2px solid #4a6878;
  border-right:  2px solid #4a6878;
  padding: 4px 16px;
  font-family: 'Tahoma', 'MS Sans Serif', Arial, sans-serif;
  font-size: 11px;
  cursor: pointer;
  outline: none;
  min-width: 75px;
  color: #000;
}

.win95-btn:hover:not(:disabled) {
  background-color: #d4e4ec;
}

.win95-btn:active:not(:disabled) {
  border-top:    2px solid #4a6878;
  border-left:   2px solid #4a6878;
  border-bottom: 2px solid #dde9f2;
  border-right:  2px solid #dde9f2;
  padding: 5px 15px 3px 17px;
}

.win95-btn:focus {
  outline: 1px dotted #000;
  outline-offset: -4px;
}

.win95-btn:disabled {
  color: #7a8a90;
  cursor: default;
}

.win95-input {
  background-color: #fff;
  border-top:    2px solid #4a6878;
  border-left:   2px solid #4a6878;
  border-bottom: 2px solid #dde9f2;
  border-right:  2px solid #dde9f2;
  padding: 3px 5px;
  font-family: 'Tahoma', 'MS Sans Serif', Arial, sans-serif;
  font-size: 11px;
  outline: none;
  width: 100%;
  color: #000;
}

.win95-input:focus {
  outline: 2px solid #1e5778;
  outline-offset: 0;
}

/* ── Status bar ──────────────────────────────────────────── */

.win-statusbar {
  background-color: #c4d4dc;
  padding: 2px 4px;
  font-size: 11px;
  display: flex;
  gap: 4px;
  border-top: 1px solid #7a9aaa;
}

.status-pane {
  border-top:    1px solid #4a6878;
  border-left:   1px solid #4a6878;
  border-bottom: 1px solid #dde9f2;
  border-right:  1px solid #dde9f2;
  padding: 1px 6px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-pane a {
  color: #000;
  text-decoration: none;
}

.status-pane a:hover {
  text-decoration: underline;
}

/* ── Win95 group box / dialog ────────────────────────────── */

.win-groupbox {
  border: 1px solid #7a9aaa;
  padding: 10px;
  position: relative;
  margin-top: 8px;
}

.win-groupbox legend {
  padding: 0 4px;
  font-size: 11px;
}

/* ═══════════════════════════════════════════════════════════
   LOGIN PAGE
═══════════════════════════════════════════════════════════ */

body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #7a9db5;
  /* subtle Win95-style tiled feel */
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 4px 4px;
}

.login-outer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 420px;
}

.login-window {
  width: 100%;
}

.login-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.login-logo-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid #7a9aaa;
  width: 100%;
}

.login-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.org-name {
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0.5px;
  color: #1e3848;
}

.mail-label {
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #1e5778;
}

.version-label {
  font-size: 10px;
  color: #4a7888;
  letter-spacing: 1px;
}

.login-dialog {
  width: 100%;
}

.login-dialog .win-titlebar {
  font-size: 11px;
  padding: 2px 6px;
  min-height: 18px;
}

.dialog-body {
  padding: 12px 16px 14px;
}

.error-box {
  background-color: #fff0f0;
  border: 1px solid #c05050;
  padding: 4px 8px;
  margin-bottom: 10px;
  font-size: 11px;
  color: #8a0000;
  display: flex;
  align-items: center;
  gap: 5px;
}

.login-form-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 4px 6px;
}

.label-cell {
  width: 80px;
  text-align: right;
  padding-right: 6px;
  white-space: nowrap;
}

.btn-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.login-footer {
  font-size: 10px;
  color: #2a4858;
  text-align: center;
  border-top: 1px solid #7a9aaa;
  padding-top: 8px;
  width: 100%;
}

.login-statusbar {
  width: 100%;
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════
   INBOX PAGE
═══════════════════════════════════════════════════════════ */

body.inbox-page {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 10px;
  background-color: #7a9db5;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 4px 4px;
}

.inbox-window {
  width: 100%;
  max-width: 960px;
  display: flex;
  flex-direction: column;
}

.inbox-split {
  display: flex;
  min-height: 420px;
  flex: 1;
}

/* Left folder pane */
.folder-pane {
  width: 140px;
  flex-shrink: 0;
  background-color: #fff;
  border-top:    2px solid #4a6878;
  border-left:   2px solid #4a6878;
  border-bottom: 2px solid #dde9f2;
  border-right:  2px solid #dde9f2;
  border-right:  1px solid #7a9aaa;
  overflow-y: auto;
}

.folder-heading {
  background-color: #c4d4dc;
  padding: 3px 6px;
  font-weight: bold;
  font-size: 10px;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #7a9aaa;
  color: #1e3848;
}

.folder-item {
  padding: 4px 8px;
  cursor: default;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.folder-item:hover {
  background-color: #1e5778;
  color: #fff;
}

.folder-item.active {
  background-color: #1e5778;
  color: #fff;
}

.unread-badge {
  font-weight: bold;
  font-size: 10px;
  margin-left: 2px;
}

/* Right email list pane */
.email-pane {
  flex: 1;
  background-color: #fff;
  border-top:    2px solid #4a6878;
  border-left:   2px solid #4a6878;
  border-bottom: 2px solid #dde9f2;
  border-right:  2px solid #dde9f2;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.email-list-header {
  display: grid;
  grid-template-columns: 14px 200px 1fr 110px;
  gap: 0;
  background-color: #c4d4dc;
  border-bottom: 1px solid #7a9aaa;
  font-size: 11px;
  font-weight: bold;
}

.email-list-header span,
.email-row > span {
  padding: 3px 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-list-header span {
  border-top:    1px solid #dde9f2;
  border-left:   1px solid #dde9f2;
  border-bottom: 1px solid #4a6878;
  border-right:  1px solid #4a6878;
}

.email-row {
  display: grid;
  grid-template-columns: 14px 200px 1fr 110px;
  gap: 0;
  text-decoration: none;
  color: #000;
  border-bottom: 1px solid #e8f0f4;
  font-size: 11px;
}

.email-row:hover {
  background-color: #d0e4f0;
}

.email-row.selected,
.email-row:focus {
  background-color: #1e5778;
  color: #fff;
  outline: none;
}

.email-row.unread {
  font-weight: bold;
}

.email-row .flag {
  color: #1e5778;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
}

.email-row.unread .flag {
  color: #1e5778;
}

.col-flag  { overflow: visible; }
.col-date  { text-align: right; }

.empty-row {
  padding: 16px;
  color: #7a8a90;
  font-style: italic;
  grid-column: 1 / -1;
}

/* ═══════════════════════════════════════════════════════════
   EMAIL VIEW PAGE
═══════════════════════════════════════════════════════════ */

.email-view-window {
  width: 100%;
  max-width: 860px;
  display: flex;
  flex-direction: column;
}

.email-header-pane {
  background-color: #e8f0f5;
  border-top:    2px solid #4a6878;
  border-left:   2px solid #4a6878;
  border-bottom: 2px solid #dde9f2;
  border-right:  2px solid #dde9f2;
  margin: 4px;
}

.header-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.header-table td {
  padding: 3px 8px;
  border-bottom: 1px solid #c4d4dc;
}

.header-table tr:last-child td {
  border-bottom: none;
}

.header-label {
  font-weight: bold;
  width: 100px;
  color: #1e3848;
  white-space: nowrap;
}

.classification {
  display: inline-block;
  background-color: #1e3848;
  color: #fff;
  padding: 1px 6px;
  font-size: 10px;
  letter-spacing: 1px;
  font-weight: bold;
}

.email-body-pane {
  background-color: #fff;
  border-top:    2px solid #4a6878;
  border-left:   2px solid #4a6878;
  border-bottom: 2px solid #dde9f2;
  border-right:  2px solid #dde9f2;
  padding: 14px 18px;
  margin: 4px;
  flex: 1;
  overflow-y: auto;
  min-height: 200px;
  line-height: 1.55;
  font-size: 12px;
}

/* Markdown content styles inside email body */
.email-body-pane h1,
.email-body-pane h2,
.email-body-pane h3 {
  font-size: 12px;
  font-weight: bold;
  margin: 8px 0 4px;
  color: #1e3848;
}

.email-body-pane h1 { font-size: 13px; }

.email-body-pane p {
  margin-bottom: 8px;
}

.email-body-pane strong {
  font-weight: bold;
}

.email-body-pane em {
  font-style: italic;
}

.email-body-pane hr {
  border: none;
  border-top: 1px solid #c4d4dc;
  margin: 10px 0;
}

.email-body-pane ul,
.email-body-pane ol {
  margin: 6px 0 8px 20px;
}

.email-body-pane li {
  margin-bottom: 2px;
}

.email-body-pane code {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  background-color: #f0f4f6;
  padding: 1px 3px;
  border: 1px solid #c4d4dc;
}

.email-body-pane pre {
  background-color: #f0f4f6;
  border: 1px solid #c4d4dc;
  padding: 8px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  overflow-x: auto;
  margin: 8px 0;
}

.email-body-pane blockquote {
  border-left: 3px solid #7a9aaa;
  margin: 6px 0 6px 12px;
  padding-left: 10px;
  color: #4a6878;
}

.email-body-pane table {
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 11px;
}

.email-body-pane table th,
.email-body-pane table td {
  border: 1px solid #c4d4dc;
  padding: 3px 8px;
}

.email-body-pane table th {
  background-color: #c4d4dc;
  font-weight: bold;
}

/* ═══════════════════════════════════════════════════════════
   404 PAGE
═══════════════════════════════════════════════════════════ */

body.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #7a9db5;
}

.error-window {
  width: 360px;
}

.error-body {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.error-icon {
  font-size: 32px;
}

.error-code {
  font-size: 28px;
  font-weight: bold;
  color: #1e3848;
  letter-spacing: 2px;
}

.error-msg {
  font-size: 11px;
  color: #2a4858;
  line-height: 1.5;
}
