/* ==========================================================================
   INALIVE Portal Hub - Dynamic Galaxy Space Background & Dashboard Styling
   ========================================================================== */

/* Dynamic Space Background */
#spaceCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Glowing Orbs (Galaxy Atmosphere) */
.orb-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  animation: floatOrb 18s ease-in-out infinite alternate;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #6366f1 0%, rgba(99, 102, 241, 0) 70%);
  top: -150px;
  left: -100px;
}

.orb-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #a855f7 0%, rgba(168, 85, 247, 0) 70%);
  bottom: -200px;
  right: -150px;
  animation-delay: -9s;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #06b6d4 0%, rgba(6, 182, 212, 0) 70%);
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.18;
  animation-duration: 24s;
}

@keyframes floatOrb {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(40px, 30px) scale(1.08);
  }
  100% {
    transform: translate(-30px, -40px) scale(0.95);
  }
}

.portal-main-container {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow-y: auto;
  padding: 40px 24px 80px 24px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

/* Hero Section */
.portal-hero {
  text-align: center;
  margin-bottom: 48px;
  position: relative;
}

.portal-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 6px 16px;
  border-radius: 9999px;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  color: #818cf8;
  margin-bottom: 20px;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}

.hero-spark-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00f0ff;
  box-shadow: 0 0 8px #00f0ff;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
}

.portal-hero-title {
  font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(32px, 4.5vw, 54px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.portal-gradient-text {
  background: linear-gradient(135deg, #00f0ff 0%, #a855f7 50%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.portal-hero-subtitle {
  font-size: clamp(15px, 1.8vw, 18px);
  color: #94a3b8;
  max-width: 680px;
  margin: 0 auto 32px auto;
  line-height: 1.6;
}

/* User Greeting Banner */
.portal-user-welcome {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 20px;
  border-radius: 12px;
  font-size: 13px;
  color: #f8fafc;
}

.welcome-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

/* Application Catalog Section */
.portal-catalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.catalog-title {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.catalog-badge {
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
  color: #94a3b8;
}

/* App Grid */
.portal-apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
  margin-bottom: 60px;
}

/* App Card */
.app-card {
  background: rgba(17, 24, 39, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.app-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: all 0.3s ease;
}

.app-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(99, 102, 241, 0.15);
}

.app-card.active-autodocs:hover {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(99, 102, 241, 0.25);
}

.app-card.active-autodocs::before {
  background: linear-gradient(90deg, #6366f1, #a855f7);
}

.app-card.active-trade:hover {
  border-color: rgba(0, 240, 255, 0.5);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 240, 255, 0.25);
}

.app-card.active-trade::before {
  background: linear-gradient(90deg, #00f0ff, #10b981);
}

.app-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.app-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.active-autodocs .app-card-icon {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(168, 85, 247, 0.2) 100%);
  border-color: rgba(99, 102, 241, 0.35);
}

.active-trade .app-card-icon {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2) 0%, rgba(16, 185, 129, 0.2) 100%);
  border-color: rgba(0, 240, 255, 0.35);
}

.active-komadori .app-card-icon {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.25) 0%, rgba(251, 146, 60, 0.25) 100%);
  border-color: rgba(244, 63, 94, 0.4);
}

