/* ================================================
   TEMPMAIL STYLE - AkbarStore Mail
   Dark Glassmorphism Theme
   ================================================ */

/* Import Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* Reset & Base */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  color: #e2e8f0;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

/* ================================================
   ANIMATED BACKGROUND
   ================================================ */
.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.floating-shapes {
  position: relative;
  width: 100%;
  height: 100%;
}

.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
  filter: blur(80px);
}

.shape-1 {
  width: 600px;
  height: 600px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  top: -200px;
  right: -200px;
  animation: floatShape1 20s ease-in-out infinite;
}

.shape-2 {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, #f093fb, #f5576c);
  bottom: -100px;
  left: -100px;
  animation: floatShape2 25s ease-in-out infinite;
}

.shape-3 {
  width: 350px;
  height: 350px;
  background: linear-gradient(135deg, #4facfe, #00f2fe);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: floatShape3 18s ease-in-out infinite;
}

@keyframes floatShape1 {
  0%, 100% { transform: translateY(0) translateX(0) rotate(0deg); }
  33% { transform: translateY(-40px) translateX(30px) rotate(120deg); }
  66% { transform: translateY(20px) translateX(-20px) rotate(240deg); }
}

@keyframes floatShape2 {
  0%, 100% { transform: translateY(0) translateX(0) rotate(0deg); }
  33% { transform: translateY(30px) translateX(-40px) rotate(-120deg); }
  66% { transform: translateY(-20px) translateX(30px) rotate(-240deg); }
}

@keyframes floatShape3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.2); }
}

/* ================================================
   INDEX / LANDING PAGE
   ================================================ */
body.email-page {
  background-image: url('https://wallpapers.com/images/featured/anime-scenery-ahd1eqpvwq8aoofp.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

body.email-page::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(14, 17, 26, 0.15);
  pointer-events: none;
  z-index: 0;
}

.main-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.glass-card {
  background: rgba(24, 28, 44, 0.82);
  backdrop-filter: blur(32px) saturate(1.2);
  -webkit-backdrop-filter: blur(32px) saturate(1.2);
  border: 1.5px solid rgba(255,255,255,0.13);
  border-radius: 32px;
  width: 100%;
  max-width: 540px;
  overflow: hidden;
  box-shadow: 0 12px 48px 0 rgba(80, 80, 180, 0.18), 0 2px 8px 0 rgba(0,0,0,0.10);
  animation: fadeInUp 0.7s cubic-bezier(.4,2,.3,1);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-header {
  text-align: center;
  padding: 40px 40px 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.logo-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.logo-icon svg {
  color: white;
}

  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, #818cf8 10%, #a5b4fc 50%, #f472b6 90%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  filter: drop-shadow(0 2px 12px rgba(129,140,248,0.12));
}

.main-subtitle {
  color: #94a3b8;
  font-size: 0.95rem;
  font-weight: 400;
}

/* Features Box */
.features-box {
  margin: 0 30px;
  padding: 20px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 16px;
  margin-top: 20px;
}

.features-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.shield-icon {
  display: flex;
  align-items: center;
}

.features-title {
  color: #10b981;
  font-weight: 700;
  font-size: 0.95rem;
}

.features-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.features-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.check-icon {
  color: #10b981;
  font-weight: 700;
  font-size: 0.9rem;
}

/* Email Form */
.email-form-section {
  padding: 30px;
}

.input-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #e2e8f0;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.label-icon {
  font-size: 1.1rem;
}

.email-input-container {
  margin-bottom: 20px;
}

.email-input-simple {
  position: relative;
}

.input-field-wrapper {
  position: relative;
}

.input-field-wrapper.full-width {
  width: 100%;
}

.email-field {
  width: 100%;
  padding: 16px 20px;
  background: rgba(30, 41, 59, 0.8);
  border: 2px solid rgba(100, 116, 139, 0.3);
  border-radius: 14px;
  color: #f1f5f9;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s ease;
  outline: none;
}

.email-field::placeholder {
  color: #64748b;
}

.email-field:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
  background: rgba(30, 41, 59, 0.95);
}

