/* ========================
   VARIABLES & THEMES
   ======================== */
:root {
  /* Color Palette */
  --primary-color: #6c5ce7;
  --primary-light: #a29bfe;
  --primary-dark: #5649c0;
  --secondary-color: #00cec9;
  --accent-color: #fd79a8;
  --success-color: #00b894;
  --warning-color: #fdcb6e;
  --error-color: #d63031;
  
  /* Text Colors */
  --text-primary: #2d3436;
  --text-secondary: #636e72;
  --text-light: #f5f6fa;
  
  /* Background Colors */
  --bg-primary: #f5f6fa;
  --bg-secondary: #dfe6e9;
  --card-bg: #ffffff;
  
  /* UI Colors */
  --border-color: #dfe6e9;
  --shadow-color: rgba(0, 0, 0, 0.1);
  
  /* Effects */
  --shadow: 0 4px 20px var(--shadow-color);
  --border-radius: 12px;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

[data-theme="dark"] {
  --primary-color: #6c5ce7;
  --primary-light: #a29bfe;
  --primary-dark: #5649c0;
  --secondary-color: #00cec9;
  --accent-color: #fd79a8;
  
  --text-primary: #f5f6fa;
  --text-secondary: #b2bec3;
  --text-light: #f5f6fa;
  
  --bg-primary: #1e272e;
  --bg-secondary: #2f3640;
  --card-bg: #2f3640;
  
  --border-color: #3d3d3d;
  --shadow-color: rgba(0, 0, 0, 0.3);
}

/* ========================
   BASE STYLES
   ======================== */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: var(--transition);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 { font-size: clamp(2.5rem, 5vw, 3.5rem); }
h2 { font-size: clamp(2rem, 4vw, 2.8rem); }
h3 { font-size: clamp(1.75rem, 3vw, 2.2rem); }
h4 { font-size: clamp(1.5rem, 2.5vw, 1.8rem); }

p, li, a, span, button, input, textarea {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--text-secondary);
}

a {
  text-decoration: none;
  transition: var(--transition);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ========================
   LAYOUT STRUCTURE
   ======================== */
.main-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

.main-content {
  flex: 1;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  padding-left: calc(80px + 2rem);
}

.section {
  padding: 4rem 0;
  width: 100%;
}

.section-header {
  margin-bottom: 3rem;
  text-align: center;
}

.section-header h2 {
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  border-radius: 2px;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ========================
   NAVIGATION
   ======================== */
.floating-nav {
  width: 80px;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background-color: var(--card-bg);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 0;
  z-index: 100;
  transition: var(--transition);
}

.nav-brand {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 2rem;
}

.nav-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  flex-grow: 1;
}

.nav-links a {
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.9rem;
}

.nav-links a i {
  font-size: 1.4rem;
  margin-bottom: 0.3rem;
}

.nav-links a span {
  opacity: 0;
  height: 0;
  overflow: hidden;
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-color);
}

.nav-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.2rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.theme-toggle:hover {
  background-color: rgba(108, 92, 231, 0.1);
  color: var(--primary-color);
}

.theme-toggle i.fa-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle i.fa-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle i.fa-sun {
  display: block;
}

/* Mobile Navigation Toggle */
.mobile-nav-toggle {
  display: none;
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  width: 50px;
  height: 50px;
  background-color: var(--primary-color);
  border-radius: 50%;
  z-index: 1000;
  border: none;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 5px 15px rgba(108, 92, 231, 0.3);
}

.mobile-nav-toggle span {
  display: block;
  width: 24px;
  height: 3px;
  background-color: white;
  transition: var(--transition);
}

.mobile-nav-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.mobile-nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-nav-toggle.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ========================
   HERO SECTION
   ======================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding-top: 80px;
}

