/* ----------------------------------------------------
   Design Tokens & Harmonious Color Palette
   ---------------------------------------------------- */
:root {
  --bg-dark: #09090b;
  --bg-card: rgba(18, 18, 22, 0.55);
  --bg-card-hover: rgba(26, 26, 32, 0.7);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-hover: rgba(168, 85, 247, 0.25);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-purple: #a855f7;
  --accent-purple-glow: rgba(168, 85, 247, 0.6);
  --accent-pink: #ec4899;
  --accent-blue: #06b6d4;
  
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Outfit', sans-serif;
}

/* ----------------------------------------------------
   Base Settings (Cursor Hiding & Typography)
   ---------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: var(--font-body);
  color: var(--text-primary);
  /* Hide the system cursor to substitute with custom crosshair */
  cursor: none !important;
}

/* Force custom cursor hiding on all interactive elements */
a, button, input, select, textarea, [role="button"] {
  cursor: none !important;
}

/* ----------------------------------------------------
   Custom Image Cursor & Particle Trail
   ---------------------------------------------------- */
#custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 48px;
  height: 48px;
  pointer-events: none; /* Crucial so clicks go through the cursor */
  transform: translate(-50%, -50%);
  z-index: 99999;
  mix-blend-mode: normal;
  transition: transform 0.15s ease-out, opacity 0.2s;
  opacity: 0; /* Initially hidden until mouse move */
}

#custom-cursor img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(168, 85, 247, 0.6));
}

#custom-cursor.active {
  transform: translate(-50%, -50%) scale(0.8) rotate(-15deg);
}

#custom-cursor.hovering {
  transform: translate(-50%, -50%) scale(1.2) rotate(15deg);
}

/* Trail particle styling */
.cursor-particle {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  animation: fadeParticle 0.8s forwards ease-out;
}

@keyframes fadeParticle {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.1);
  }
}

/* ----------------------------------------------------
   Fullscreen Background Video Loop
   ---------------------------------------------------- */
.video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
}

#bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(9, 9, 11, 0.85) 0%,
    rgba(9, 9, 11, 0.6) 50%,
    rgba(9, 9, 11, 0.9) 100%
  );
  backdrop-filter: blur(2px);
  z-index: 2;
}

/* ----------------------------------------------------
   "Click to Enter" Blurring Overlay
   ---------------------------------------------------- */
#entry-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(9, 9, 11, 0.97);
  backdrop-filter: blur(25px);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 1s cubic-bezier(0.25, 1, 0.5, 1), visibility 1s;
}

#entry-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

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

.entry-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 6px;
  text-transform: lowercase;
  color: var(--text-primary);
  opacity: 0.8;
  animation: pulseText 2.5s infinite ease-in-out;
}

@keyframes pulseText {
  0%, 100% {
    opacity: 0.3;
    transform: scale(0.98);
    text-shadow: 0 0 0px rgba(255, 255, 255, 0);
  }
  50% {
    opacity: 1;
    transform: scale(1.02);
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
  }
}

/* ----------------------------------------------------
   Main Portfolio Wrapper
   ---------------------------------------------------- */
.main-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  padding: 20px;
}

/* ----------------------------------------------------
   Glassmorphic Central Card Layout
   ---------------------------------------------------- */
.glass-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 40px 30px;
  box-shadow: 
    0 30px 60px rgba(0, 0, 0, 0.4),
    inset 0 1px 0px rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
  animation: cardFadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.glass-card:hover {
  border-color: var(--border-glass-hover);
  box-shadow: 
    0 30px 60px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(168, 85, 247, 0.15),
    inset 0 1px 0px rgba(255, 255, 255, 0.12);
}

@keyframes cardFadeIn {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --- Avatar Element --- */
.avatar-container {
  position: relative;
  width: 110px;
  height: 110px;
  margin-bottom: 24px;
}

.profile-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 3;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.avatar-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
  opacity: 0.4;
  z-index: 2;
  filter: blur(8px);
  animation: pulseGlow 4s infinite alternate ease-in-out;
}

.avatar-container:hover .profile-avatar {
  transform: scale(1.08) rotate(5deg);
  border-color: var(--accent-purple);
}

@keyframes pulseGlow {
  0% {
    opacity: 0.3;
    transform: scale(0.95);
  }
  100% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

/* --- Identity Section --- */
.name-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.profile-name {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.svg-badge {
  width: 18px;
  height: 18px;
  color: var(--accent-purple);
  filter: drop-shadow(0 0 6px var(--accent-purple-glow));
}

.profile-bio {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-secondary);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 6px;
  font-weight: 400;
}

.profile-sub-bio {
  font-family: var(--font-body);
  font-size: 12px;
  color: #f47521; /* Crunchyroll brand orange */
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 30px;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(244, 117, 33, 0.4);
}

/* ----------------------------------------------------
   Social Link Button Section
   ---------------------------------------------------- */
.links-section {
  width: 100%;
  margin-bottom: 30px;
}

.social-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  color: var(--text-primary);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, background-color 0.2s;
}

.btn-glow {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 100%
  );
  transition: left 0.6s ease;
}

.social-icon {
  margin-right: 12px;
  display: flex;
  align-items: center;
}

