/* Basic CSS reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Light mode colors */
  --primary-blue: #4A90E2;
  --dark-blue: #1E3A8A;
  --light-blue: #87CEEB;
  --black: #1a1a1a;
  --dark-grey: #2d3748;
  --medium-grey: #4a5568;
  --light-grey: #e2e8f0;
  --white: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #4a5568;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
}

[data-theme="dark"] {
  /* Dark mode colors */
  --text-primary: #e2e8f0;
  --text-secondary: #cbd5e0;
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d3748;
  --bg-card: #2d3748;
  --light-grey: #4a5568;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  position: relative;
  z-index: 1; /* Ensure content stays above particles */
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  background: linear-gradient(135deg, rgba(26, 26, 26, 0.95) 0%, rgba(74, 144, 226, 0.1) 100%);
  color: var(--white);
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem;
  position: relative;
  z-index: 2;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.nav-links li {
  margin: 0;
}

.nav-links a {
  color: white;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: var(--primary-blue);
}

/* Theme Toggle Button */
.theme-toggle {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50px;
  padding: 0.25rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  backdrop-filter: blur(10px);
  width: 60px;
  height: 30px;
}

.theme-toggle:hover {
  background: rgba(74, 144, 226, 0.2);
  border-color: var(--primary-blue);
  transform: scale(1.05);
}

.toggle-slider {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}

.toggle-circle {
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  position: absolute;
  left: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Dark mode styles */
[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .theme-toggle {
  background: rgba(74, 144, 226, 0.2);
  border-color: var(--primary-blue);
}

[data-theme="dark"] .toggle-circle,
html[data-theme="dark"] .toggle-circle {
  transform: translateX(28px);
  background: var(--primary-blue);
}

/* Light mode styles */
[data-theme="light"] .theme-toggle,
html[data-theme="light"] .theme-toggle,
:root .theme-toggle {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .toggle-circle,
html[data-theme="light"] .toggle-circle,
:root .toggle-circle {
  transform: translateX(0);
  background: white;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
}

.hero {
  text-align: center;
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* Profile Image Styles */
.profile-image-container {
  position: relative;
  width: 180px;
  height: 180px;
  margin-bottom: 1rem;
}

.profile-image {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  border: 4px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  z-index: 2;
  position: relative;
  display: block;
}

.profile-image:hover {
  transform: scale(1.05);
  border-color: var(--primary-blue);
  box-shadow: 0 12px 40px rgba(74, 144, 226, 0.4);
}

.profile-ring {
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border: 2px solid transparent;
  border-radius: 50%;
  background: linear-gradient(45deg, var(--primary-blue), var(--light-blue), var(--primary-blue));
  background-size: 200% 200%;
  animation: profileRingRotate 4s linear infinite;
  z-index: 1;
  opacity: 0.7;
}

@keyframes profileRingRotate {
  0% {
    background-position: 0% 50%;
    transform: rotate(0deg);
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
    transform: rotate(360deg);
  }
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  margin-top: 1rem;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}

.cta-btn {
  display: inline-block;
  background: var(--primary-blue);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.cta-btn:hover {
  background: var(--dark-blue);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(74, 144, 226, 0.4);
}

main {
  padding: 4rem 2rem;
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  background: var(--bg-card);
  border-radius: 16px;
  margin-top: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--light-grey);
  transition: all 0.3s ease;
}

section {
  margin-bottom: 4rem;
}

section h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  text-align: center;
  color: var(--text-primary);
  position: relative;
}

section h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-blue), var(--light-blue));
  border-radius: 2px;
}

.about-section p {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.services-section .service-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.services-section .card {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
  transition: all 0.3s;
  border: 1px solid var(--light-grey);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.services-section .card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 24px rgba(74, 144, 226, 0.15);
  border-color: var(--primary-blue);
}

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

.projects-section .project {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--light-grey);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.projects-section .project:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(74, 144, 226, 0.1);
  border-color: var(--primary-blue);
}

/* Project media styles */
.project-media {
  margin-top: 1rem;
}

/* YouTube preview styles */
.youtube-preview {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.youtube-preview iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

/* GitHub link preview styles */
.github-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease;
}

.github-link:hover {
  transform: translateY(-2px);
}

.github-preview {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--black) 0%, var(--dark-grey) 100%);
  color: white;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--light-grey);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.github-preview:hover {
  box-shadow: 0 8px 20px rgba(74, 144, 226, 0.2);
  transform: translateY(-2px);
}

.github-icon {
  margin-right: 1rem;
  flex-shrink: 0;
}

.github-icon svg {
  width: 32px;
  height: 32px;
}

.github-content h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  color: #ffffff;
}

.github-content p {
  margin: 0;
  font-size: 0.9rem;
  color: #d1d5da;
  line-height: 1.4;
}

/* Certifications Section */
.certifications-section {
  margin-bottom: 4rem;
}

.certifications-section > p {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.certification-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
  justify-content: center;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.certification-card {
  background: var(--bg-secondary);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--light-grey);
  transition: all 0.3s ease;
}

.certification-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(74, 144, 226, 0.15);
  border-color: var(--primary-blue);
}

