/* ============================
   HCJINATOR — GE Charter
   ============================ */

/* --- Reset & Variables --- */
:root {
  --ge-blue: #5a6d9d;
  --ge-blue-dark: #3d4f75;
  --ge-rose: #c786b9;
  --ge-gold: #e8d06f;
  --ge-beige: #f0e6d6;
  --ge-black: #000000;
  --ge-white: #ffffff;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border-color: #e5e7eb;
  --bg-hover: #f5f5f5;
  --bg-active: #eef1f7;
  --success-color: #10b981;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
}

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

body {
  font-family: Tahoma, Geneva, sans-serif;
  color: var(--text-primary);
  line-height: 1.5;
}

a { color: var(--ge-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* --- Nerd Fonts --- */
@font-face {
  font-family: 'Symbols Nerd Font';
  src: url('../assets/fonts/SymbolsNerdFontMono-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

.nf {
  font-family: 'Symbols Nerd Font', monospace;
  font-style: normal;
  font-weight: normal;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- LOGIN PAGE --- */
.login-page {
  background: var(--ge-beige);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-container {
  width: 100%;
  max-width: 420px;
  padding: 20px;
}

.login-card {
  background: var(--ge-white);
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  padding: 36px 32px 28px;
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo {
  width: 180px;
  margin-bottom: 12px;
}

.login-header h1 {
  font-size: 16px;
  color: var(--ge-blue);
  font-weight: bold;
  margin-bottom: 2px;
}

.login-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.security-message {
  background: var(--bg-active);
  border-left: 3px solid var(--ge-blue);
  padding: 8px 12px;
  font-size: 11px;
  color: var(--ge-blue);
  margin-bottom: 20px;
  border-radius: 0 4px 4px 0;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"] {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: Tahoma, Geneva, sans-serif;
  background: #fafafa;
  color: var(--text-primary);
}

.form-group input:focus {
  outline: none;
  border-color: var(--ge-blue);
  background: var(--ge-white);
}

.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 36px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 16px;
  user-select: none;
}

.login-button {
  width: 100%;
  background: var(--ge-blue);
  color: var(--ge-white);
  border: none;
  padding: 11px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: bold;
  font-family: Tahoma, Geneva, sans-serif;
  cursor: pointer;
  margin-top: 4px;
}

.login-button:hover {
  background: var(--ge-blue-dark);
}

.error-message {
  font-size: 12px;
  margin-bottom: 8px;
  min-height: 18px;
}

.login-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.6;
}

.login-footer p {
  margin-bottom: 8px;
}

.login-footer a {
  color: var(--ge-rose);
}

.login-support {
  font-size: 10px;
}

.login-copyright {
  font-size: 10px;
  color: #bbb;
}

/* Motus feedback */
#passwordFeedback {
  margin-top: 6px;
  min-height: 22px;
  font-family: monospace;
  font-size: 13px;
}

#passwordFeedback .correct-word {
  background: var(--success-color);
  color: var(--ge-white);
  padding: 2px 5px;
  border-radius: 3px;
  display: inline-block;
  margin: 1px;
}

#passwordFeedback .incorrect-word {
  background: var(--error-color);
  color: var(--ge-white);
  padding: 2px 5px;
  border-radius: 3px;
  display: inline-block;
  margin: 1px;
}

#passwordFeedback .out-word,
#passwordFeedback .missing-word {
  background: #aaa;
  color: var(--ge-white);
  padding: 2px 5px;
  border-radius: 3px;
  display: inline-block;
  margin: 1px;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}
.shake { animation: shake 0.3s ease-in-out; }


/* ==============================
   WEBMAIL PAGE
   ============================== */

.webmail-page {
  background: #e8e8e8;
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Header bar --- */
.wm-header {
  height: 48px;
  background: var(--ge-blue);
  display: flex;
  align-items: center;
  padding: 0 16px;
  color: var(--ge-white);
  gap: 16px;
  flex-shrink: 0;
}

.wm-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wm-header-logo {
  height: 28px;
  filter: brightness(0) invert(0.95);
}

.wm-header-title {
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 0.3px;
}

.wm-header-search {
  flex: 1;
  max-width: 480px;
  margin: 0 24px;
}

.wm-header-search input {
  width: 100%;
  padding: 6px 12px;
  border: none;
  border-radius: 3px;
  font-size: 12px;
  font-family: Tahoma, Geneva, sans-serif;
  background: rgba(255, 255, 255, 0.15);
  color: var(--ge-white);
}

.wm-header-search input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.wm-header-search input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.25);
}

.wm-header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}

.wm-user-info {
  text-align: right;
  line-height: 1.3;
}

.wm-user-name {
  display: block;
  font-weight: bold;
  font-size: 12px;
}

.wm-user-role {
  display: block;
  font-size: 10px;
  opacity: 0.8;
}

.wm-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
  color: var(--ge-white);
  background: var(--ge-rose);
  overflow: hidden;
}

.wm-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wm-logout-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--ge-white);
  padding: 4px 12px;
  border-radius: 3px;
  font-size: 11px;
  font-family: Tahoma, Geneva, sans-serif;
  cursor: pointer;
}

.wm-logout-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* --- 3-column layout --- */
.wm-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* --- Sidebar --- */
.wm-sidebar {
  width: 200px;
  background: var(--ge-white);
  border-right: 1px solid var(--border-color);
  padding: 12px 0;
  flex-shrink: 0;
  overflow-y: auto;
}

