:root {
  /* Dark Theme (Default) */
  --primary: #0f172a;         /* Slate 900 */
  --primary-light: #1e293b;   /* Slate 800 */
  --secondary: #3b82f6;       /* Blue 500 */
  --secondary-light: #60a5fa; /* Blue 400 */
  --accent: #f97316;          /* Orange 500 */
  --text: #f8fafc;            /* Slate 50 */
  --text-muted: #94a3b8;      /* Slate 400 */
  --border: #475569;          /* Slate 600 */
  --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --gradient-accent: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  --gradient-dark: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  --blur-bg: rgba(15, 23, 42, 0.7);
}

:root.light-theme {
  /* Light Theme */
  --primary: #f8fafc;         /* Slate 50 */
  --primary-light: #f1f5f9;   /* Slate 100 */
  --secondary: #2563eb;       /* Blue 600 */
  --secondary-light: #3b82f6; /* Blue 500 */
  --accent: #ea580c;          /* Orange 600 */
  --text: #0f172a;            /* Slate 900 */
  --text-muted: #475569;      /* Slate 600 */
  --border: #cbd5e1;          /* Slate 300 */
  --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
  --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
  --gradient-primary: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  --gradient-accent: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  --gradient-dark: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  --blur-bg: rgba(241, 245, 249, 0.8);
}

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

::-webkit-scrollbar-track {
  background-color: var(--primary);
}

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

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

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--primary);
  color: var(--text);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.025em;
}

h2 {
  font-size: 1.875rem;
  letter-spacing: -0.025em;
}

h3 {
  font-size: 1.5rem;
}

a {
  color: var(--secondary);
  transition: all 0.3s ease;
  text-decoration: none;
  position: relative;
}

a:hover {
  color: var(--secondary-light);
}

a:not(.btn):not(.nav-link):not(.logo-link):not(.social-link):after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background: var(--gradient-primary);
  transition: width 0.3s ease;
}

a:not(.btn):not(.nav-link):not(.logo-link):not(.social-link):hover:after {
  width: 100%;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Modern card styling */
.card {
  background-color: var(--primary-light);
  border-radius: 1rem;
  box-shadow: var(--card-shadow);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0;
  z-index: -1;
  transition: opacity 0.4s ease;
  background: var(--gradient-dark);
  border-radius: 1rem;
}

.card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: var(--card-shadow-hover);
}

.card:hover::before {
  opacity: 0.2;
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 1.25rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.card-body {
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

/* Modern navbar */
.modern-navbar {
  background-color: var(--blur-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  color: var(--text);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 0.5rem;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-link:hover {
  color: white;
}

.nav-link:hover::before {
  opacity: 1;
}

.nav-link.active::before {
  opacity: 1;
}

.nav-link.active {
  color: white;
}

/* Profile section */
.profile-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 0 1rem;
  animation: fadeIn 0.7s ease-out;
}

.profile-image {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid transparent;
  background: 
    linear-gradient(var(--primary), var(--primary)) padding-box,
    var(--gradient-primary) border-box;
  box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.5);
  transition: all 0.3s ease;
}

.profile-image:hover {
  transform: scale(1.05);
  box-shadow: 0 20px 25px -5px rgba(59, 130, 246, 0.8);
}

.social-links {
  display: flex;
  gap: 1.5rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: var(--primary-light);
  color: var(--text);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.social-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.social-link:hover {
  color: white;
  transform: translateY(-5px);
  border-color: transparent;
}

.social-link:hover::before {
  opacity: 1;
}

/* Projects grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.project-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.project-links {
  display: flex;
  gap: 0.75rem;
}

/* Skills section */
.skills-container {
  margin: 2rem 0;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1.5rem;
}

.skill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 1rem;
  background-color: var(--primary-light);
  border-radius: 1rem;
  border: 1px solid var(--border);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.skill-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-dark);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.skill-item:hover {
  transform: translateY(-8px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--secondary);
}

.skill-item:hover::before {
  opacity: 0.2;
}

.skill-item i {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  transition: transform 0.3s ease;
}

.skill-item:hover i {
  transform: scale(1.15);
}

.skill-name {
  font-weight: 500;
  transition: all 0.3s ease;
}

.skill-item:hover .skill-name {
  color: var(--secondary);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  text-align: center;
  position: relative;
  overflow: hidden;
  z-index: 1;
  border: none;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  transition: opacity 0.3s ease;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
}

.btn-primary:hover {
  color: white;
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.5);
}

.btn-outline {
  background: transparent;
  color: var(--secondary);
  border: 1px solid var(--secondary);
}

.btn-outline::before {
  background: var(--gradient-primary);
  opacity: 0;
}

.btn-outline:hover {
  color: white;
  border-color: transparent;
  transform: translateY(-3px) scale(1.03);
}

.btn-outline:hover::before {
  opacity: 1;
}

/* Section headers */
.section-header {
  position: relative;
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  text-align: center;
  animation: fadeIn 0.5s ease-out;
}

.section-header::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

/* Timeline for history/experience */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: var(--gradient-primary);
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  width: calc(50% - 2rem);
  margin-bottom: 3rem;
}

