@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap");

:root {
  /* Dark theme colors */
  --primary-color: #6366f1;
  --secondary-color: #8b5cf6;
  --accent-color: #10b981;
  --bg-primary: #0f0f23;
  --bg-secondary: #1a1a2e;
  --bg-card: #16213e;
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border-color: #374151;
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-hero: linear-gradient(90deg, #000000, #3533cd);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  /* Light theme colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --border-color: #e5e7eb;
  --gradient-hero: linear-gradient(90deg, #f0f9ff, #dbeafe);
}

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

body {
  font-family: "Space Grotesk", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  transition: var(--transition);
  line-height: 1.6;
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(15, 15, 35, 0.95);
  backdrop-filter: blur(20px);
  z-index: 1000;
  transition: var(--transition);
  border-bottom: 1px solid var(--border-color);
}

[data-theme="light"] .navbar {
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid #e5e7eb;
}

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

.nav-logo .logo-text {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.5rem;
  font-weight: 600;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.nav-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  transition: var(--transition);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link:hover {
  color: var(--primary-color);
  background: rgba(99, 102, 241, 0.1);
}

[data-theme="light"] .nav-link:hover {
  background: rgba(99, 102, 241, 0.08);
}

.nav-link i {
  font-size: 1rem;
}

/* Theme Toggle */
.theme-toggle {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 50px;
  padding: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  margin-left: 1rem;
}

[data-theme="light"] .theme-toggle {
  background: #f8fafc;
  border-color: #d1d5db;
}

.theme-toggle:hover {
  border-color: var(--primary-color);
}

.theme-toggle i {
  font-size: 1.2rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

.theme-toggle.light i.fa-sun {
  color: #f59e0b;
}

.theme-toggle.dark i.fa-moon {
  color: var(--primary-color);
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  z-index: 1001;
  position: relative;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--text-primary);
  margin: 3px 0;
  transition: var(--transition);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: var(--gradient-hero);
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, rgba(53, 51, 205, 0.1) 0%, transparent 50%);
}

[data-theme="light"] .hero-background {
  background: radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
}

.code-rain {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(90deg, transparent 98%, rgba(53, 51, 205, 0.3) 100%),
    linear-gradient(180deg, transparent 98%, rgba(53, 51, 205, 0.3) 100%);
  background-size: 50px 50px;
  animation: matrix 20s linear infinite;
}

[data-theme="light"] .code-rain {
  background-image: linear-gradient(90deg, transparent 98%, rgba(59, 130, 246, 0.2) 100%),
    linear-gradient(180deg, transparent 98%, rgba(59, 130, 246, 0.2) 100%);
}

@keyframes matrix {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(100%);
  }
}

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

.hero-content {
  display: grid;
  grid-template-columns: 1fr 500px;
  gap: 4rem;
  align-items: center;
  z-index: 2;
  position: relative;
  min-height: 80vh;
}

.hero-text h1 {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.1;
}

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

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.6;
  font-weight: 400;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.btn {
  padding: 1rem 2rem;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  font-family: inherit;
}

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

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(99, 102, 241, 0.4);
}

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

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

.hero-image {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin-top: 0;
}