.svg-discord {
  width: 20px;
  height: 20px;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.social-button:hover {
  transform: translateY(-2px);
  background: rgba(88, 101, 242, 0.12); /* Discord brand color tint */
  border-color: rgba(88, 101, 242, 0.4);
  box-shadow: 
    0 10px 20px rgba(88, 101, 242, 0.15),
    0 0 15px rgba(88, 101, 242, 0.1);
}

.social-button:hover .btn-glow {
  left: 100%;
}

.social-button:hover .svg-discord {
  transform: scale(1.15) rotate(-5deg);
  color: #5865F2; /* Discord brand color */
  filter: drop-shadow(0 0 8px rgba(88, 101, 242, 0.6));
}

.social-button:active {
  transform: translateY(0);
}

/* ----------------------------------------------------
   Music Player Component
   ---------------------------------------------------- */
.music-card {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.music-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Equalizer Bars Animation */
.audio-equalizer {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  width: 20px;
  height: 18px;
}

.bar {
  width: 3px;
  height: 3px;
  background-color: var(--accent-purple);
  border-radius: 2px;
  transition: height 0.2s ease;
}

.music-card.playing .bar-1 { animation: equalize 1.2s infinite ease-in-out alternate; }
.music-card.playing .bar-2 { animation: equalize 0.9s infinite ease-in-out alternate 0.2s; }
.music-card.playing .bar-3 { animation: equalize 1.4s infinite ease-in-out alternate 0.1s; }
.music-card.playing .bar-4 { animation: equalize 1.0s infinite ease-in-out alternate 0.3s; }

@keyframes equalize {
  0% { height: 3px; }
  100% { height: 18px; }
}

.music-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.track-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.track-status {
  font-size: 10px;
  color: var(--accent-purple);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-top: 1px;
  opacity: 0.8;
}

.music-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 12px;
}

/* --- Reset default button highlights and style volume SVG --- */
.vol-btn {
  background: none !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  padding: 0;
  margin: 0;
  -webkit-appearance: none;
}

.volume-svg-icon {
  width: 18px;
  height: 18px;
  color: var(--text-primary);
  opacity: 0.7;
  transition: opacity 0.2s, color 0.2s, transform 0.2s;
  pointer-events: none;
}

.vol-btn:hover {
  transform: scale(1.1);
}

.vol-btn:hover .volume-svg-icon {
  opacity: 1;
  color: var(--accent-purple);
}

.vol-btn:active {
  transform: scale(0.95);
}

/* Volume Slider styling */
.volume-slider-container {
  flex-grow: 1;
  display: flex;
  align-items: center;
}

.volume-range {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
  transition: background 0.3s;
}

.volume-range::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  border-radius: 2px;
}

.volume-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-primary);
  box-shadow: 0 0 8px rgba(255,255,255,0.4);
  margin-top: -4px; /* Align vertical center */
  transition: background-color 0.2s, transform 0.2s;
}

.volume-range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-primary);
  border: none;
  box-shadow: 0 0 8px rgba(255,255,255,0.4);
  transition: background-color 0.2s, transform 0.2s;
}

.volume-range:hover::-webkit-slider-thumb {
  background: var(--accent-purple);
  transform: scale(1.2);
}

.volume-range:hover::-moz-range-thumb {
  background: var(--accent-purple);
  transform: scale(1.2);
}

/* Mute state for volume SVG */
.music-card.muted .volume-svg-icon {
  color: var(--accent-pink) !important;
  opacity: 0.6;
}

.music-card.muted .bar {
  animation: none !important;
  height: 3px !important;
}

.music-card.muted .track-status {
  color: var(--text-muted);
  content: "muted";
}

/* --- Discord Status Dot --- */
.status-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3.5px solid #141419; /* matches card background/dark border */
  z-index: 5;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.status-dot.online {
  background-color: #23a55a;
  box-shadow: 0 0 10px rgba(35, 165, 90, 0.4);
}

.status-dot.idle {
  background-color: #f0b232;
  box-shadow: 0 0 10px rgba(240, 178, 50, 0.4);
}

.status-dot.dnd {
  background-color: #f23f43;
  box-shadow: 0 0 10px rgba(242, 63, 67, 0.4);
}

.status-dot.offline {
  background-color: #80848e;
}

/* Pulse animation for active status dot */
.status-dot.online, .status-dot.dnd, .status-dot.idle {
  animation: statusPulse 2s infinite ease-in-out alternate;
}

@keyframes statusPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); }
}

/* --- Discord Presence Widget --- */
.presence-widget {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 24px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.presence-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 8px;
}

.presence-header-title {
  font-weight: 700;
}

.presence-loading {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 8px 0;
}

.presence-item {
  display: flex;
  align-items: center;
  gap: 16px;
  animation: presenceFadeIn 0.5s ease-out;
}

@keyframes presenceFadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.presence-icon-container {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.presence-icon {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.presence-icon-fallback {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: rgba(168, 85, 247, 0.1);
  border: 1px dashed rgba(168, 85, 247, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-purple);
  font-size: 20px;
}

.presence-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  line-height: 1.4;
}

.presence-activity-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.presence-activity-details {
  font-size: 12.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.presence-activity-state {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* Custom activity types: playing/streaming/listening/watching colors */
.badge-activity {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-top: 4px;
  width: fit-content;
}

.badge-playing { background: rgba(35, 165, 90, 0.15); color: #23a55a; }
.badge-listening { background: rgba(168, 85, 247, 0.15); color: var(--accent-purple); }
.badge-watching { background: rgba(236, 72, 153, 0.15); color: var(--accent-pink); }
.badge-streaming { background: rgba(88, 101, 242, 0.15); color: #5865f2; }
.badge-custom { background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); }

/* ----------------------------------------------------
   Responsive Adjustments
   ---------------------------------------------------- */
@media (max-width: 480px) {
  .glass-card {
    padding: 30px 20px;
  }
  
  .profile-name {
    font-size: 24px;
  }
}