/* Action Buttons */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 18px 28px;
  border-radius: 18px;
  font-size: 1.08rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(129,140,248,0.10);
  transition: all 0.22s cubic-bezier(.4,2,.3,1);
  position: relative;
  overflow: hidden;
}

.btn-modern:active {
  transform: scale(0.98);
  filter: brightness(0.97);
}

.btn-modern::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  background: rgba(129,140,248,0.15);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s cubic-bezier(.4,2,.3,1), height 0.4s cubic-bezier(.4,2,.3,1);
  z-index: 0;
}
.btn-modern:active::after {
  width: 180%;
  height: 180%;
}
/* Badge & Status */
.badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
  background: linear-gradient(90deg, #818cf8 10%, #a5b4fc 90%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(129,140,248,0.10);
  letter-spacing: 0.01em;
  margin-left: 8px;
  vertical-align: middle;
  transition: filter 0.2s;
}
.badge.permanent {
  background: linear-gradient(90deg, #10b981 10%, #22d3ee 90%);
}
.badge.copy {
  background: linear-gradient(90deg, #f472b6 10%, #818cf8 90%);
  cursor: pointer;
}
.badge.copy:hover {
  filter: brightness(1.15) drop-shadow(0 2px 8px #818cf8);
}
/* Toast Notification */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30,41,59,0.98);
  color: #fff;
  padding: 18px 32px;
  border-radius: 18px;
  font-size: 1.08rem;
  font-weight: 700;
  box-shadow: 0 8px 32px rgba(129,140,248,0.18);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  animation: toastIn 0.5s cubic-bezier(.4,2,.3,1) forwards;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(40px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
/* Shimmer Loading */
.shimmer {
  background: linear-gradient(90deg, #23263a 25%, #2d3250 50%, #23263a 75%);
  background-size: 200% 100%;
  animation: shimmerMove 1.2s infinite linear;
}
@keyframes shimmerMove {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
}

.btn-gradient {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.btn-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(102, 126, 234, 0.4);
}

.btn-gradient:active {
  transform: translateY(0);
}

.btn-gradient:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Home Link */
.home-link-wrapper {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.home-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.3s;
}

.home-link:hover {
  color: #667eea;
}

/* Page Footer */
.page-footer {
  text-align: center;
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
}

/* ================================================
   INBOX PAGE
   ================================================ */
body.inbox-page {
  background-image: url('https://wallpapers.com/images/featured/anime-scenery-ahd1eqpvwq8aoofp.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

body.inbox-page::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(14, 17, 26, 0.15);
  pointer-events: none;
  z-index: 0;
}

.inbox-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 30px 20px;
  display: flex;
  justify-content: center;
}

.inbox-container-modern {
  width: 100%;
  max-width: 900px;
  animation: fadeInUp 0.6s ease;
}

/* Inbox Header */
.inbox-header-modern {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 28px 32px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.inbox-title-section {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.inbox-icon-wrapper {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
  color: white;
}

.inbox-title-text h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #f1f5f9;
  margin-bottom: 8px;
}

.inbox-email-display {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.email-address-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.email-badge {
  background: rgba(102, 126, 234, 0.15);
  border: 1px solid rgba(102, 126, 234, 0.3);
  color: #93c5fd;
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.btn-copy-email {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-copy-email:hover {
  background: rgba(102, 126, 234, 0.2);
  border-color: rgba(102, 126, 234, 0.4);
  color: #93c5fd;
}

.btn-copy-email.copied {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.copy-text {
  font-size: 0.8rem;
}

.permanent-badge-small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.15));
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  color: #6ee7b7;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Inbox Actions */
.inbox-actions-modern {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-action:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #f1f5f9;
  transform: translateY(-1px);
}

.btn-test-sound {
  position: relative;
}

.btn-test-sound.sound-enabled {
  border-color: rgba(16, 185, 129, 0.3);
}

.sound-status {
  font-size: 0.9rem;
}

.btn-refresh svg {
  transition: transform 0.5s ease;
}

.btn-back, .btn-home {
  text-decoration: none;
}

/* Inbox Content */
.inbox-content {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  min-height: 400px;
  overflow: hidden;
}

/* Loading */
.loading-modern {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px 20px;
  color: #94a3b8;
  font-size: 0.95rem;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(102, 126, 234, 0.2);
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state-modern {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 30px;
  text-align: center;
}

.empty-icon-wrapper {
  margin-bottom: 24px;
  opacity: 0.6;
}

.empty-state-modern h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 8px;
}

.empty-state-modern p {
  color: #94a3b8;
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.tips-box {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: 14px;
  padding: 18px 22px;
  max-width: 420px;
  text-align: left;
}

.tips-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.tips-content {
  font-size: 0.85rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.tips-content strong {
  color: #93c5fd;
}

/* Email List */
.email-list-modern {
  padding: 8px;
}

.email-item-modern {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  margin: 4px 0;
  border-radius: 14px;
  transition: all 0.2s ease;
  cursor: pointer;
  animation: fadeInUp 0.4s ease both;
}

.email-item-modern:hover {
  background: rgba(255, 255, 255, 0.06);
}

.email-item-modern.unread {
  background: rgba(102, 126, 234, 0.08);
  border-left: 3px solid #667eea;
}

.email-item-modern.unread:hover {
  background: rgba(102, 126, 234, 0.12);
}

.email-avatar {
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  text-transform: uppercase;
}

.email-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.email-sender-modern {
  font-weight: 600;
  font-size: 0.95rem;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.email-subject-modern {
  font-size: 0.85rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-subject-modern .attachment-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 6px;
  margin-left: 6px;
  font-weight: 600;
}

.email-meta-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.email-time-modern {
  font-size: 0.75rem;
  color: #64748b;
  white-space: nowrap;
}

.email-status-modern {
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-new {
  background: rgba(102, 126, 234, 0.2);
  color: #93c5fd;
}

.status-read {
  background: rgba(100, 116, 139, 0.15);
  color: #64748b;
}

/* ================================================
   DETAIL PAGE
   ================================================ */
body.detail-page {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  background-attachment: fixed;
  position: relative;
  overflow-x: hidden;
}

body.detail-page::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
  animation: rotate 30s linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

body.detail-page::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(139, 92, 246, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(59, 130, 246, 0.15) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

.detail-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 30px 20px;
  display: flex;
  justify-content: center;
}

.detail-container-modern {
  width: 100%;
  max-width: 900px;
  animation: fadeInUp 0.6s ease;
}

/* Detail Header */
.detail-header-modern {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 24px 32px;
  margin-bottom: 20px;
}

.detail-nav-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.9rem;
  transition: color 0.3s;
  text-decoration: none;
}

.btn-back:hover {
  color: #667eea;
}

.btn-delete {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 10px;
  color: #f87171;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-delete:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-delete:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.detail-title-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.detail-icon-wrapper {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
  color: white;
}

.detail-title-text h1 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #f1f5f9;
  margin-bottom: 6px;
}

.email-badge-small {
  background: rgba(102, 126, 234, 0.15);
  border: 1px solid rgba(102, 126, 234, 0.3);
  color: #93c5fd;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* Detail Content */
.detail-content-modern {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  overflow: hidden;
}

.email-detail-card {
  padding: 0;
}

/* Email Header Detail */
.email-header-detail {
  padding: 30px 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.email-subject-detail h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 24px;
  line-height: 1.4;
}

.email-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.email-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.meta-label svg {
  color: #667eea;
}

.meta-value {
  color: #cbd5e1;
  font-size: 0.95rem;
  font-weight: 500;
  word-break: break-word;
}

/* Email Body Detail */
.email-body-detail {
  padding: 32px;
}

.email-content-wrapper-detail {
  border-radius: 12px;
  overflow: hidden;
}

.email-content-iframe-detail {
  width: 100%;
  min-height: 400px;
  border: none;
  border-radius: 12px;
  background: #1e293b;
}

.email-content-text-detail {
  color: #cbd5e1;
  font-size: 0.95rem;
  line-height: 1.7;
  padding: 24px;
  background: rgba(30, 41, 59, 0.5);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.email-content-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px 20px;
  color: #64748b;
  text-align: center;
}

.email-content-empty svg {
  opacity: 0.4;
}

.email-view-toggle {
  margin-top: 16px;
  text-align: center;
}

.btn-toggle-html {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-toggle-html:hover {
  background: rgba(102, 126, 234, 0.15);
  border-color: rgba(102, 126, 234, 0.3);
  color: #93c5fd;
}

/* Attachments */
.email-attachments-section {
  padding: 24px 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.attachments-header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #e2e8f0;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 16px;
}

.attachments-header svg {
  color: #667eea;
}

.attachments-grid-detail {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.attachment-item-detail {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  transition: background 0.2s;
}

.attachment-item-detail:hover {
  background: rgba(30, 41, 59, 0.8);
}

.attachment-icon {
  font-size: 1.4rem;
}

.attachment-info {
  flex: 1;
  min-width: 0;
}

.attachment-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachment-meta {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 2px;
}

.attachment-actions {
  display: flex;
  gap: 8px;
}

.btn-preview-attachment,
.btn-download-attachment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.3s;
}

.btn-preview-attachment {
  background: rgba(102, 126, 234, 0.15);
  color: #93c5fd;
}

.btn-preview-attachment:hover {
  background: rgba(102, 126, 234, 0.25);
}

.btn-download-attachment {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

.btn-download-attachment:hover {
  background: rgba(16, 185, 129, 0.25);
}

/* Image Preview Modal */
.image-preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-preview-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  cursor: pointer;
}

.image-preview-content {
  position: relative;
  z-index: 1;
  max-width: 90%;
  max-height: 90%;
  background: #1e293b;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.image-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  font-size: 0.9rem;
  font-weight: 600;
}

.btn-close-preview {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  transition: color 0.3s;
}

.btn-close-preview:hover {
  color: #f87171;
}

.image-preview-body {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-preview-body img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 8px;
}

/* Error Message */
.error-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 60px 30px;
  text-align: center;
  color: #94a3b8;
}

.error-message h3 {
  color: #f87171;
  font-size: 1.2rem;
}

.error-message .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s;
}

.error-message .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

/* Loading Spinner in Detail */
.email-detail-card .loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 60px 20px;
  color: #94a3b8;
}

.email-detail-card .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(102, 126, 234, 0.2);
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ================================================
   NOTIFICATION TOAST
   ================================================ */
.notification-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  padding: 14px 24px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10001;
  animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
  max-width: 90%;
}

.notification-toast.success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.notification-toast.error {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.notification-toast.info {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

@keyframes slideDown {
  to { transform: translateX(-50%) translateY(0); }
}

@keyframes slideUp {
  to { transform: translateX(-50%) translateY(-100px); opacity: 0; }
}

/* ================================================
   ANIMATIONS
   ================================================ */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.spin {
  animation: spin 1s linear infinite;
}

/* ================================================
   RESPONSIVE - Tablet, Mobile, iOS
   ================================================ */

/* iOS Safari fixes */
html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

input, button, select, textarea {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* --- Tablet (max 768px) --- */
@media (max-width: 768px) {
  /* INDEX PAGE */
  .main-container {
    padding: 24px 16px;
  }

  .glass-card {
    border-radius: 18px;
    max-width: 100%;
  }

  .card-header {
    padding: 28px 20px 22px;
  }

  .main-title {
    font-size: 1.5rem;
  }

  .main-subtitle {
    font-size: 0.88rem;
  }

  .logo-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
  }

  .features-box {
    margin: 16px 20px 0;
    padding: 16px;
  }

  .features-list {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .email-form-section {
    padding: 20px;
  }

  .email-field {
    padding: 14px 16px;
    font-size: 0.95rem;
  }

  .btn-modern {
    padding: 14px 20px;
    font-size: 0.95rem;
  }

  /* INBOX PAGE */
  .inbox-wrapper {
    padding: 16px 12px;
  }

  .inbox-header-modern {
    flex-direction: column;
    padding: 20px;
    gap: 16px;
    border-radius: 16px;
    margin-bottom: 14px;
  }

  .inbox-title-section {
    gap: 14px;
  }

  .inbox-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .inbox-icon-wrapper svg {
    width: 26px;
    height: 26px;
  }

  .inbox-title-text h1 {
    font-size: 1.35rem;
    margin-bottom: 6px;
  }

  .inbox-email-display {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .email-badge {
    font-size: 0.78rem;
    padding: 5px 10px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .inbox-actions-modern {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }

  .btn-action {
    padding: 8px 14px;
    font-size: 0.82rem;
    border-radius: 10px;
  }

  .inbox-content {
    border-radius: 16px;
    min-height: 300px;
  }

  .email-list-modern {
    padding: 6px;
  }

  .email-item-modern {
    padding: 14px 16px;
    gap: 12px;
    border-radius: 12px;
  }

  .email-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    font-size: 0.95rem;
    border-radius: 10px;
  }

  .email-sender-modern {
    font-size: 0.9rem;
  }

  .email-subject-modern {
    font-size: 0.82rem;
  }

  .empty-state-modern {
    padding: 40px 20px;
  }

  .empty-icon-wrapper svg {
    width: 60px;
    height: 60px;
  }

  .empty-state-modern h3 {
    font-size: 1.1rem;
  }

  .tips-box {
    padding: 14px 16px;
    max-width: 100%;
  }

  /* DETAIL PAGE */
  .detail-wrapper {
    padding: 16px 12px;
  }

  .detail-header-modern {
    padding: 18px 16px;
    border-radius: 16px;
    margin-bottom: 14px;
  }

  .detail-nav-section {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
  }

  .btn-back {
    font-size: 0.85rem;
  }

  .detail-title-section {
    gap: 12px;
  }

  .detail-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  .detail-icon-wrapper svg {
    width: 24px;
    height: 24px;
  }

  .detail-title-text h1 {
    font-size: 1.2rem;
    margin-bottom: 4px;
  }

  .email-badge-small {
    font-size: 0.75rem;
    padding: 3px 10px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
  }

  .detail-content-modern {
    border-radius: 16px;
  }

  .email-header-detail {
    padding: 20px 16px;
  }

  .email-subject-detail h2 {
    font-size: 1.1rem;
    margin-bottom: 18px;
  }

  .email-meta-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .meta-value {
    font-size: 0.88rem;
  }

  .email-body-detail {
    padding: 16px;
  }

  .email-content-iframe-detail {
    min-height: 300px;
  }

  .email-attachments-section {
    padding: 18px 16px;
  }

  .attachment-actions {
    flex-direction: column;
    gap: 4px;
  }

  .btn-preview-attachment,
  .btn-download-attachment {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  /* NOTIFICATION */
  .notification-toast {
    max-width: 92%;
    font-size: 0.88rem;
    padding: 12px 18px;
    border-radius: 12px;
  }
}

/* --- Mobile (max 480px) --- */
@media (max-width: 480px) {
  /* INDEX PAGE */
  .main-container {
    padding: 16px 10px;
    min-height: 100dvh;
  }

  .glass-card {
    border-radius: 16px;
  }

  .card-header {
    padding: 24px 16px 18px;
  }

  .logo-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
  }

  .logo-icon svg {
    width: 28px;
    height: 28px;
  }

  .main-title {
    font-size: 1.3rem;
  }

  .main-subtitle {
    font-size: 0.84rem;
  }

  .features-box {
    margin: 12px 14px 0;
    padding: 14px;
  }

  .features-title {
    font-size: 0.88rem;
  }

  .features-list li {
    font-size: 0.8rem;
  }

  .email-form-section {
    padding: 16px;
  }

  .input-label {
    font-size: 0.88rem;
  }

  .email-field {
    padding: 13px 14px;
    font-size: 16px; /* Prevents iOS zoom */
    border-radius: 12px;
  }

  .btn-modern {
    padding: 13px 18px;
    font-size: 0.92rem;
    border-radius: 12px;
  }

  .home-link-wrapper {
    margin-top: 14px;
    padding-top: 14px;
  }

  .page-footer {
    margin-top: 16px;
    font-size: 0.8rem;
  }

  /* INBOX PAGE */
  .inbox-wrapper {
    padding: 12px 8px;
  }

  .inbox-header-modern {
    padding: 16px;
    border-radius: 14px;
    margin-bottom: 10px;
    gap: 12px;
  }

  .inbox-title-section {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .inbox-icon-wrapper {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .inbox-icon-wrapper svg {
    width: 22px;
    height: 22px;
  }

  .inbox-title-text h1 {
    font-size: 1.15rem;
    margin-bottom: 4px;
  }

  .email-badge {
    font-size: 0.72rem;
    padding: 4px 8px;
    border-radius: 8px;
  }

  .btn-copy-email {
    padding: 4px 8px;
    font-size: 0.72rem;
  }

  .permanent-badge-small {
    padding: 3px 8px;
    font-size: 0.68rem;
  }

  .inbox-actions-modern {
    gap: 6px;
  }

  .btn-action {
    padding: 8px 10px;
    font-size: 0.78rem;
    border-radius: 8px;
  }

  .btn-action span:not(.sound-status) {
    display: none;
  }

  .inbox-content {
    border-radius: 14px;
    min-height: 250px;
  }

  .email-list-modern {
    padding: 4px;
  }

  .email-item-modern {
    padding: 12px;
    gap: 10px;
    border-radius: 10px;
    margin: 3px 0;
  }

  .email-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    font-size: 0.88rem;
    border-radius: 8px;
  }

  .email-info {
    min-width: 0;
  }

  .email-sender-modern {
    font-size: 0.84rem;
    margin-bottom: 2px;
  }

  .email-subject-modern {
    font-size: 0.78rem;
  }

  .email-meta-right {
    gap: 4px;
  }

  .email-time-modern {
    font-size: 0.68rem;
  }

  .email-status-modern {
    padding: 2px 8px;
    font-size: 0.65rem;
  }

  .loading-modern {
    padding: 40px 16px;
    font-size: 0.88rem;
  }

  .empty-state-modern {
    padding: 32px 16px;
  }

  .empty-icon-wrapper svg {
    width: 50px;
    height: 50px;
  }

  .empty-state-modern h3 {
    font-size: 1rem;
  }

  .empty-state-modern p {
    font-size: 0.88rem;
    margin-bottom: 16px;
  }

  .tips-box {
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
  }

  .tips-icon {
    font-size: 1.2rem;
  }

  .tips-content {
    font-size: 0.8rem;
  }

  /* DETAIL PAGE */
  .detail-wrapper {
    padding: 12px 8px;
  }

  .detail-header-modern {
    padding: 14px;
    border-radius: 14px;
    margin-bottom: 10px;
  }

  .detail-nav-section {
    margin-bottom: 14px;
    padding-bottom: 12px;
  }

  .btn-back {
    font-size: 0.82rem;
    gap: 6px;
  }

  .btn-back svg {
    width: 16px;
    height: 16px;
  }

  .btn-delete {
    padding: 6px 12px;
    font-size: 0.78rem;
    border-radius: 8px;
  }

  .btn-delete svg {
    width: 14px;
    height: 14px;
  }

  .detail-title-section {
    gap: 10px;
  }

  .detail-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .detail-icon-wrapper svg {
    width: 20px;
    height: 20px;
  }

  .detail-title-text h1 {
    font-size: 1.05rem;
  }

  .email-badge-small {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 6px;
  }

  .detail-content-modern {
    border-radius: 14px;
  }

  .email-header-detail {
    padding: 16px 14px;
  }

  .email-subject-detail h2 {
    font-size: 1rem;
    margin-bottom: 16px;
    line-height: 1.4;
  }

  .email-meta-grid {
    gap: 12px;
  }

  .meta-label {
    font-size: 0.72rem;
  }

  .meta-value {
    font-size: 0.82rem;
    word-break: break-all;
  }

  .email-body-detail {
    padding: 14px 12px;
  }

  .email-content-iframe-detail {
    min-height: 250px;
    border-radius: 10px;
  }

  .email-content-text-detail {
    padding: 16px;
    font-size: 0.88rem;
    border-radius: 10px;
  }

  .email-content-empty {
    padding: 40px 16px;
  }

  .btn-toggle-html {
    padding: 7px 14px;
    font-size: 0.8rem;
    border-radius: 8px;
  }

  .email-attachments-section {
    padding: 14px;
  }

  .attachments-header {
    font-size: 0.9rem;
    margin-bottom: 12px;
  }

  .attachment-item-detail {
    padding: 12px 14px;
    gap: 10px;
    border-radius: 10px;
  }

  .attachment-name {
    font-size: 0.82rem;
  }

  .attachment-meta {
    font-size: 0.7rem;
  }

  /* Error page */
  .error-message {
    padding: 40px 20px;
  }

  .error-message h3 {
    font-size: 1.05rem;
  }

  .error-message .btn-primary {
    padding: 10px 20px;
    font-size: 0.88rem;
    border-radius: 10px;
  }

  /* Image Preview Modal */
  .image-preview-content {
    max-width: 95%;
    max-height: 85%;
    border-radius: 12px;
  }

  .image-preview-header {
    padding: 12px 14px;
    font-size: 0.82rem;
  }

  .image-preview-body {
    padding: 12px;
  }
}

/* --- Small Mobile (max 360px) --- */
@media (max-width: 360px) {
  .main-container {
    padding: 12px 6px;
  }

  .card-header {
    padding: 20px 14px 16px;
  }

  .logo-icon {
    width: 48px;
    height: 48px;
  }

  .main-title {
    font-size: 1.15rem;
  }

  .main-subtitle {
    font-size: 0.8rem;
  }

  .features-box {
    margin: 10px 12px 0;
    padding: 12px;
  }

  .features-title {
    font-size: 0.82rem;
  }

  .features-list li {
    font-size: 0.76rem;
  }

  .email-form-section {
    padding: 14px 12px;
  }

  .email-field {
    padding: 12px;
    font-size: 16px;
    border-radius: 10px;
  }

  .btn-modern {
    padding: 12px 16px;
    font-size: 0.88rem;
    border-radius: 10px;
  }

  .inbox-wrapper,
  .detail-wrapper {
    padding: 8px 6px;
  }

  .inbox-header-modern {
    padding: 14px;
    gap: 10px;
  }

  .inbox-title-text h1 {
    font-size: 1.05rem;
  }

  .email-badge {
    font-size: 0.68rem;
  }

  .inbox-actions-modern {
    gap: 4px;
  }

  .btn-action {
    padding: 7px 8px;
    font-size: 0.75rem;
  }

  .email-item-modern {
    padding: 10px;
    gap: 8px;
  }

  .email-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 0.78rem;
    border-radius: 8px;
  }

  .email-sender-modern {
    font-size: 0.8rem;
  }

  .email-subject-modern {
    font-size: 0.74rem;
  }

  .detail-header-modern {
    padding: 12px;
  }

  .detail-title-text h1 {
    font-size: 0.95rem;
  }

  .email-header-detail {
    padding: 14px 12px;
  }

  .email-subject-detail h2 {
    font-size: 0.92rem;
  }

  .email-body-detail {
    padding: 12px 10px;
  }
}

/* --- Landscape mobile fix --- */
@media (max-height: 500px) and (orientation: landscape) {
  .main-container {
    padding: 16px 20px;
    justify-content: flex-start;
  }

  .card-header {
    padding: 20px 24px 16px;
  }

  .logo-wrapper {
    margin-bottom: 12px;
  }

  .logo-icon {
    width: 48px;
    height: 48px;
  }

  .features-box {
    margin-top: 12px;
  }
}

/* --- iOS safe area (notch devices) --- */
@supports (padding: env(safe-area-inset-top)) {
  .main-container {
    padding-top: max(24px, env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .inbox-wrapper {
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .detail-wrapper {
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .notification-toast {
    top: max(20px, env(safe-area-inset-top));
  }
}

/* --- iOS 100vh fix --- */
@supports (-webkit-touch-callout: none) {
  .main-container {
    min-height: -webkit-fill-available;
  }

  .inbox-wrapper {
    min-height: -webkit-fill-available;
  }

  .detail-wrapper {
    min-height: -webkit-fill-available;
  }

  /* Disable background-attachment: fixed on iOS (causes janky scroll) */
  body.email-page,
  body.inbox-page {
    background-attachment: scroll;
  }
}

/* ================================================
   SCROLLBAR STYLE
   ================================================ */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.3);
}

::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.5);
}