.timeline-item:nth-child(even) {
  margin-left: auto;
}

.timeline-item::after {
  content: '';
  position: absolute;
  top: 20px;
  width: 20px;
  height: 20px;
  background: var(--gradient-primary);
  border-radius: 50%;
  z-index: 1;
}

.timeline-item:nth-child(odd)::after {
  right: -31px;
}

.timeline-item:nth-child(even)::after {
  left: -31px;
}

.timeline-content {
  padding: 1.5rem;
  border-radius: 0.75rem;
  background-color: var(--primary-light);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
}

.timeline-content:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-shadow-hover);
}

.timeline-date {
  color: var(--secondary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Responsive design */
@media (max-width: 768px) {
  .timeline::before {
    left: 20px;
  }
  
  .timeline-item {
    width: calc(100% - 50px);
    margin-left: 50px !important;
  }
  
  .timeline-item::after {
    left: -30px !important;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .nav-container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .nav-links {
    width: 100%;
    justify-content: center;
  }
}

/* Footer */
.modern-footer {
  margin-top: 4rem;
  padding: 2rem 0;
  background-color: var(--blur-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
  display: flex;
  justify-content: center;
  align-items: center;
}

.highlight {
  color: var(--accent);
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-link {
  color: var(--text);
  font-weight: 700;
  transition: transform 0.3s ease;
  display: block;
}

.logo-link:hover {
  color: var(--text);
  text-decoration: none;
  transform: translateY(-2px);
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.25rem;
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
}

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

/* Add animation effects */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.card {
  animation: slideUp 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.profile-section {
  animation: fadeIn 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.section-header {
  animation: fadeIn 0.7s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.extra-margin {
  margin-top: 2.5rem;
}

.extra-padding {
  padding: 2.5rem;
}

.centered-grid {
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.interests-grid {
  max-width: 1000px;
  margin: 0 auto;
}

/* Tech badges */
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background-color: var(--primary);
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.tech-badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.tech-badge:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border-color: transparent;
  color: white;
}

.tech-badge:hover::before {
  opacity: 1;
}

.tech-badge i {
  font-size: 1.125rem;
  transition: transform 0.3s ease;
}

.tech-badge:hover i {
  transform: scale(1.15);
}

/* Theme toggle styles */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 0;
  font-size: 1.1rem;
  margin-left: 0.5rem;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.theme-toggle::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.theme-toggle:hover {
  color: white;
  transform: translateY(-5px) rotate(15deg);
  border-color: transparent;
}

.theme-toggle:hover::before {
  opacity: 1;
}

.light-icon {
  display: none;
}

.dark-icon {
  display: block;
}

:root.light-theme .light-icon {
  display: block;
}

:root.light-theme .dark-icon {
  display: none;
}

/* Coursework section */
.coursework-container {
  margin: 0 auto;
  max-width: 900px;
}

.college {
  margin-bottom: 2rem;
}

.college h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.degree {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.course-item {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  background-color: var(--primary);
  border-radius: 1rem;
  border: 1px solid var(--border);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.course-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.course-item:hover {
  transform: translateY(-5px);
  border-color: transparent;
  box-shadow: var(--card-shadow-hover);
  color: white;
}

.course-item:hover::before {
  opacity: 1;
}

.course-code {
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
}

.course-item:hover .course-code {
  color: white;
}

.course-name {
  color: var(--text);
  transition: color 0.3s ease;
}

.course-item:hover .course-name {
  color: white;
}

/* Page transitions */
.container {
  animation: fadeIn 0.5s ease-out;
}

/* Subtle decorative elements */
.modern-navbar::before,
.modern-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--secondary), transparent);
  opacity: 0.3;
}

.modern-footer::before {
  top: 0;
}

/* More dynamic hover effects */
@media (hover: hover) {
  .skill-item, .course-item, .social-link, .tech-badge, .btn, .nav-link, .card {
    will-change: transform;
  }
}

/* Enhance card content */
.card p {
  line-height: 1.7;
}

/* Improve accessibility for focus states */
a:focus, button:focus {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

button:focus {
  outline-offset: 3px;
}

/* Skip to content for accessibility */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--secondary);
  color: white;
  padding: 0.5rem 1rem;
  z-index: 1001;
  transition: top 0.3s ease;
}

.skip-to-content:focus {
  top: 0;
}
