/* ═══════════════════════════════════════════════════════════════════
   RAI AGENCY - CYBERPUNK MAILBOX CONTROL ROOM THEME (#336699 ALIGNED)
   Matches index.html glassmorphism aesthetic, Exo 2/Orbitron fonts,
   glowing holographic accents, and Outlook Enterprise features.
   ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Exo+2:ital,wght@0,300..900;1,300..900&family=Orbitron:wght@400..900&family=Share+Tech+Mono&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-dark: #060a18;
  --bg-card: rgba(10, 16, 34, 0.85);
  --border-holo: rgba(51, 102, 153, 0.45);
  --border-holo-glow: rgba(51, 102, 153, 0.8);
  --accent-blue: #336699;
  --accent-cyan: #4b8cd4;
  --accent-purple: #8b5cf6;
  --accent-gold: #ffd700;
  --text-main: #f8fafc;
  --text-dim: #94a3b8;
  --font-exo: 'Exo 2', sans-serif;
  --font-sans: 'Exo 2', 'Inter', sans-serif;
  --font-mono: 'Share Tech Mono', monospace;
  --font-orbitron: 'Orbitron', sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-exo);
  overflow: hidden;
}

body {
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(51, 102, 153, 0.2) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(75, 140, 212, 0.1) 0%, transparent 45%),
    linear-gradient(rgba(51, 102, 153, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(51, 102, 153, 0.04) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 30px 30px, 30px 30px;
  background-attachment: fixed;
}

/* Header Navbar */
header.holo-header {
  height: 64px;
  background: rgba(6, 10, 24, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-holo);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 30;
}

/* Glassmorphism Panel Base */
.holo-glass-panel {
  background: var(--bg-card) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid var(--border-holo) !important;
  border-radius: 14px !important;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4), inset 0 0 20px rgba(51, 102, 153, 0.1) !important;
  transition: border-color 0.25s ease, box-shadow 0.25s ease !important;
}

.holo-glass-panel:hover {
  border-color: var(--border-holo-glow) !important;
  box-shadow: 0 8px 36px 0 rgba(51, 102, 153, 0.25), inset 0 0 25px rgba(51, 102, 153, 0.15) !important;
}

/* Header Badge */
.holo-header-badge {
  font-family: var(--font-orbitron);
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  color: #a5b4fc;
  background: rgba(51, 102, 153, 0.3);
  border: 1px solid var(--border-holo);
  padding: 4px 12px;
  border-radius: 50px;
  box-shadow: 0 0 15px rgba(51, 102, 153, 0.4);
}

/* Layout Wrapper & Panels */
#mailbox-layout-wrapper {
  height: calc(100vh - 64px);
  display: flex;
  gap: 16px;
  padding: 16px;
  width: 100%;
  overflow: hidden;
}

#sidebar-pane {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}

#message-list-pane {
  width: 380px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

#reading-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* View Layout Modes */
body.layout-horizontal-split #mailbox-layout-wrapper {
  flex-direction: column;
}

body.layout-horizontal-split #message-list-pane {
  width: 100%;
  height: 280px;
  flex-shrink: 0;
}

body.layout-horizontal-split #reading-pane {
  flex: 1;
  width: 100%;
}

body.layout-full-reader #message-list-pane,
body.layout-full-reader #sidebar-pane {
  display: none !important;
}

/* Folder Navigation Items */
.holo-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  margin-bottom: 4px;
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  background: transparent;
}

.holo-nav-item:hover {
  color: #ffffff;
  background: rgba(51, 102, 153, 0.2);
  border-color: rgba(51, 102, 153, 0.4);
  transform: translateX(3px);
}

.holo-nav-item.active {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(51, 102, 153, 0.4) 0%, rgba(51, 102, 153, 0.15) 100%);
  border-color: var(--accent-blue);
  box-shadow: 0 0 20px rgba(51, 102, 153, 0.35);
}

.holo-unread-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(51, 102, 153, 0.35);
  color: #60a5fa;
  border: 1px solid var(--border-holo);
}