.profile-container {
  position: relative;
  width: 100%;
  max-width: 500px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.profile-img {
  width: 70%;
  height: auto;
  object-fit: cover;
  transition: var(--transition);
}

/* Section Styles */
section {
  padding: 5rem 0;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-line {
  width: 100px;
  height: 4px;
  background: var(--gradient-primary);
  margin: 0 auto;
  border-radius: 2px;
}

/* About Section */
.about {
  background: var(--bg-secondary);
}

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

.about-text h3 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
  font-weight: 600;
}

.location {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
}

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

.about-stats {
  display: flex;
  gap: 2rem;
}

.stat {
  text-align: center;
  padding: 1.5rem;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.stat:hover {
  transform: translateY(-5px);
  border-color: var(--primary-color);
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
}

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

.about-image {
  display: flex;
  justify-content: center;
}

.about-profile-img {
  width: 300px;
  height: 300px;
  border-radius: 20px;
  object-fit: cover;
  border: 3px solid var(--primary-color);
  box-shadow: 0 15px 40px rgba(99, 102, 241, 0.2);
}

/* Portfolio Section */
.portfolio {
  background: var(--bg-primary);
}

.portfolio-filters {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.75rem 1.5rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 25px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
  font-family: inherit;
}

.filter-btn.active,
.filter-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: rgba(99, 102, 241, 0.1);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.portfolio-item {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

.portfolio-item:hover {
  transform: translateY(-10px);
  border-color: var(--primary-color);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.2);
}

.portfolio-image {
  position: relative;
  height: 250px;
  overflow: hidden;
}

.portfolio-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.portfolio-info {
  padding: 1.5rem;
}

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

.portfolio-category {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.view-details-btn {
  padding: 0.5rem 1rem;
  background: var(--gradient-primary);
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  font-size: 0.9rem;
}

.view-details-btn:hover {
  transform: scale(1.05);
}

/* Articles Section */
.articles {
  background: var(--bg-secondary);
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.article-card {
  background: var(--bg-card);
  border-radius: 15px;
  padding: 2rem;
  border: 1px solid var(--border-color);
  transition: var(--transition);
  cursor: pointer;
}

.article-card:hover {
  transform: translateY(-10px);
  border-color: var(--primary-color);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.1);
}

.article-card h3 {
  color: var(--text-primary);
  font-size: 1.25rem;
  margin-bottom: 1rem;
  line-height: 1.4;
  font-weight: 600;
}

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

.article-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.read-more {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.read-more:hover {
  gap: 1rem;
}

/* Testimonials Section */
.testimonials {
  background: var(--bg-primary);
}

.testimonials-slider {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.testimonial-card {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: 15px;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.testimonial-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary-color);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.1);
}

.stars {
  color: #fbbf24;
  margin-bottom: 1rem;
}

.testimonial-content p {
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.testimonial-author img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

.author-info h4 {
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.author-info span {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  margin: 2% auto;
  padding: 0;
  border-radius: 15px;
  width: 90%;
  max-width: 1000px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border-color);
}

.close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  color: var(--text-primary);
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  z-index: 2001;
  transition: var(--transition);
}

.close:hover {
  color: var(--primary-color);
}

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 2rem;
}

.modal-media img {
  width: 100%;
  border-radius: 10px;
}

.video-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.modal-info h2 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-weight: 600;
}

.modal-meta {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.modal-section {
  margin-bottom: 2rem;
}

.modal-section h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skills-list span {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary-color);
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-size: 0.8rem;
  border: 1px solid var(--primary-color);
}

.modal-section ul {
  list-style: none;
  padding-left: 0;
}

.modal-section li {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  position: relative;
  padding-left: 1.5rem;
}

.modal-section li::before {
  content: "▶";
  color: var(--primary-color);
  position: absolute;
  left: 0;
}

.project-link {
  text-decoration: none;
  color: inherit;
}

.link-preview {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.link-preview:hover {
  border-color: var(--primary-color);
}

.link-preview img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 5px;
}

.link-info h4 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

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

/* Footer */
.footer {
  background: var(--bg-secondary);
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
}

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

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

.social-link {
  color: var(--text-secondary);
  font-size: 1.5rem;
  transition: var(--transition);
  padding: 0.5rem;
  border-radius: 8px;
}

.social-link:hover {
  color: var(--primary-color);
  background: rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
    align-items: center;
  }

  .hero-content .hero-text {
    order: 2;
  }

  .hero-content .hero-image {
    order: 1;
    margin-top: 0;
  }

  .hero-text h1 {
    font-size: 2.5rem;
  }

  .profile-container {
    max-width: 300px;
    margin: 0 auto;
  }

  .about-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .modal-body {
    grid-template-columns: 1fr;
  }

  .about-stats {
    justify-content: center;
    flex-wrap: wrap;
  }

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

  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .articles-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .testimonials-slider {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

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

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

  .portfolio-filters {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

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

  .container {
    padding: 0 1rem;
  }

  .nav-container {
    padding: 1rem;
  }
}

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

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .profile-container {
    max-width: 250px;
  }

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

  .stat {
    padding: 1rem;
  }

  .modal-content {
    width: 95%;
    margin: 5% auto;
  }

  .modal-body {
    padding: 1rem;
    gap: 1rem;
  }
}

/* Animation Classes */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.3s ease;
}

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

.slide-in-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.3s ease;
}

.slide-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.slide-in-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.3s ease;
}

.slide-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    left: -100%;
    top: 0;
    flex-direction: column;
    background-color: var(--bg-card);
    width: 100vw;
    height: 100vh;
    text-align: center;
    transition: left 0.3s ease-in-out;
    box-shadow: 0 10px 27px rgba(0, 0, 0, 0.1);
    padding: 6rem 2rem 2rem;
    z-index: 998;
    justify-content: flex-start;
    align-items: center;
    gap: 2rem;
    overflow-y: auto;
  }

  [data-theme="light"] .nav-menu {
    background-color: #ffffff;
  }

  .nav-menu.active {
    left: 0;
  }

  .nav-menu li {
    margin: 0;
    width: 100%;
    max-width: 300px;
  }

  .nav-link {
    padding: 1.2rem 2rem;
    font-size: 1.1rem;
    width: 100%;
    justify-content: center;
    border-radius: 12px;
    margin-bottom: 0.5rem;
  }

  .nav-link:hover {
    background: rgba(99, 102, 241, 0.1);
    transform: translateX(5px);
  }

  .theme-toggle {
    margin: 1rem 0 0 0;
    position: relative;
  }

  .hamburger {
    z-index: 999;
    position: relative;
  }

  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
}
