/* Base Styles */
:root {
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --secondary-color: #8b5cf6;
  --accent-color: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: #e0e7ff;
  --danger-color: #dc3545;
  --success-color: #10b981;

  /* Light Mode Colors */
  --bg-primary: #fafafa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f5f5f5;
  --text-primary: #1a1a1a;
  --text-secondary: #737373;
  --text-tertiary: #a3a3a3;
  --border-color: #e5e5e5;
  --card-bg: #ffffff;
  --navbar-bg: rgba(255, 255, 255, 0.8);

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --box-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Dark Mode */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --border-color: #334155;
  --card-bg: #1e293b;
  --navbar-bg: rgba(15, 23, 42, 0.8);
  --accent-color: #818cf8;
  --accent-hover: #6366f1;
  --accent-light: #1e1b4b;

  --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3),
    0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4),
    0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --box-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5),
    0 10px 10px -5px rgba(0, 0, 0, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-title {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title h2 {
  font-size: 2.5rem;
  font-weight: 700;
  position: relative;
  padding-bottom: 1rem;
  color: var(--text-primary);
  display: inline-block;
}

.underline {
  width: 80px;
  height: 4px;
  background: var(--primary-color);
  margin: 0 auto;
  border-radius: 2px;
}

.btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  border-radius: 12px;
  font-weight: 600;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  position: relative;
  overflow: hidden;
}

.primary-btn {
  background: var(--primary-color);
  color: white;
  box-shadow: var(--box-shadow);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--box-shadow-lg);
  background: var(--primary-hover);
}

.secondary-btn {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.secondary-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--box-shadow);
}

/* Navigation */
nav {
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border-color);
  padding: 1.25rem 0;
  position: sticky;
  top: 0;
  z-index: 9999;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 10000;
}

.logo {
  font-size: 1.75rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease;
  position: relative;
  padding: 0.5rem 0;
}

.nav-links a:hover {
  color: var(--primary-color);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: 0.3s;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

.theme-toggle {
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 50px;
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.theme-toggle:hover {
  border-color: var(--primary-color);
  background: var(--accent-light);
  transform: scale(1.05);
}

.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

[data-theme="light"] .theme-toggle .sun-icon {
  transform: rotate(0deg);
  opacity: 1;
}

[data-theme="light"] .theme-toggle .moon-icon {
  transform: rotate(90deg) scale(0);
  opacity: 0;
  position: absolute;
}

[data-theme="dark"] .theme-toggle .sun-icon {
  transform: rotate(-90deg) scale(0);
  opacity: 0;
  position: absolute;
}

[data-theme="dark"] .theme-toggle .moon-icon {
  transform: rotate(0deg);
  opacity: 1;
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-container {
    padding: 0 1rem;
    flex-wrap: wrap;
  }

  .nav-links {
    flex-direction: column;
    gap: 0;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
    padding: 0;
    background: var(--bg-secondary);
  }

  .nav-links.active {
    max-height: 500px;
    opacity: 1;
    padding: 1rem 0;
  }

  .nav-links li {
    margin: 0;
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 14px 20px;
    width: 100%;
    text-align: left;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
  }

  .nav-links a:hover {
    background: var(--bg-tertiary);
    border-left-color: var(--primary-color);
    padding-left: 28px;
  }

  .theme-toggle {
    margin: 0.5rem 20px;
    width: calc(100% - 40px);
    justify-content: center;
  }
}

/* Hero Section */
.hero {
  padding: 10rem 0 6rem;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
}

.hero-visual {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 400px;
}

.code-block {
  position: relative;
  width: 100%;
  max-width: 500px;
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--box-shadow-xl);
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
}

.code-header {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.code-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.code-dot:nth-child(1) {
  background: #ff5f56;
}
.code-dot:nth-child(2) {
  background: #ffbd2e;
}
.code-dot:nth-child(3) {
  background: #27c93f;
}

.code-content {
  color: var(--text-secondary);
  line-height: 1.8;
}

.code-line {
  display: block;
  padding: 0.1rem 0;
}

.code-comment {
  color: #6a737d;
}
.code-keyword {
  color: #d73a49;
  font-weight: 600;
}
.code-function {
  color: var(--primary-color);
  font-weight: 600;
}
.code-string {
  color: #22863a;
}
.code-number {
  color: #005cc5;
}

.floating-element {
  position: absolute;
  background: var(--primary-color);
  opacity: 0.1;
  border-radius: 50%;
  animation: float 8s ease-in-out infinite;
}

.floating-element:nth-child(1) {
  width: 100px;
  height: 100px;
  top: 10%;
  left: -10%;
  animation-delay: 0s;
}

.floating-element:nth-child(2) {
  width: 150px;
  height: 150px;
  bottom: 20%;
  right: -5%;
  animation-delay: 2s;
}

.floating-element:nth-child(3) {
  width: 80px;
  height: 80px;
  top: 60%;
  left: 10%;
  animation-delay: 4s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) translateX(0px);
  }
  25% {
    transform: translateY(-10px) translateX(10px);
  }
  50% {
    transform: translateY(-20px) translateX(-10px);
  }
  75% {
    transform: translateY(-10px) translateX(5px);
  }
}

