:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --text-primary: #e5e7eb;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --accent: #38bdf8;
  --accent-hover: #0ea5e9;
  --gradient-1: #6366f1;
  --gradient-2: #8b5cf6;
  --gradient-3: #ec4899;
  --card-bg: rgba(30, 41, 59, 0.7);
  --border-color: rgba(148, 163, 184, 0.2);
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #64748b;
  --accent: #0ea5e9;
  --accent-hover: #f7f9fa;
  --card-bg: rgba(255, 255, 255, 0.8);
  --border-color: rgba(100, 116, 139, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  transition: background 0.5s ease, color 0.5s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  cursor: none;
  transition: background 0.5s ease, color 0.5s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-hover);
}

/* Animated Gradient Background */
.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.3;
  background: linear-gradient(
    45deg,
    var(--gradient-1),
    var(--gradient-2),
    var(--gradient-3),
    var(--accent)
  );
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Loading Animation */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.loader-ring {
  width: 60px;
  height: 60px;
  border: 4px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Custom Cursor */
.cursor,
.cursor-follower {
  width: 20px;
  height: 20px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s, border-color 0.3s;
}

.cursor-follower {
  width: 40px;
  height: 40px;
  border-color: rgba(56, 189, 248, 0.3);
  transition: width 0.3s, height 0.3s, border-color 0.3s, left 0.1s, top 0.1s;
}

.cursor.hover,
.cursor-follower.hover {
  width: 60px;
  height: 60px;
  border-color: var(--gradient-2);
}

@media (hover: none) {
  .cursor,
  .cursor-follower {
    display: none;
  }
  body {
    cursor: auto;
  }
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  top: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  transform: scale(1.1) rotate(20deg);
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

/* Container with Glassmorphism */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 4rem 2rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

/* Profile Photo */
.profile-photo {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 2rem;
  border: 4px solid transparent;
  background: linear-gradient(var(--bg-primary), var(--bg-primary)) padding-box,
              linear-gradient(45deg, var(--gradient-1), var(--gradient-2), var(--gradient-3)) border-box;
  transition: all 0.4s ease;
  cursor: pointer;
}

.profile-photo:hover {
  transform: scale(1.05) rotate(5deg);
  box-shadow: 0 10px 40px rgba(56, 189, 248, 0.4);
}

/* Gradient Text */
h1 {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.gradient-text {
  background: linear-gradient(45deg, var(--gradient-1), var(--gradient-2), var(--gradient-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% auto;
  animation: gradientText 3s ease infinite;
}

@keyframes gradientText {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

h1:hover {
  transform: scale(1.05);
}

h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--text-primary);
}

.tagline {
  margin-top: 0.5rem;
  font-size: 1.25rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.description {
  margin-top: 2rem;
  line-height: 1.8;
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* Interactive Link Cards */
.links {
  margin-top: 3rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.link-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.2), transparent);
  transition: left 0.5s ease;
}

.link-card:hover::before {
  left: 100%;
}

.link-card:hover {
  transform: translateY(-5px) scale(1.05);
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(56, 189, 248, 0.3);
}

.link-icon {
  font-size: 1.5rem;
  transition: transform 0.3s ease;
}

.link-card:hover .link-icon {
  transform: scale(1.2) rotate(10deg);
}

/* Skills Section */
.skills-section {
  margin-top: 4rem;
  padding: 3rem 2rem;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.skill-badge {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2));
  border-radius: 25px;
  font-weight: 600;
  color: white;
  transition: all 0.3s ease;
  cursor: pointer;
}

.skill-badge:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
}

/* Projects Section */
.projects-section {
  margin-top: 4rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.project-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  text-align: left;
  transition: all 0.4s ease;
  cursor: pointer;
}

.project-card:hover {
  transform: translateY(-10px);
  border-color: var(--accent);
  box-shadow: 0 15px 40px rgba(56, 189, 248, 0.3);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.project-card h3 {
  font-size: 1.5rem;
  color: var(--text-primary);
}

.project-status {
  padding: 0.25rem 0.75rem;
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.project-card p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.tech-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.tech-tag {
  padding: 0.25rem 0.75rem;
  background: rgba(99, 102, 241, 0.2);
  color: var(--gradient-1);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
}

.project-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.project-link:hover {
  gap: 1rem;
  color: var(--accent-hover);
}

/* Timeline Section */
.timeline-section {
  margin-top: 4rem;
  text-align: left;
}

.timeline {
  position: relative;
  padding-left: 2rem;
  margin-top: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 2px;
  background: linear-gradient(to bottom, var(--gradient-1), var(--gradient-2), var(--gradient-3));
}

.timeline-item {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 3rem;
}

.timeline-dot {
  position: absolute;
  left: -0.5rem;
  top: 0;
  width: 1rem;
  height: 1rem;
  background: var(--accent);
  border-radius: 50%;
  border: 3px solid var(--bg-primary);
  transition: all 0.3s ease;
}

.timeline-item:hover .timeline-dot {
  transform: scale(1.5);
  box-shadow: 0 0 20px var(--accent);
}

.timeline-content {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.timeline-content:hover {
  transform: translateX(10px);
  border-color: var(--accent);
}

.timeline-content h3 {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.timeline-company {
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.timeline-date {
  color: var(--text-tertiary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.timeline-content p:last-child {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Footer */
footer {
  margin-top: 4rem;
  padding-top: 2rem;
  font-size: 0.9rem;
  color: var(--text-tertiary);
  border-top: 1px solid var(--border-color);
}

/* Fade-in Animations */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Easter Eggs */
.easter-egg-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  font-weight: 700;
  z-index: 10000;
  animation: bounce 0.5s ease;
  text-shadow: 0 0 20px rgba(236, 72, 153, 0.8);
}

@keyframes bounce {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.2); }
}

.party-mode {
  animation: partyColors 0.5s infinite;
}

@keyframes partyColors {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  top: -10px;
  z-index: 9999;
  animation: confettiFall 3s linear forwards;
}

@keyframes confettiFall {
  to {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }

  .tagline {
    font-size: 1rem;
  }

  .description {
    font-size: 1rem;
  }

  .links {
    flex-direction: column;
    gap: 1rem;
  }

  .link-card {
    width: 100%;
    justify-content: center;
  }

  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .theme-toggle {
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .container {
    padding: 2rem 1.5rem;
  }

  .profile-photo {
    width: 120px;
    height: 120px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }

  .skills-section,
  .projects-section,
  .timeline-section {
    padding: 2rem 1rem;
  }
}
