/* ==========================================================================
   CSS Variables & Theme Definitions
   ========================================================================== */

/* Base color definitions */
:root {
  --primary: #0066FF;
  --primary-dark: #0052cc;
  --accent: #7928CA;
  --accent-end: #FF0080;
  --bg-light: #FFFFFF;
  --bg-dark: #0A0A0A;
  --text-light: #000000;
  --text-dark: #FFFFFF;
  --gray-light: #F5F5F5;
  --gray-dark: #1A1A1A;
  --gray-medium: #666666;
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 25px 50px rgba(0, 0, 0, 0.25);
}

/* Dark theme overrides */
[data-theme="dark"] {
  --bg-color: var(--bg-dark);
  --text-color: var(--text-dark);
  --card-bg: var(--gray-dark);
  --border-color: rgba(255, 255, 255, 0.1);
}

/* Light theme overrides */
[data-theme="light"] {
  --bg-color: var(--bg-light);
  --text-color: var(--text-light);
  --card-bg: var(--bg-light);
  --border-color: rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.5s ease, color 0.5s ease;
}

/* Progress Bar */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent-end));
  width: 0%;
  z-index: 10000;
  transition: width 0.1s ease;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

/* Compact Navigation Styles */
.compact-nav {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  display: flex;
  align-items: center;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 5px;
}

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

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 20px;
}

.nav-link {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

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

.nav-link.active {
  color: var(--primary);
  font-weight: 600;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary);
  transform: translateX(-50%);
  transition: width 0.3s ease;
}

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

/* Mobile Navigation */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }
  
  .nav-menu {
    position: fixed;
    top: 70px;
    left: 0;
    flex-direction: column;
    background: var(--card-bg);
    border-radius: 0 12px 12px 0;
    box-shadow: var(--shadow-lg);
    padding: 15px;
    width: 200px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    border: 1px solid var(--border-color);
    border-left: none;
  }
  
  .nav-menu.active {
    transform: translateX(0);
  }
  
  .nav-menu li {
    margin: 8px 0;
  }
  
  .nav-link {
    display: block;
    padding: 12px 15px;
  }
  
  .nav-link::after {
    display: none;
  }
}

/* Desktop Navigation */
@media (min-width: 769px) {
  .nav-menu {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 8px 15px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
  }
  
  [data-theme="dark"] .nav-menu {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

/* Hero section mobile-first approach */
.hero-image.mobile-first {
  display: flex;
  justify-content: center;
}

.hero-image.desktop-only {
  display: none;
}

@media (min-width: 993px) {
  .hero-image.mobile-first {
    display: none;
  }
  
  .hero-image.desktop-only {
    display: flex;
    justify-content: center;
  }
}

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

.section {
  min-height: 100vh;
  padding: 80px 0;
  position: relative;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  padding: 0;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: linear-gradient(135deg, var(--primary), var(--accent-end));
  opacity: 0.9;
}

#particles-js {
  width: 100%;
  height: 100%;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.hero-text {
  animation: fadeInUp 1s ease-out;
}

.hero-name {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  position: relative;
  display: flex;
  flex-wrap: wrap;
}

.name-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(50px);
  animation: charReveal 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.name-char:nth-child(1) { animation-delay: 0.1s; }
.name-char:nth-child(2) { animation-delay: 0.2s; }
.name-char:nth-child(3) { animation-delay: 0.3s; }
.name-char:nth-child(4) { animation-delay: 0.4s; }
.name-char:nth-child(5) { animation-delay: 0.5s; }
.name-char:nth-child(6) { animation-delay: 0.6s; }
.name-char.space { width: 0.3em; }
.name-char:nth-child(8) { animation-delay: 0.8s; }
.name-char:nth-child(9) { animation-delay: 0.9s; }
.name-char:nth-child(10) { animation-delay: 1.0s; }
.name-char:nth-child(11) { animation-delay: 1.1s; }
.name-char:nth-child(12) { animation-delay: 1.2s; }

.hero-subtitle {
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  font-weight: 600;
  margin-bottom: 1.5rem;
  min-height: 2.5rem;
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.typed-text {
  color: white;
  display: inline-block;
  min-height: 1.5em;
  white-space: nowrap;
}

.cursor-blink {
  display: none;
}

.hero-description {
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
  max-width: 600px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.7;
  text-align: justify;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeIn 1s ease-out 0.5s both;
}

.profile-frame {
  position: relative;
  width: 300px;
  height: 300px;
  border-radius: 50px;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  border: 5px solid rgba(255, 255, 255, 0.2);
  animation: float 6s ease-in-out infinite;
  margin: 0 auto;
}

.profile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  border-radius: 50px;
}

.profile-frame:hover .profile-image {
  transform: scale(1.05);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-block;
  padding: 1rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  backdrop-filter: blur(10px);
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.btn:hover::before {
  transform: translateX(100%);
}

.btn-primary {
  background: linear-gradient(90deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 4px 15px rgba(0, 102, 255, 0.4);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 102, 255, 0.6);
}

.btn-secondary {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-3px);
}

/* ==========================================================================
   Section Headers
   ========================================================================== */

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

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent-end));
  border-radius: 2px;
}

