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

:root {
  --primary-color: #00d4ff;
  --secondary-color: #1a1a2e;
  --accent-color: #16213e;
  --text-color: #ffffff;
  --text-secondary: #b8b8b8;
  --background-color: #0f0f23;
  --card-background: #1a1a2e;
  --border-color: #333;
  --gradient: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
}

[data-theme="light"] {
  --primary-color: #0099cc;
  --secondary-color: #ffffff;
  --accent-color: #f8f9fa;
  --text-color: #333333;
  --text-secondary: #666666;
  --background-color: #ffffff;
  --card-background: #f8f9fa;
  --border-color: #e0e0e0;
}

body {
  font-family: "Poppins", sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
  transition: all 0.3s ease;
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  padding: 1rem 0;
  transition: all 0.3s ease;
}

[data-theme="light"] .navbar {
  background: rgba(255, 255, 255, 0.95);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
}

.nav-logo h2 {
  color: var(--primary-color);
  cursor: pointer;
  transition: transform 0.3s ease;
}

.nav-logo h2:hover {
  transform: scale(1.05);
}

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

.nav-link {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color);
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.theme-toggle {
  background: var(--card-background);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  background: var(--primary-color);
  transform: scale(1.1);
}

.theme-toggle i {
  color: var(--text-color);
  font-size: 1.2rem;
}
/* Added mobile menu toggle styles */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background: var(--primary-color);
  margin: 3px 0;
  transition: 0.3s;
  border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

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

/* Sections */
.section {
  min-height: 100vh;
  padding: 100px 0 50px;
  display: none;
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.6s ease;
}

.section.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

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

.section-title {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 3rem;
  font-weight: 700;
}

.highlight {
  color: var(--primary-color);
}

/* Home Section */
.home-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 0 2rem;
}

.home-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  width: 100%;
  gap: 4rem;
}

.home-text {
  flex: 1;
  max-width: 600px;
}

.home-image {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.home-title {
  font-size: 4rem;
  font-weight: 700;
  margin-bottom: 1rem;
  animation: fadeInUp 1s ease;
}

.home-subtitle {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  color: var(--text-secondary);
  animation: fadeInUp 1s ease 0.2s both;
  min-height: 2rem;
}

.typewriter-text {
  color: var(--primary-color);
  font-weight: 600;
}

.cursor {
  color: var(--primary-color);
  animation: blink 1s infinite;
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

.profile-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.home-profile-img {
  width: 400px;
  height: 400px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid var(--primary-color);
  animation: float 3s ease-in-out infinite;
  box-shadow: 0 20px 40px rgba(0, 212, 255, 0.3);
}

.floating-elements {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.floating-icon {
  position: absolute;
  width: 60px;
  height: 60px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  animation: floatAround 4s ease-in-out infinite;
  animation-delay: var(--delay);
}

.floating-icon:nth-child(1) {
  top: 10%;
  right: 10%;
}
.floating-icon:nth-child(2) {
  bottom: 20%;
  left: 5%;
}
.floating-icon:nth-child(3) {
  top: 20%;
  left: 10%;
}
.floating-icon:nth-child(4) {
  bottom: 10%;
  right: 15%;
}

@keyframes floatAround {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  25% {
    transform: translateY(-20px) rotate(90deg);
  }
  50% {
    transform: translateY(-10px) rotate(180deg);
  }
  75% {
    transform: translateY(-15px) rotate(270deg);
  }
}

.home-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
  animation: fadeInUp 1s ease 0.4s both;
}

.btn {
  padding: 12px 24px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

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

.btn-primary:hover {
  background: #0099cc;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 212, 255, 0.3);
}

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

.btn-secondary:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  animation: fadeInUp 1s ease 0.6s both;
}

.social-link {
  width: 50px;
  height: 50px;
  background: var(--card-background);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 1.2rem;
}

.social-link:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 212, 255, 0.3);
}

.copyright {
  animation: fadeInUp 1s ease 0.8s both;
}

.copyright p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* About Section */
.about-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
  align-items: center;
}

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

.profile-img {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid var(--primary-color);
  animation: float 3s ease-in-out infinite;
}

.about-text h3 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.about-text p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  color: var(--text-secondary);
}

.about-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-item {
  font-size: 1rem;
  color: var(--text-secondary);
}

.detail-item strong {
  color: var(--text-color);
}

/* Education Section */
.education-content {
  max-width: 800px;
  margin: 0 auto;
}

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

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--primary-color);
}

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

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary-color);
  border: 4px solid var(--background-color);
}

.timeline-content {
  background: var(--card-background);
  padding: 2rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.timeline-content:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 212, 255, 0.1);
}

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

.timeline-content h4 {
  color: var(--text-color);
  margin-bottom: 1rem;
}

.timeline-date,
.timeline-grade {
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: block;
  margin-bottom: 0.5rem;
}

/* Skills Section */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.skill-card {
  background: var(--card-background);
  border: 2px solid var(--primary-color);
  border-radius: 15px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.skill-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-color);
}