/* Message Cards */
.holo-msg-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(51, 102, 153, 0.3);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.holo-msg-card:hover {
  background: rgba(15, 23, 42, 0.95);
  border-color: var(--accent-blue);
  box-shadow: 0 4px 20px rgba(51, 102, 153, 0.3);
  transform: translateY(-2px);
}

.holo-msg-card.selected {
  background: rgba(15, 23, 42, 0.98);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 25px rgba(75, 140, 212, 0.35), inset 0 0 15px rgba(75, 140, 212, 0.12);
}

.holo-msg-card.unread::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 4px;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
}

.holo-msg-card.msg-pinned-card {
  border-left: 4px solid var(--accent-gold) !important;
  background: rgba(255, 215, 0, 0.05) !important;
}

/* Subscriber Email Styling */
.subscriber-email-visual {
  color: var(--accent-blue) !important;
  text-shadow: 0 0 10px rgba(51, 102, 153, 0.7) !important;
  font-weight: 700 !important;
  font-family: var(--font-mono) !important;
}

/* VIP Gold Badge */
.vip-badge-gold {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.25) 0%, rgba(255, 165, 0, 0.35) 100%);
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
  font-family: var(--font-orbitron);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
}

/* Speech Balloons */
.chat-balloon-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

.chat-balloon {
  max-width: 82%;
  padding: 14px 18px;
  border-radius: 16px;
  position: relative;
  line-height: 1.6;
  font-size: 0.9rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.chat-balloon.client {
  align-self: flex-start;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(51, 102, 153, 0.4);
  border-top-left-radius: 4px;
  color: #cbd5e1;
}

.chat-balloon.assistant {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(51, 102, 153, 0.4) 0%, rgba(30, 58, 138, 0.5) 100%);
  border: 1px solid var(--accent-cyan);
  border-top-right-radius: 4px;
  color: #f8fafc;
  box-shadow: 0 0 20px rgba(75, 140, 212, 0.25);
}

/* Phishing Warning Card */
.phishing-warning-card {
  background: rgba(225, 29, 72, 0.15);
  border: 1px solid rgba(225, 29, 72, 0.5);
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: 0 0 20px rgba(225, 29, 72, 0.2);
}

/* Buttons & Quick Reply */
.btn-rai-action {
  background: linear-gradient(135deg, var(--accent-blue) 0%, #1e40af 100%);
  color: #ffffff;
  border: 1px solid var(--accent-cyan);
  border-radius: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 0 20px rgba(75, 140, 212, 0.3);
  transition: all 0.25s ease;
  cursor: pointer;
}

.btn-rai-action:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 0 30px rgba(75, 140, 212, 0.5);
  transform: translateY(-1px);
}

.quick-reply-textarea {
  width: 100%;
  background: rgba(2, 4, 10, 0.8);
  border: 1px solid rgba(51, 102, 153, 0.4);
  border-radius: 10px;
  padding: 12px 16px;
  color: #f8fafc;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  resize: vertical;
  min-height: 80px;
  transition: all 0.25s ease;
}

.quick-reply-textarea:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(75, 140, 212, 0.3);
}

/* Batch Action Floating Toolbar */
.batch-action-toolbar {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 16, 34, 0.96);
  border: 1px solid rgba(75, 140, 212, 0.5);
  border-radius: 14px;
  padding: 10px 24px;
  box-shadow: 0 0 35px rgba(75, 140, 212, 0.35);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  backdrop-filter: blur(16px);
}

/* CRT Scanline Overlay */
.crt-overlay-active::after {
  content: " ";
  display: block;
  position: fixed;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
  z-index: 999;
  background-size: 100% 3px, 6px 100%;
  pointer-events: none;
  animation: crt-flicker 0.15s infinite;
}

@keyframes crt-flicker {
  0% { opacity: 0.97; }
  50% { opacity: 1; }
  100% { opacity: 0.98; }
}

.holo-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 12px var(--accent-cyan);
  animation: holo-pulse 2s infinite ease-in-out;
}

@keyframes holo-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