.hero-content {
  max-width: 800px;
  z-index: 2;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.hero h1 span {
  color: var(--primary-color);
  position: relative;
}

.hero h1 span::after {
  content: '';
  position: absolute;
  bottom: 5px;
  left: 0;
  width: 100%;
  height: 10px;
  background-color: rgba(108, 92, 231, 0.3);
  z-index: -1;
}

.hero .subtitle {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  margin-bottom: 2rem;
  max-width: 600px;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

/* ========================
   BUTTONS
   ======================== */
.btn {
  display: inline-block;
  padding: 0.8rem 1.8rem;
  border-radius: 50px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.9rem;
  transition: var(--transition);
  border: none;
  cursor: pointer;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(108, 92, 231, 0.3);
}

.btn-secondary {
  background-color: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(108, 92, 231, 0.3);
}

/* ========================
   ABOUT SECTION
   ======================== */
.about-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 3rem;
  align-items: center;
}

.about-image {
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.about-image:hover {
  transform: scale(1.02);
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-text h3 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.skill-tag {
  background-color: rgba(108, 92, 231, 0.1);
  color: var(--primary-color);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.skill-tag:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-3px);
}

/* ========================
   PROJECTS SECTION
   ======================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  width: 100%;
  padding: 0;
}

.project-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  margin: 0 auto;
  width: 100%;
  max-width: 100%;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.project-image {
  height: 220px;
  overflow: hidden;
  position: relative;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.project-card:hover .project-image img {
  transform: scale(1.05);
}

.project-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background-color: var(--accent-color);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
}

.project-content {
  padding: 1.5rem;
}

.project-content h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.project-tech span {
  background-color: rgba(108, 92, 231, 0.1);
  color: var(--primary-color);
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 500;
}

.project-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.project-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
}

.project-links a:hover {
  color: var(--accent-color);
}

/* ========================
   CONTACT SECTION
   ======================== */
.contact-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 3rem;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.contact-icon {
  width: 50px;
  height: 50px;
  background-color: rgba(108, 92, 231, 0.1);
  color: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.contact-text h4 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.contact-form .form-group {
  margin-bottom: 1.5rem;
}

.contact-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background-color: var(--card-bg);
  color: var(--text-primary);
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}

.contact-form textarea {
  min-height: 150px;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

/* ========================
   FOOTER
   ======================== */
.global-footer {
  background-color: var(--card-bg);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
  width: 100%;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.footer-section {
  padding: 0 1rem;
}

.footer-section h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
}

.footer-section p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(108, 92, 231, 0.1);
  color: var(--primary-color);
  transition: var(--transition);
}

.social-links a:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-3px);
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-section ul li i {
  width: 20px;
  color: var(--primary-color);
}

.footer-section ul li a {
  color: var(--text-secondary);
  transition: var(--transition);
}

.footer-section ul li a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid rgba(108, 92, 231, 0.1);
  color: var(--text-secondary);
  font-size: 0.9rem;
  width: 100%;
}

.footer-bottom p {
  margin-bottom: 0.5rem;
}

.footer-bottom i.fa-heart {
  color: var(--accent-color);
}

/* ========================
   UTILITY CLASSES
   ======================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

/* ========================
   ANIMATIONS & EFFECTS
   ======================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 1s ease-out forwards;
}

.slide-up {
  animation: slideUp 0.8s ease-out forwards;
}

/* 3D Background Canvas */
#bgCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.1;
}

/* Preloader */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.preloader-inner {
  text-align: center;
}

.spinner {
  width: 70px;
  height: 70px;
  position: relative;
  margin: 0 auto 1.5rem;
}

.double-bounce1, .double-bounce2 {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--primary-color);
  opacity: 0.6;
  position: absolute;
  top: 0;
  left: 0;
  animation: sk-bounce 2.0s infinite ease-in-out;
}

.double-bounce2 {
  animation-delay: -1.0s;
}

@keyframes sk-bounce {
  0%, 100% { 
    transform: scale(0.0);
  } 50% { 
    transform: scale(1.0);
  }
}

/* ========================
   RESPONSIVE ADJUSTMENTS
   ======================== */
@media (max-width: 1200px) {
  .main-content {
    padding-left: calc(70px + 1.5rem);
  }
  
  .floating-nav {
    width: 70px;
  }
}

@media (max-width: 992px) {
  .main-content {
    padding: 2rem;
    padding-left: 2rem;
  }
  
  .floating-nav {
    transform: translateX(-100%);
    width: 280px;
    align-items: flex-start;
    padding: 2rem;
  }
  
  .floating-nav.active {
    transform: translateX(0);
  }
  
  .nav-links {
    align-items: flex-start;
  }
  
  .nav-links a {
    flex-direction: row;
    gap: 1rem;
  }
  
  .nav-links a span {
    opacity: 1;
    height: auto;
  }
  
  .mobile-nav-toggle {
    display: flex;
  }
  
  .hero {
    padding-top: 0;
  }
  
  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
  
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .section {
    padding: 3rem 0;
  }
  
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .footer-section {
    text-align: center;
  }
  
  .social-links {
    justify-content: center;
  }
  
  .footer-section ul li {
    justify-content: center;
  }
}

@media (max-width: 576px) {
  .main-content {
    padding: 1.5rem;
  }
  
  .section-header h2 {
    font-size: 2rem;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .footer-bottom {
    padding-top: 1.5rem;
  }
}