.hero-text {
  flex: 1;
  max-width: 600px;
  text-align: left;
}

.hero-text h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text-primary);
  line-height: 1.2;
}

.hero-text h1 span {
  display: block;
  color: var(--primary-color);
}

.hero-text h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.hero-text p {
  font-size: 1.125rem;
  margin-bottom: 2rem;
  color: var(--text-tertiary);
  line-height: 1.8;
}

.hero-btns {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.social-icons {
  display: flex;
  gap: 1rem;
}

.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border-radius: 12px;
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 1.2rem;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.social-icons a:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-3px);
  box-shadow: var(--box-shadow-lg);
  border-color: transparent;
}

/* About Section */
.about {
  padding: 6rem 0;
  background: var(--bg-secondary);
}

.about-content {
  display: flex;
  align-items: center;
  gap: 4rem;
}

.about-image {
  flex: 1;
  text-align: center;
  position: relative;
}

.about-image::before {
  content: "";
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 300px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  opacity: 0.1;
  border-radius: 50%;
  z-index: 0;
}

.about-image img {
  border-radius: 20px;
  box-shadow: var(--box-shadow-xl);
  max-width: 75%;
  position: relative;
  z-index: 1;
  transition: var(--transition);
  border: 3px solid var(--border-color);
  margin: 0 auto;
}

.about-image img:hover {
  transform: scale(1.02);
}

.about-text {
  flex: 1;
}

.about-text h3 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  font-weight: 700;
}

.about-text p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.skills h2 {
  margin-bottom: 1.5rem;
  font-size: 1.75rem;
  color: var(--text-primary);
  font-weight: 700;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skills-list img {
  max-width: 100%;
  height: auto;
}

/* Education Section */
.education {
  padding: 6rem 0;
  background: var(--bg-primary);
}

.timeline {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
}

.timeline::before {
  content: "";
  position: absolute;
  width: 2px;
  height: 100%;
  background: var(--primary-color);
  left: 20px;
  transform: none;
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
}

.timeline-dot {
  width: 16px;
  height: 16px;
  background: var(--primary-color);
  border-radius: 50%;
  position: absolute;
  top: 10px;
  left: 20px;
  transform: translateX(-50%);
  z-index: 1;
}

.timeline-content {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--box-shadow-lg);
  width: calc(100% - 60px);
  margin-left: 60px;
  position: relative;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.timeline-content:hover {
  transform: translateY(-5px);
  box-shadow: var(--box-shadow-xl);
}

.timeline-content::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-right: none;
  border-bottom: none;
  transform: rotate(45deg);
  top: 10px;
  left: -10px;
}

.timeline-content h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 600;
}