.cert-image-container {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: var(--light-grey);
  cursor: pointer;
}

.cert-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.cert-image-container:hover .cert-image {
  transform: scale(1.05);
}

.cert-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(26, 26, 26, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cert-image-container:hover .cert-overlay {
  opacity: 1;
}

.cert-view-text {
  color: white;
  font-weight: 600;
  font-size: 1rem;
}

.cert-placeholder {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-align: center;
}

.cert-placeholder span {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.cert-placeholder p {
  font-size: 1rem;
  margin: 0;
}

.cert-info {
  padding: 1.5rem;
}

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

.cert-issuer {
  color: var(--primary-blue);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.cert-date {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .youtube-preview {
    padding-bottom: 75%; /* More square on mobile */
  }
  
  .github-preview {
    flex-direction: column;
    text-align: center;
  }
  
  .github-icon {
    margin-right: 0;
    margin-bottom: 0.5rem;
  }
  
  .certification-grid {
    grid-template-columns: 1fr;
  }
  
  .cert-image-container {
    height: 250px;
  }
}

/* Blog Section */
.blog-section {
  margin-bottom: 4rem;
}

.blog-section > p {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

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

.blog-card {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--light-grey);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(74, 144, 226, 0.15);
  border-color: var(--primary-blue);
}

.blog-card.featured {
  border: 2px solid var(--primary-blue);
  background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(74, 144, 226, 0.05) 100%);
}

.blog-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.medium-logo,
.article-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-blue);
  color: white;
  border-radius: 8px;
  font-size: 1.2rem;
}

.article-icon {
  background: var(--medium-grey);
}

.blog-platform {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.blog-content {
  flex-grow: 1;
  margin-bottom: 1.5rem;
}

.blog-content h3 {
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  line-height: 1.4;
}

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

.blog-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.blog-meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.blog-actions {
  display: flex;
  gap: 1rem;
}

.blog-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: transparent;
  border: 2px solid var(--primary-blue);
  color: var(--primary-blue);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.blog-link:hover {
  background: var(--primary-blue);
  color: white;
  transform: translateY(-2px);
}

.blog-link.primary {
  background: var(--primary-blue);
  color: white;
}

.blog-link.primary:hover {
  background: var(--dark-blue);
}

.external-icon {
  font-size: 1rem;
  transition: transform 0.3s ease;
}

.blog-link:hover .external-icon {
  transform: translate(2px, -2px);
}

.blog-cta {
  text-align: center;
  margin-top: 3rem;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(74, 144, 226, 0.05) 0%, rgba(74, 144, 226, 0.1) 100%);
  border-radius: 16px;
  border: 1px solid rgba(74, 144, 226, 0.2);
}

.blog-cta p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Responsive adjustments for blog */
@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
  
  .blog-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .blog-actions {
    flex-direction: column;
  }
  
  /* Profile image responsive */
  .profile-image-container {
    width: 150px;
    height: 150px;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 480px) {
  .profile-image-container {
    width: 120px;
    height: 120px;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1.1rem;
  }
}

.contact-section form {
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.contact-section input,
.contact-section textarea {
  padding: 0.75rem;
  margin-bottom: 1rem;
  border: 2px solid var(--light-grey);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: inherit;
  transition: border-color 0.3s ease;
}

.contact-section input:focus,
.contact-section textarea:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.contact-section button {
  padding: 0.75rem 2rem;
  background: var(--primary-blue);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  transition: all 0.3s ease;
  cursor: pointer;
}

.contact-section button:hover {
  background: var(--dark-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.site-footer {
  background: var(--black);
  color: white;
  text-align: center;
  padding: 3rem 2rem 2rem 2rem;
  margin-top: 4rem;
}

/* Social Media Buttons */
.social-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.social-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  min-width: 120px;
  justify-content: center;
}

.social-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* GitHub Button */
.social-btn.github:hover {
  background: #333;
  border-color: #555;
  color: white;
}

/* Gmail Button */
.social-btn.gmail:hover {
  background: #EA4335;
  border-color: #EA4335;
  color: white;
}

/* LinkedIn Button */
.social-btn.linkedin:hover {
  background: #0077B5;
  border-color: #0077B5;
  color: white;
}

.social-btn svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.social-btn span {
  font-size: 1rem;
  white-space: nowrap;
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    text-align: center;
  }

  .nav-links {
    justify-content: center;
    width: 100%;
    margin-top: 1rem;
  }

  .logo {
    width: 100%;
    text-align: center;
  }

  .site-header {
    padding: 1rem;
  }

  main {
    padding: 2rem 1rem;
    margin: 1rem;
  }

  .projects-section .project {
    padding: 1rem;
  }

  .hero {
    padding: 2rem 1rem;
  }

  /* Responsive design for social buttons */
  .social-links {
    gap: 1rem;
  }
  
  .social-btn {
    padding: 0.875rem 1.25rem;
    min-width: 100px;
    gap: 0.5rem;
  }
  
  .social-btn span {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .social-links {
    flex-direction: column;
    align-items: center;
  }
  
  .social-btn {
    width: 200px;
  }
}

/* Particles.js background styling */
#particles-js {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: auto; /* Allow particles to be interactive with mouse */
}
