@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg-dark: #090d16;
  --bg-card: rgba(17, 24, 39, 0.7);
  --border-color: rgba(255, 255, 255, 0.08);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --brand-cyan: #00d2c4;
  --brand-indigo: #6366f1;
  --brand-purple: #a855f7;
  --red-alert: #ef4444;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', sans-serif;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* Background Gradients */
body::before {
  content: '';
  position: absolute;
  top: -10%;
  left: -10%;
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

body::after {
  content: '';
  position: absolute;
  bottom: -10%;
  right: -10%;
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, rgba(0, 210, 196, 0.1) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.text-center {
  text-align: center;
}

/* Glassmorphism Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  width: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
  box-shadow: 0 20px 50px rgba(99, 102, 241, 0.1);
}

/* Portal Layout */
.portal-container {
  max-width: 900px;
  width: 90%;
  padding: 40px;
}

.header-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.logo-icon {
  width: 38px;
  height: 38px;
}

.logo-text {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--brand-cyan), var(--brand-indigo));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.portal-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

/* Grid Layout for Links */
.links-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

@media (max-width: 640px) {
  .links-grid {
    grid-template-columns: 1fr;
  }
  .portal-container {
    padding: 24px;
  }
}

/* Portal Link Cards */
.link-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.link-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 210, 196, 0.05), rgba(99, 102, 241, 0.05));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.link-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.05);
}

.link-card:hover::before {
  opacity: 1;
}

.link-card * {
  z-index: 1;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-icon {
  width: 24px;
  height: 24px;
  stroke: var(--brand-cyan);
}

.arrow-icon {
  width: 18px;
  height: 18px;
  stroke: var(--text-secondary);
  transition: transform 0.3s ease, stroke 0.3s ease;
}

.link-card:hover .arrow-icon {
  transform: translateX(4px);
  stroke: var(--brand-cyan);
}

.card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* User Widget */
.user-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
}

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

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--brand-cyan);
}

.user-name {
  font-size: 14px;
  font-weight: 500;
}

.user-email {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Buttons */
.btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-cyan), var(--brand-indigo));
  color: var(--bg-dark);
  font-weight: 600;
}

.btn-primary:hover {
  transform: scale(1.02);
  filter: brightness(1.1);
}

.btn-secondary {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-secondary);
}

/* Mail Inbox Side Drawer */
.inbox-drawer {
  position: fixed;
  top: 0;
  right: -520px; /* Hidden by default */
  width: 500px;
  max-width: 100vw;
  height: 100vh;
  background: rgba(9, 13, 22, 0.95);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-left: 1px solid var(--border-color);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding: 30px;
}

.inbox-drawer.open {
  right: 0;
}

.inbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
}

.inbox-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 20px;
  padding: 4px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.inbox-close-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.inbox-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-tab {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-tab:hover {
  background: rgba(255, 255, 255, 0.05);
}

.filter-tab.active {
  background: var(--brand-indigo);
  color: #fff;
  border-color: var(--brand-indigo);
}

.search-box {
  width: 100%;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  margin-bottom: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.search-box:focus {
  border-color: var(--brand-cyan);
}

.email-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.email-card {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.email-card:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(99, 102, 241, 0.3);
}

.email-card-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 11px;
  color: var(--text-secondary);
}

.email-subject {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.email-from {
  font-size: 12px;
  font-weight: 500;
  color: var(--brand-cyan);
  margin-bottom: 6px;
}

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

/* Modal Overlay for Drawer */
.inbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  display: none;
}

.inbox-overlay.open {
  display: block;
}

/* Expanded Email Detail */
.email-detail-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}

.back-to-list-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-cyan);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  align-self: flex-start;
}

.email-detail-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
}

.email-detail-meta {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.email-detail-body {
  flex: 1;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  white-space: pre-wrap;
  text-align: left;
}

.attachment-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 210, 196, 0.1);
  color: var(--brand-cyan);
  border: 1px solid rgba(0, 210, 196, 0.2);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  margin-top: 8px;
}

/* Mailbox List Styles */
.mailbox-cards-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  flex: 1;
}

.mailbox-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
}

.mailbox-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
}

.mailbox-avatar-container {
  flex-shrink: 0;
}

.mailbox-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.mailbox-details {
  flex: 1;
  min-width: 0; /* Prevents overflow */
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mailbox-address-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.mailbox-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mailbox-badge {
  background: rgba(0, 210, 196, 0.15);
  color: var(--brand-cyan);
  border: 1px solid rgba(0, 210, 196, 0.3);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

.mailbox-preview-subject {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mailbox-preview-date {
  font-size: 10px;
  color: rgba(148, 163, 184, 0.6);
  margin-top: 2px;
}

.all-mailboxes-card {
  border-color: rgba(99, 102, 241, 0.2);
}

.all-mailboxes-card:hover {
  border-color: var(--brand-indigo);
}

.back-to-mailboxes-btn:hover {
  filter: brightness(1.2);
  text-decoration: underline;
}