.timeline-content h4 {
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.timeline-content p {
  color: var(--text-secondary);
}

.timeline-date {
  color: var(--text-tertiary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

/* Projects Section */
.projects {
  padding: 6rem 0;
  background: var(--bg-secondary);
}

.project-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.filter-btn {
  background: var(--card-bg);
  color: var(--text-secondary);
  border: 2px solid var(--border-color);
  padding: 0.625rem 1.75rem;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}

.filter-btn.active,
.filter-btn:hover {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: var(--box-shadow);
}

.project-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.project-card {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--box-shadow-xl);
  border-color: var(--primary-color);
}

.project-img {
  overflow: hidden;
  height: 220px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  opacity: 0.8;
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover .project-img img {
  transform: scale(1.1);
}

.project-info {
  padding: 1.75rem;
}

.project-info h3 {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  font-weight: 600;
}

.project-info p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.project-tech span {
  background: var(--bg-tertiary);
  padding: 0.4rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.project-links {
  display: flex;
  gap: 1rem;
}

.project-links a {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-color);
  color: white;
  font-size: 1rem;
  transition: var(--transition);
}

.project-links a:hover {
  transform: translateY(-3px) scale(1.1);
  box-shadow: var(--box-shadow-lg);
  background: var(--primary-hover);
}

/* Achievements/Certificates Section */
.achievements {
  padding: 6rem 0;
  background: var(--bg-primary);
}

.slider-container {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

.certificate-card {
  background: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--box-shadow-lg);
  margin: 0 10px;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.certificate-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--box-shadow-xl);
  border-color: var(--primary-color);
}

.certificate-img img {
  width: 100%;
  height: 280px;
  object-fit: contain;
  background: var(--bg-tertiary);
}

.certificate-info {
  padding: 1.75rem;
  text-align: left;
}

.certificate-info h3 {
  margin-bottom: 0.8rem;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.3rem;
}

.certificate-info p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.certificate-date {
  color: var(--text-tertiary);
  margin-top: 0.75rem;
  font-weight: 500;
}

/* Owl Carousel Styles */
.achievement-carousel .owl-nav {
  position: absolute;
  top: 50%;
  width: 100%;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  padding: 0 20px;
}

.achievement-carousel .owl-nav button {
  width: 45px;
  height: 45px;
  border-radius: 50% !important;
  background-color: var(--primary-color) !important;
  color: white !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  pointer-events: all;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.achievement-carousel .owl-nav button:hover {
  background-color: var(--secondary-color) !important;
}

.achievement-carousel .owl-nav button span {
  font-size: 28px;
  line-height: 0;
  position: relative;
  top: -4px;
}

.achievement-carousel .owl-dots {
  margin-top: 20px;
  text-align: center;
}

.achievement-carousel .owl-dots .owl-dot span {
  width: 10px;
  height: 10px;
  margin: 5px;
  background: var(--border-color);
  border-radius: 50%;
  display: block;
  transition: all 0.3s ease;
}

.achievement-carousel .owl-dots .owl-dot.active span {
  background: var(--primary-color);
}

/* Contact Section */
.contact {
  padding: 6rem 0;
  background: var(--bg-secondary);
}

.contact-content {
  display: flex;
  gap: 3rem;
}

.contact-info,
.contact-form {
  flex: 1;
}

.contact-item {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
}

.icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1.5rem;
  color: white;
  font-size: 1.3rem;
  box-shadow: var(--box-shadow);
}

.text h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 600;
}

.text p {
  color: var(--text-secondary);
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.social-links a {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: var(--card-bg);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: var(--transition);
  border: 2px solid var(--border-color);
  box-shadow: var(--box-shadow);
}

.social-links a:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-3px);
  border-color: transparent;
  box-shadow: var(--box-shadow-lg);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-family: "Poppins", sans-serif;
  font-size: 1rem;
  transition: var(--transition);
  background: var(--card-bg);
  color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
  height: 150px;
  resize: none;
}

.form-status {
  margin-top: 1rem;
  padding: 0.7rem;
  border-radius: 5px;
  text-align: center;
}

.success {
  background: var(--success-color);
  color: white;
}

.error {
  background: var(--danger-color);
  color: white;
}

/* Footer */
.footer {
  background: var(--bg-primary);
  color: var(--text-secondary);
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid var(--border-color);
}

/* Media Queries */
@media (max-width: 992px) {
  .hero-visual {
    display: none;
  }

  .hero-content {
    flex-direction: column;
    text-align: center;
  }

  .hero-text {
    max-width: 100%;
    text-align: center;
  }

  .hero-text h1 {
    font-size: 2.75rem;
  }

  .hero-btns {
    justify-content: center;
  }

  .social-icons {
    justify-content: center;
  }

  .about-content {
    flex-direction: column;
  }

  .contact-content {
    flex-direction: column;
  }
}

@media (max-width: 768px) {
  .certificate-card:hover {
    transform: translateY(0px);
  }

  .certificate-card img {
    min-height: 300px;
    height: auto;
  }

  .section-title h2 {
    font-size: 2rem;
  }

  .hero {
    padding: 8rem 0 4rem;
  }

  .hero-content {
    flex-direction: column;
  }

  .hero-text {
    text-align: left;
  }

  .hero-visual {
    order: 2;
  }
}

@media (max-width: 576px) {
  .hero-text {
    text-align: left;
  }

  .hero-text h1 {
    font-size: 2.25rem;
    text-align: left;
  }

  .hero-text h2 {
    font-size: 1.35rem;
    text-align: left;
  }

  .section-title h2 {
    font-size: 2rem;
  }

  .project-container {
    grid-template-columns: 1fr;
  }

  .hero-btns {
    flex-direction: column;
    gap: 0.75rem;
  }

  .btn {
    width: 100%;
  }

  .about-text h3 {
    font-size: 1.75rem;
  }

  .skills-list {
    grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
  }
}