.wm-new-mail-btn {
  display: block;
  margin: 0 12px 16px;
  background: var(--ge-blue);
  color: var(--ge-white);
  border: none;
  padding: 8px 16px;
  border-radius: 3px;
  font-size: 12px;
  font-family: Tahoma, Geneva, sans-serif;
  font-weight: bold;
  cursor: pointer;
  width: calc(100% - 24px);
  text-align: left;
}

.wm-new-mail-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.wm-folder {
  display: flex;
  align-items: center;
  padding: 7px 16px;
  font-size: 12px;
  color: var(--text-primary);
  cursor: pointer;
  gap: 8px;
}

.wm-folder:hover {
  background: var(--bg-hover);
}

.wm-folder.active {
  background: var(--bg-active);
  color: var(--ge-blue);
  font-weight: bold;
}

.wm-folder-icon {
  width: 18px;
  text-align: center;
  font-size: 13px;
}

.wm-folder-name {
  flex: 1;
}

.wm-folder-badge {
  background: var(--ge-blue);
  color: var(--ge-white);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: bold;
}

.wm-folder-badge:empty {
  display: none;
}

/* --- Email list --- */
.wm-email-list {
  width: 340px;
  background: var(--ge-white);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.wm-list-header {
  padding: 10px 14px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.wm-list-title {
  font-size: 14px;
  font-weight: bold;
  color: var(--text-primary);
}

.wm-list-filter {
  font-size: 11px;
  color: var(--ge-blue);
  cursor: pointer;
}

.wm-list-items {
  flex: 1;
  overflow-y: auto;
}

.wm-date-group {
  font-size: 10px;
  color: var(--text-muted);
  padding: 8px 14px 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #fafafa;
  border-bottom: 1px solid #eee;
}

.wm-email-item {
  display: flex;
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  gap: 10px;
  align-items: flex-start;
}

.wm-email-item:hover {
  background: #f8f8f8;
}

.wm-email-item.active {
  background: var(--bg-active);
  border-left: 3px solid var(--ge-blue);
  padding-left: 11px;
}

.wm-email-item.unread .wm-email-sender {
  font-weight: bold;
}

.wm-email-item.unread .wm-email-subject {
  font-weight: bold;
  color: #111;
}

.wm-sender-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  color: var(--ge-white);
  overflow: hidden;
}

.wm-sender-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.wm-email-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2px;
}

.wm-email-sender {
  font-size: 12px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wm-email-date {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 8px;
}

.wm-email-subject {
  font-size: 12px;
  color: #444;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.wm-email-preview {
  font-size: 11px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wm-email-attachment {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* --- Preview pane --- */
.wm-preview {
  flex: 1;
  background: var(--ge-white);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.wm-preview-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
}

.wm-preview-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid #eee;
}

.wm-preview-subject {
  font-size: 18px;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.wm-preview-meta {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.wm-preview-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: bold;
  color: var(--ge-white);
  overflow: hidden;
}

.wm-preview-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wm-preview-from {
  font-size: 13px;
  font-weight: bold;
  color: var(--text-primary);
}

.wm-preview-from .email-addr {
  font-weight: normal;
  color: #888;
}

.wm-preview-to {
  font-size: 11px;
  color: #888;
  margin-top: 1px;
}

.wm-preview-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
  flex-shrink: 0;
}

.wm-preview-actions {
  display: flex;
  gap: 8px;
  padding: 8px 24px;
  border-bottom: 1px solid #eee;
}

.wm-preview-actions button {
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  padding: 5px 14px;
  border-radius: 3px;
  font-size: 11px;
  font-family: Tahoma, Geneva, sans-serif;
  color: var(--text-secondary);
  cursor: pointer;
}

.wm-preview-actions button:hover {
  background: var(--border-color);
}

.wm-preview-body {
  padding: 20px 24px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
  flex: 1;
  overflow-wrap: anywhere;
}

.wm-preview-body p { margin-bottom: 12px; }
.wm-preview-body ul, .wm-preview-body ol { margin: 8px 0 12px 24px; }
.wm-preview-body img { max-width: 100%; height: auto; }
.wm-preview-body hr { border: none; border-top: 1px solid #eee; margin: 16px 0; }

.wm-preview-attachments {
  padding: 12px 24px;
  border-top: 1px solid #eee;
}

.wm-preview-attachments-title {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: bold;
}

.wm-preview-attachment {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: #fafafa;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  margin-right: 8px;
  margin-bottom: 4px;
}

.wm-preview-attachment:hover {
  background: var(--bg-hover);
}

.wm-preview-attachment .file-icon {
  font-size: 18px;
}

.wm-preview-attachment .file-name {
  font-weight: bold;
  color: var(--ge-blue);
}

/* --- Footer --- */
.wm-footer {
  height: 28px;
  background: #f5f5f5;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.wm-footer a {
  color: var(--ge-rose);
}

/* --- Download notifications --- */
.download-notification {
  position: fixed;
  bottom: 20px;
  right: 100px;
  padding: 12px 20px;
  border-radius: 4px;
  font-size: 12px;
  font-family: Tahoma, Geneva, sans-serif;
  color: var(--ge-white);
  background: var(--ge-blue);
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.download-notification.success { background: var(--success-color); }
.download-notification.error { background: var(--error-color); }

/* --- Empty folder state --- */
.wm-empty-folder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted);
  font-size: 13px;
}

.wm-empty-folder .empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
  opacity: 0.5;
}