.section-subtitle {
  font-size: 1.2rem;
  color: var(--gray-medium);
  max-width: 600px;
  margin: 0 auto;
}

/* ==========================================================================
   Projects Section
   ========================================================================== */

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

.filter-btn {
  background: transparent;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.filter-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.filter-btn:hover::before,
.filter-btn.active::before {
  opacity: 0.1;
}

.filter-btn:hover,
.filter-btn.active {
  color: var(--primary);
  border-color: var(--primary);
}

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

.project-card {
  background: var(--card-bg);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  position: relative;
  border: 1px solid var(--border-color);
  transform-style: preserve-3d;
  perspective: 1000px;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

.project-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover .project-image img {
  transform: scale(1.1);
}

.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 1rem;
}

.featured-badge {
  background: linear-gradient(90deg, var(--accent), var(--accent-end));
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(121, 40, 202, 0.3);
}

.project-content {
  padding: 1.5rem;
}

.project-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.project-description {
  color: var(--gray-medium);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tag {
  background: rgba(0, 102, 255, 0.1);
  color: var(--primary);
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 500;
}

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

.btn-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  position: relative;
  padding: 0.5rem 0;
  transition: all 0.3s ease;
}

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

.btn-link:hover::after {
  width: 100%;
}

.btn-link.live {
  color: var(--accent-end);
}

.btn-link.live::after {
  background: var(--accent-end);
}

/* ==========================================================================
   Videos Section
   ========================================================================== */

.video-section {
  background: var(--gray-light);
}

[data-theme="dark"] .video-section {
  background: var(--gray-dark);
}

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

.video-card-link {
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease;
}

.video-card-link:hover {
  transform: translateY(-5px);
}

.video-card {
  background: var(--card-bg);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

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

.video-thumbnail {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.video-card:hover .video-thumbnail img {
  transform: scale(1.1);
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-card:hover .video-overlay {
  opacity: 1;
}

.video-overlay i {
  color: white;
  font-size: 3rem;
  transition: transform 0.3s ease;
}

.video-card:hover .video-overlay i {
  transform: scale(1.1);
}

.video-content {
  padding: 1.5rem;
}

.video-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.video-description {
  color: var(--gray-medium);
  line-height: 1.6;
}

/* ==========================================================================
   Contact Section
   ========================================================================== */

.contact-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 3rem;
  align-items: start;
}

.contact-info {
  display: grid;
  gap: 2rem;
}

.contact-card {
  text-align: center;
  padding: 2rem;
  background: var(--card-bg);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

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

.contact-card i {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.contact-card h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.contact-card a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.contact-card a:hover {
  color: var(--primary-dark);
}

.contact-card p {
  font-weight: 500;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50px;
  background: var(--card-bg);
  color: var(--text-color);
  font-size: 1.5rem;
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.social-link:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: var(--shadow-lg);
  color: var(--primary);
  background: rgba(0, 102, 255, 0.1);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  background: var(--gray-light);
  padding: 3rem 0;
  border-top: 1px solid var(--border-color);
  border-radius: 20px 20px 0 0;
}

[data-theme="dark"] .footer {
  background: var(--gray-dark);
}

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

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

.footer-status {
  display: inline-block;
  background: rgba(0, 102, 255, 0.1);
  color: var(--primary);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
}

.footer-copyright p {
  color: var(--gray-medium);
}

/* ==========================================================================
   Command Palette
   ========================================================================== */

.command-palette {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.command-palette.active {
  opacity: 1;
  visibility: visible;
}

.command-palette-content {
  background: var(--card-bg);
  width: 90%;
  max-width: 600px;
  border-radius: 20px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  border: 1px solid var(--border-color);
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.command-palette.active .command-palette-content {
  transform: translateY(0);
}

#commandInput {
  width: 100%;
  padding: 1.5rem;
  border: none;
  background: transparent;
  color: var(--text-color);
  font-size: 1.1rem;
  border-bottom: 1px solid var(--border-color);
  outline: none;
}

.command-list {
  list-style: none;
  max-height: 400px;
  overflow-y: auto;
}

.command-list li {
  padding: 1rem 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid var(--border-color);
}

.command-list li:last-child {
  border-bottom: none;
}

.command-list li:hover,
.command-list li.active {
  background: rgba(0, 102, 255, 0.1);
  color: var(--primary);
}

/* ==========================================================================
   Dark Mode Toggle
   ========================================================================== */

.dark-mode-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--card-bg);
  color: var(--text-color);
  border: 2px solid var(--primary);
  border-radius: 50px;
  width: 50px;
  height: 50px;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 102, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dark-mode-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 102, 255, 0.3);
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes charReveal {
  0% {
    opacity: 0;
    transform: translateY(50px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ==========================================================================
   Responsive Media Queries
   ========================================================================== */

@media (max-width: 992px) {
  .hero-content {
    grid-template-columns: 1fr;
    grid-template-areas: 
      "image"
      "text";
    gap: 2rem;
    justify-items: center;
  }
  
  .hero-image.mobile-first {
    grid-area: image;
    display: flex;
    justify-content: center;
    width: 100%;
  }
  
  .hero-text {
    grid-area: text;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .hero-description {
    text-align: center;
  }
  
  .hero-cta {
    justify-content: center;
  }
  
  .hero-name {
    justify-content: center;
  }
  
  .dark-mode-toggle {
    right: 20px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 1.5rem;
  }
  
  .section {
    padding: 60px 0;
  }
  
  .projects-grid,
  .video-grid {
    grid-template-columns: 1fr;
  }
  
  .projects-filter {
    justify-content: center;
  }
  
  .filter-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }
  
  .dark-mode-toggle {
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
  }
  
  .profile-frame {
    width: 250px;
    height: 250px;
  }
  
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
  
  .social-links {
    justify-content: center;
  }
}

@media (max-width: 576px) {
  .hero-content {
    padding: 0 1rem;
  }
  
  .hero-name {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.2rem;
  }
  
  .hero-description {
    font-size: 1rem;
  }
  
  .hero-cta {
    flex-direction: column;
    gap: 1rem;
  }
  
  .btn {
    width: 100%;
  }
  
  .projects-grid,
  .video-grid {
    grid-template-columns: 1fr;
  }
  
  .dark-mode-toggle {
    right: 20px;
    top: 20px;
  }
  
  .profile-frame {
    width: 200px;
    height: 200px;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .section-subtitle {
    font-size: 1rem;
  }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

a:focus,
button:focus,
input:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}