.skill-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 212, 255, 0.2);
}

.skill-card h3 {
  color: var(--primary-color);
  font-size: 1.5rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.skill-card p {
  color: var(--text-color);
  font-size: 1rem;
  line-height: 1.6;
}

/* Projects Section */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.project-card {
  background: var(--card-background);
  border: 2px solid var(--primary-color);
  border-radius: 15px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 500px;
}

.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-color);
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 212, 255, 0.2);
}

.project-icon {
  width: 80px;
  height: 80px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2rem;
  color: white;
}

.project-card h3 {
  color: var(--text-color);
  font-size: 1.3rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.project-card p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
  font-size: 0.95rem;
  flex-grow: 1;
}

.project-tech {
  margin-bottom: 2rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-style: italic;
}

.project-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: auto;
}

.project-btn {
  padding: 12px 24px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

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

.project-btn-primary:hover {
  background: #0099cc;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 212, 255, 0.3);
}

.project-btn-secondary {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.project-btn-secondary:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

/* Contact Section */
.contact-content {
  max-width: 800px;
  margin: 0 auto;
}

.contact-form {
  background: var(--card-background);
  padding: 3rem;
  border-radius: 15px;
  border: 1px solid var(--border-color);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem;
  background: var(--background-color);
  border: 2px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-color);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-secondary);
}

.submit-btn {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  margin-top: 1rem;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* Enhanced responsive design with better mobile breakpoints */
@media (max-width: 1024px) {
  .nav-container {
    padding: 0 1.5rem;
  }

  .home-content {
    gap: 3rem;
  }

  .home-profile-img {
    width: 350px;
    height: 350px;
  }

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

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

@media (max-width: 768px) {
  .nav-container {
    padding: 0 1rem;
  }

  /* Mobile navigation menu styles */
  .mobile-menu-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--card-background);
    flex-direction: column;
    padding: 2rem 0;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border-top: 1px solid var(--border-color);
  }

  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-menu .nav-link {
    padding: 1rem 2rem;
    width: 100%;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-menu .theme-toggle {
    margin: 1rem auto 0;
  }

  /* Improved mobile home section layout */
  .home-container {
    padding: 2rem 1rem;
    min-height: calc(100vh - 80px);
  }

  .home-content {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
    max-width: 100%;
  }

  .home-text {
    order: 2;
    max-width: 100%;
  }

  .home-image {
    order: 1;
  }

  .home-title {
    font-size: 2.5rem;
    line-height: 1.2;
  }

  .home-subtitle {
    font-size: 1.2rem;
  }

  .home-buttons {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

  .social-links {
    justify-content: center;
  }

  /* Better mobile layout for about section */
  .about-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }

  .profile-img {
    width: 250px;
    height: 250px;
  }

  /* Mobile-optimized form layout */
  .form-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .contact-form {
    padding: 2rem 1.5rem;
  }

  .section-title {
    font-size: 2.2rem;
  }

  .container {
    padding: 0 1rem;
  }

  .home-profile-img {
    width: 280px;
    height: 280px;
  }

  .floating-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  /* Improved project buttons layout for mobile */
  .project-buttons {
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
  }

  .project-btn {
    width: 100%;
    max-width: 200px;
    justify-content: center;
  }

  /* Better timeline layout for mobile */
  .timeline {
    padding-left: 1.5rem;
  }

  .timeline-item {
    padding-left: 1.5rem;
  }

  .timeline-content {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .nav-container {
    padding: 0 0.8rem;
  }

  .nav-logo h2 {
    font-size: 1.3rem;
  }

  /* Extra small screen optimizations */
  .home-container {
    padding: 1.5rem 0.8rem;
  }

  .home-title {
    font-size: 1.8rem;
  }

  .home-subtitle {
    font-size: 1rem;
  }

  .home-profile-img {
    width: 220px;
    height: 220px;
  }

  .floating-icon {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .container {
    padding: 0 0.8rem;
  }

  .contact-form {
    padding: 1.5rem 1rem;
  }

  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  /* Smaller skill cards for mobile */
  .skills-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .skill-card {
    padding: 1.5rem;
  }

  .skill-card h3 {
    font-size: 1.2rem;
  }

  /* Single column projects on small screens */
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .project-card {
    padding: 1.5rem;
    min-height: auto;
  }

  .project-icon {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }
}

/* Added touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
  .btn:hover,
  .social-link:hover,
  .nav-link:hover,
  .theme-toggle:hover {
    transform: none;
  }

  .btn:active,
  .social-link:active {
    transform: scale(0.95);
  }
}

/* Improved landscape orientation support */
@media (max-height: 500px) and (orientation: landscape) {
  .home-container {
    min-height: auto;
    padding: 1rem;
  }

  .home-content {
    flex-direction: row;
    align-items: center;
  }

  .home-profile-img {
    width: 200px;
    height: 200px;
  }

  .floating-icon {
    display: none;
  }
}