.active-komadori::before {
  background: linear-gradient(90deg, #f43f5e, #fb923c);
}

.active-komadori .app-card-tagline {
  color: #fb7185;
}

.btn-launch-komadori {
  background: linear-gradient(135deg, #f43f5e 0%, #ea580c 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 20px rgba(244, 63, 94, 0.35);
}

.btn-launch-komadori:hover {
  background: linear-gradient(135deg, #fb7185 0%, #f97316 100%);
  box-shadow: 0 6px 24px rgba(244, 63, 94, 0.55);
  transform: translateY(-2px);
}

.app-card-status-badge {
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-card-status-badge.online {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.app-card-status-badge.coming-soon {
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.app-card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 8px;
}

.app-card-tagline {
  font-size: 13px;
  color: #818cf8;
  font-weight: 600;
  margin-bottom: 12px;
}

.active-trade .app-card-tagline {
  color: #00f0ff;
}

.app-card-desc {
  font-size: 13px;
  line-height: 1.6;
  color: #94a3b8;
  margin-bottom: 24px;
}

.app-card-features-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
  font-size: 12px;
  color: #cbd5e1;
}

.app-card-features-list li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-card-features-list li span.check {
  color: #34d399;
}

/* Launch Button */
.btn-launch-app {
  width: 100%;
  padding: 13px 20px;
  border-radius: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.25s ease;
}

.btn-launch-primary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.btn-launch-primary:hover {
  filter: brightness(1.15);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.5);
  transform: translateY(-2px);
}

.btn-launch-trade {
  background: linear-gradient(135deg, #00f0ff 0%, #3b82f6 100%);
  color: #04070d;
  box-shadow: 0 4px 16px rgba(0, 240, 255, 0.35);
}

.btn-launch-trade:hover {
  filter: brightness(1.15);
  box-shadow: 0 8px 24px rgba(0, 240, 255, 0.5);
  transform: translateY(-2px);
}

.btn-launch-disabled {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #64748b;
  cursor: not-allowed;
}

/* Portal Footer */
.portal-footer-section {
  text-align: center;
  padding: 32px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: #64748b;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.portal-footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.portal-footer-links a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s;
}

.portal-footer-links a:hover {
  color: #f8fafc;
}

/* Hidden Utility & Google Login Toggle */
.hidden,
.btn-google-login.hidden {
  display: none !important;
}

/* ==========================================================================
   Privacy Guarantee & Quick Actions (Before Portal Section)
   ========================================================================== */
.privacy-guarantee-card {
  position: relative;
  width: 100%;
  max-width: 680px;
  margin: 0 auto 20px auto;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(16, 185, 129, 0.32);
  border-radius: 20px;
  padding: 24px 30px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(16, 185, 129, 0.12);
  overflow: hidden;
  text-align: center;
  transition: all 0.3s ease;
}

.privacy-guarantee-card:hover {
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 50px rgba(16, 185, 129, 0.2);
  transform: translateY(-2px);
}

.privacy-guarantee-glow {
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.8), rgba(99, 102, 241, 0.8), transparent);
}

.privacy-guarantee-header {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 6px 14px;
  border-radius: 9999px;
  margin-bottom: 16px;
}

.privacy-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #10b981;
}

.privacy-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #34d399;
  text-transform: uppercase;
}

.privacy-statement {
  font-size: clamp(0.95rem, 2vw, 1.08rem);
  line-height: 1.75;
  color: #f1f5f9;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.privacy-links-row {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 0.84rem;
  flex-wrap: wrap;
}

.privacy-inline-link {
  color: #6ee7b7;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.privacy-inline-link:hover {
  color: #a7f3d0;
  text-decoration: underline;
}

.privacy-divider {
  color: #64748b;
}

/* Quick Share & Actions */
.quick-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 16px;
  margin-bottom: 32px;
}

.action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  padding: 9px 18px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

/* ==========================================================================
   User Account Dropdown Menu (Premium Glassmorphism Design)
   ========================================================================== */
.user-profile-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 290px;
  background: rgba(11, 16, 28, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.65), 0 0 1px 1px rgba(255, 255, 255, 0.08);
  padding: 12px;
  z-index: 1000;
  display: none;
  animation: dropdownSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-dropdown-menu.active {
  display: flex !important;
  flex-direction: column;
}

@keyframes dropdownSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dropdown-user-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 12px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dropdown-avatar-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.dropdown-avatar {
  width: 44px !important;
  height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  border: 2px solid rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
  display: block;
}

.avatar-status-pip {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #0b101c;
  box-shadow: 0 0 6px #10b981;
}

.dropdown-user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 2px;
}

.dropdown-user-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dropdown-user-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-badge-pro {
  font-size: 10px;
  font-weight: 800;
  background: linear-gradient(135deg, #0284c7, #6366f1);
  color: #fff;
  padding: 1px 6px;
  border-radius: 9999px;
  letter-spacing: 0.5px;
}

.dropdown-user-email {
  font-size: 0.74rem;
  color: #94a3b8;
  font-family: var(--font-mono, monospace);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.8px;
  padding: 10px 6px 4px 6px;
}

.dropdown-nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  text-decoration: none;
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  transform: translateX(2px);
}

.dropdown-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dropdown-item-icon.bg-cyan {
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.dropdown-item-icon.bg-emerald {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.dropdown-item-icon.bg-rose {
  background: rgba(239, 68, 68, 0.15);
  color: #fb7185;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.dropdown-item-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}

.dropdown-item-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: inherit;
}

.dropdown-item-desc {
  font-size: 0.70rem;
  color: #94a3b8;
}

.dropdown-arrow-hint {
  font-size: 0.82rem;
  color: #64748b;
  transition: transform 0.2s ease;
  margin-left: auto;
}

.dropdown-item:hover .dropdown-arrow-hint {
  transform: translateX(3px);
  color: #38bdf8;
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 8px 0;
}

.btn-logout {
  border: none;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: rgba(239, 68, 68, 0.25) !important;
}

.text-rose {
  color: #fda4af;
}
