/* WakaTime Theme Styles - Refined Glassmorphism Version */

/* Theme Color Variable (Injected by JS) */
:root {
  --wakatime-theme-color: #ffffff;
}

/* 1. Avatar Glow: Dynamic Pulse based on Energy */
.js-avatar {
  transition: all 0.5s ease;
  border: 2px solid transparent; /* Prepare for border transition */
  border-radius: 50%; /* Ensure circular border */
}

/* Fix for square shadow issue */
.ih-item.circle .img {
  border-radius: 50% !important;
  box-shadow: none !important; /* Remove any existing box shadow from wrapper */
  background: transparent !important; /* Remove any background color */
}

.ih-item.circle {
  box-shadow: none !important;
  background: transparent !important;
}

.js-avatar.glowing {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 var(--glow-size, 20px) var(--wakatime-theme-color);
  animation: pulse var(--pulse-speed, 2s) ease-in-out infinite;
  border-radius: 50%; /* Ensure glow follows circle */
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 15px var(--wakatime-theme-color);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 25px var(--wakatime-theme-color);
    transform: scale(1.02);
  }
}

/* 2. Status Widget: Glassmorphism Capsule */
.wakatime-status {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 1000;
  
  /* Glassmorphism Base */
  background: rgba(20, 20, 20, 0.4); /* Darker, neutral base */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  
  /* Shape & Spacing */
  padding: 8px 16px;
  border-radius: 30px;
  
  /* Typography */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.5px;
  
  /* Transition */
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  cursor: default;
}

/* Hover Effect for Widget */
.wakatime-status:hover {
  background: rgba(30, 30, 30, 0.6);
  border-color: var(--wakatime-theme-color);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4), 0 0 10px var(--wakatime-theme-color);
  transform: translateY(-2px);
}

/* Status Content Layout */
.wt-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Emoji Styling */
.wt-emoji {
  font-size: 16px;
  filter: drop-shadow(0 0 5px rgba(0,0,0,0.5));
}

/* Text Highlight */
.wt-text {
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* 3. Navigation Buttons: Glassmorphism */
.blog-button {
  /* Glassmorphism Base */
  background: rgba(20, 20, 20, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.2);
  
  /* Reset/Override existing styles */
  color: rgba(255, 255, 255, 0.9);
  text-shadow: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  
  /* Ensure consistent spacing */
  display: inline-block;
}

/* Fix for profile picture link button (which also has class .blog-button) */
.ih-item.circle .blog-button {
  background: transparent !important;
  backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: block !important;
  width: 100%;
  height: 100%;
  border-radius: 50%; /* Ensure it follows circle shape */
}

/* Button Accents (Hover) - Unified with Status Widget */
.navigation__item .blog-button:hover,
.btn-mobile-menu__icon:hover {
  background: rgba(30, 30, 30, 0.6);
  /* Keep text color white, only add glow */
  color: rgba(255, 255, 255, 0.95) !important;
  border-color: var(--wakatime-theme-color) !important;
  /* Add colored shadow glow */
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4), 0 0 10px var(--wakatime-theme-color);
  transform: translateY(-2px);
  opacity: 1;
}

/* Social Icons Hover - Keep original behavior but match glow */
.navigation__item a:not(.blog-button):hover {
  color: var(--wakatime-theme-color) !important;
  text-shadow: 0 0 8px var(--wakatime-theme-color);
  background: transparent !important;
  box-shadow: none !important;
  transform: translateY(-2px);
}

/* Exclude the profile picture button from hover effects */
.ih-item.circle .blog-button:hover {
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

/* 4. Subtitle Accent (Subtle) */
.panel-cover__subtitle {
  transition: color 0.5s ease;
}
.panel-cover__subtitle:hover {
  color: var(--wakatime-theme-color);
}

/* 5. Particles: Subtle Background Ambience */
.particle-container {
  position: absolute; /* Changed from fixed to absolute to stay within panel if needed */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0; /* Behind content */
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--wakatime-theme-color);
  border-radius: 50%;
  opacity: 0.6;
  box-shadow: 0 0 4px var(--wakatime-theme-color);
  animation: float 15s infinite ease-in-out;
}

@keyframes float {
  0% {
    transform: translateY(100vh) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.6;
  }
  90% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(-10vh) translateX(20px) rotate(360deg);
    opacity: 0;
  }
}

/* Typing Effect for High Energy */
.typing-effect {
  overflow: hidden;
  border-right: 2px solid var(--wakatime-theme-color);
  white-space: nowrap;
  animation: blink-caret 0.75s step-end infinite;
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: var(--wakatime-theme-color); }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .wakatime-status {
    bottom: 15px;
    right: 15px;
    font-size: 11px;
    padding: 6px 12px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  
  .wt-emoji {
    font-size: 14px;
  }
}

/* =========================================
   Weekly Stats Modal (Cyber Minimalism)
   ========================================= */

.weekly-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  font-family: 'JetBrains Mono', 'Fira Code', monospace; /* Monospace is key */
}

.weekly-modal.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5); /* Lighter dark backdrop */
  backdrop-filter: blur(2px);
}

/* Modal Container: The Console */
.modal-content {
  position: relative;
  width: 90%;
  max-width: 420px;
  background: #09090b; /* Almost black */
  border: 1px solid #333;
  border-radius: 4px; /* Sharp corners */
  padding: 0;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  
  /* Initial State (Match .iUp style) */
  opacity: 0;
  transform: translate3d(0, 80px, 0);
  transition: all 1s cubic-bezier(0.19, 1, 0.22, 1); /* Slightly faster than 2s for modal */
  
  color: #eee;
  overflow: hidden;
}

.weekly-modal.show .modal-content {
  /* Final State (Match .iUp.up style) */
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Header: Asymmetric Layout */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #222;
  background: #0e0e10;
}

.modal-header h2 {
  font-size: 0.9em;
  margin: 0;
  font-weight: 400;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ai-badge {
  font-size: 0.75em;
  color: var(--badge-color);
  text-shadow: 0 0 8px var(--badge-color);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-badge::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  background: var(--badge-color);
  border-radius: 50%;
  box-shadow: 0 0 5px var(--badge-color);
}

/* Close Button */
.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  display: none; /* Minimalist UI doesn't need explicit close usually, but let's keep it clean */
}

/* Chart: The Monitor */
.weekly-chart-container {
  height: 160px;
  padding: 24px;
  background: #050505;
  position: relative;
  border-bottom: 1px solid #222;
}

.weekly-chart-container svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* AI Terminal */
.ai-insight {
  padding: 24px;
  background: #0a0a0a;
  border-bottom: 1px solid #222;
  position: relative;
}

.ai-insight::before {
  content: '>';
  position: absolute;
  left: 24px;
  top: 24px;
  color: #444;
  font-weight: bold;
}

.ai-insight h3 {
  display: none; /* Hide title for terminal look */
}

.ai-insight p {
  margin: 0 0 0 20px;
  font-size: 0.85em;
  line-height: 1.6;
  color: #aaa;
}

.weekly-modal.is-loading .ai-insight p {
  color: #666;
}

.weekly-modal.is-loading .weekly-chart-container .weekly-line,
.weekly-modal.is-loading .weekly-chart-container .weekly-fill {
  opacity: 0.25;
}

/* Metrics Grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: #222; /* Gap color */
  gap: 1px;
  border-bottom: 1px solid #222;
}

.stat-item {
  background: #0e0e10;
  padding: 20px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stat-item .val {
  font-size: 1.4em;
  font-weight: 300;
  color: #fff;
  letter-spacing: -0.5px;
}

.stat-item .key {
  font-size: 0.6em;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 1px;
}
