:root {
  --primary: #3b82f6;
  --shadow: rgba(59, 130, 246, 0.4);
  --shadow-light: rgba(59, 130, 246, 0.2);
}

body {
  transition: background 0.5s ease, color 0.3s ease;
  font-family: 'Inter', sans-serif;
}

body.light {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  color: #1f2937;
}

body.dark {
  background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
  color: #e5e7eb;
}

.box-container {
  max-width: 900px;
  min-height: 600px;
  margin: 2rem auto;
  border: 1px solid var(--primary);
  border-radius: 12px;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.light .box-container {
  background: #ffffff;
  box-shadow: 0 0 20px var(--shadow-light);
}

.dark .box-container {
  background: #1f2937;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.nav-link {
  position: relative;
  transition: color 0.3s ease, opacity 0.3s ease;
  opacity: 0.7;
  font-family: 'Orbitron', sans-serif;
}

.nav-link:hover {
  opacity: 1;
}

.nav-link.active {
  opacity: 1;
  color: var(--primary);
}

.nav-link:hover::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary);
  animation: glow 1s infinite alternate;
}

.content-section {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.content-section.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.content-section.fading-out {
  opacity: 0;
  transform: translateY(-20px);
}

.fade-item {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.card {
  border: 1px solid var(--primary);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.light .card {
  background: #f3f4f6;
}

.dark .card {
  background: #374151;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 15px var(--shadow);
}

.link-with-tooltip {
  position: relative;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: color 0.3s ease;
}

.link-with-tooltip:hover {
  text-decoration: underline;
}

.light .link-with-tooltip:hover {
  color: #1d4ed8;
}

.dark .link-with-tooltip:hover {
  color: #60a5fa;
}

.link-with-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 10;
}

.link-with-tooltip:hover::after {
  opacity: 1;
  visibility: visible;
}

.light .link-with-tooltip::after {
  background-color: #1f2937;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.dark .link-with-tooltip::after {
  background-color: #e5e7eb;
  color: #1f2937;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.link-with-tooltip img {
  vertical-align: middle;
  transition: transform 0.3s ease;
}

.link-with-tooltip:hover img {
  transform: scale(1.2);
}

.profile-pic {
  width: 100%;
  max-width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  box-shadow: 0 0 15px var(--shadow);
  object-fit: cover;
  transition: transform 0.3s ease;
}

.profile-pic:hover {
  transform: scale(1.05);
}

.profile-pic-container {
  position: relative;
  display: inline-block;
}

.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.5s ease, background 0.5s ease;
}

.light .loader {
  background: #f3f4f6;
}

.dark .loader {
  background: #1f2937;
}

.loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader::before {
  content: '';
  width: 50px;
  height: 50px;
  border: 5px solid var(--primary);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.theme-toggle {
  display: flex;
  align-items: center;
  cursor: pointer;
  gap: 0.5rem;
}

.theme-toggle input {
  display: none;
}

.theme-toggle .slider {
  width: 40px;
  height: 20px;
  background: #d1d5db;
  border-radius: 20px;
  position: relative;
  transition: background 0.3s ease;
}

.theme-toggle .slider::before {
  content: '';
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.3s ease;
}

.theme-toggle input:checked + .slider {
  background: var(--primary);
}

.theme-toggle input:checked + .slider::before {
  transform: translateX(20px);
}

.theme-icon {
  width: 20px;
  height: 20px;
}

.light .sun-icon {
  display: inline;
}

.light .moon-icon {
  display: none;
}

.dark .sun-icon {
  display: none;
}

.dark .moon-icon {
  display: inline;
}

.connect-button {
  position: relative;
  overflow: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

.connect-button::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: var(--primary);
  transition: width 0.6s ease;
}

.connect-button.filling::after {
  width: 100%;
}

.connect-button:not(.filling)::after {
  width: 0;
  transform-origin: right;
}

.connect-button:hover {
  background: var(--primary);
  color: #fff;
}

.music-box, .activity-box {
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 1.5rem;
  padding: 1rem;
  width: 100%;
  max-width: 100%;
  min-height: 120px;
  transition: all 0.3s ease-in-out;
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.light .music-box, .light .activity-box {
  background-color: rgba(245, 245, 245, 0.3);
  border-color: rgba(23, 21, 21, 0.5);
  color: #1f2937;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.dark .music-box, .dark .activity-box {
  background-color: rgba(74, 93, 122, 0.4);
  border-color: rgba(55, 65, 81, 0.5);
  color: #e5e7eb;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.music-box:hover, .activity-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.album-art, .activity-icon {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 0.75rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.logo, .activity-logo {
  width: 24px;
  height: 24px;
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

.music-content, .activity-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.text-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.25rem;
}

.song-title, .activity-name {
  font-weight: 700;
  font-size: 1.25rem;
}

.artist-name, .album-name, .activity-details, .activity-state {
  font-size: 0.875rem;
}

.status-message, .activity-status-message {
  font-size: 1rem;
  font-style: italic;
  text-align: center;
}

.light .song-title, .light .activity-name {
  color: #1a202c;
}

.dark .song-title, .dark .activity-name {
  color: #e5e7eb;
}

.light .artist-name, .light .album-name, .light .activity-details, .light .activity-state {
  color: #4a5568;
}

.dark .artist-name, .dark .album-name, .dark .activity-details, .dark .activity-state {
  color: #9ca3af;
}

.light .status-message, .light .activity-status-message {
  color: #718096;
}

.dark .status-message, .dark .activity-status-message {
  color: #a0aec0;
}

.discord-card {
  background-color: #2b2d31;
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 200px;
  margin-top: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.light .discord-card {
  background-color: #e5e7eb;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.dark .discord-card {
  background-color: #2b2d31;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.discord-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px var(--shadow);
}

.discord-card-left {
  display: flex;
  align-items: center;
}

.discord-icon {
  width: 24px;
  height: 24px;
  margin-right: 5px;
  background-color: #5865f2;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 14px;
  font-weight: bold;
  font-family: 'Orbitron', sans-serif;
}

.discord-activity-text {
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
}

.light .discord-activity-text {
  color: #1f2937;
}

.dark .discord-activity-text {
  color: #e5e7eb;
}

.status-tag {
  background-color: #da373c;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  font-family: 'Inter', sans-serif;
}

.status-tag.online {
  background-color: #22c55e;
}

@media (min-width: 640px) {
  .music-box, .activity-box {
    padding: 1.25rem;
  }
  .album-art, .activity-icon {
    width: 120px;
    height: 120px;
  }
  .logo, .activity-logo {
    width: 32px;
    height: 32px;
  }
  .music-content, .activity-content {
    flex-direction: row;
    align-items: flex-start;
    gap: 1rem;
  }
  .text-content {
    align-items: flex-start;
    text-align: left;
  }
}

@media (max-width: 639px) {
  .album-art, .activity-icon {
    width: 80px;
    height: 80px;
  }
  .music-box, .activity-box {
    padding: 0.75rem;
  }
  .logo, .activity-logo {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 768px) {
  .box-container {
    margin: 1rem;
    min-height: auto;
  }
  .profile-pic {
    max-width: 150px;
    height: 150px;
  }
  .about-content {
    text-align: center;
  }
  .about-section {
    flex-direction: column;
    align-items: center;
  }
  .interests-grid, .contact-grid {
    grid-template-columns: 1fr;
  }
  .nav-container {
    flex-wrap: wrap;
    gap: 1rem;
  }
  .nav-links {
    flex: 1;
    text-align: center;
  }
  .theme-toggle {
    margin-left: auto;
  }
  .discord-card {
    max-width: 150px;
    padding: 10px 12px;
  }
  .discord-icon {
    width: 20px;
    height: 20px;
    font-size: 12px;
  }
  .discord-activity-text {
    font-size: 12px;
  }
  .status-tag {
    font-size: 10px;
    padding: 3px 6px;
  }
}

@media (max-width: 639px) {
  .discord-card {
    max-width: 100%;
    padding: 8px 10px;
  }
}

@media (min-width: 769px) {
  .about-section {
    flex-direction: row;
    align-items: center;
    gap: 2rem;
  }
  .about-content {
    flex: 1;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes glow {
  from {
    box-shadow: 0 0 5px var(--shadow);
  }
  to {
    box-shadow: 0 0 15px var(--shadow);
  }
}

* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
