/* ===============================================
   Modern Portfolio CSS - Dark Theme with Animations
   =============================================== */

/* CSS Variables for Theme */
:root {
  --primary-color: #00d4ff;
  --secondary-color: #ff006e;
  --accent-color: #8b5cf6;
  --bg-dark: #0a0a0a;
  --bg-darker: #000000;
  --bg-card: rgba(255, 255, 255, 0.05);
  --text-primary: #ffffff;
  --text-secondary: #b8b8b8;
  --gradient-primary: linear-gradient(135deg, #00d4ff 0%, #ff006e 100%);
  --gradient-secondary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.2);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
  background: var(--gradient-primary);
  border-radius: 5px;
}

/* Selection Styling */
::selection {
  background: var(--primary-color);
  color: var(--bg-dark);
}

/* Particle Background */
#particles-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
  overflow: hidden;
}

/* Progress Bar */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--gradient-primary);
  z-index: 9999;
  transition: width 0.3s ease;
}

/* Glass Effect Mixin */
.glass-card {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 15px;
  box-shadow: var(--shadow-xl);
}

/* Header Styles */
.glass-header {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 1rem 2rem;
  background: rgba(10, 10, 10, 0.8);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.glass-header.scrolled {
  padding: 0.5rem 2rem;
  background: rgba(10, 10, 10, 0.95);
}

#logo {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 2px;
  z-index: 1001;
}

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

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

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

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

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

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

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

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 25px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1001;
  position: relative;
  padding: 5px;
  -webkit-tap-highlight-color: transparent;
}

.hamburger span {
  width: 100%;
  height: 3px;
  background: var(--text-primary);
  border-radius: 10px;
  transition: all 0.3s ease;
  display: block;
  position: relative;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}

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

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

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

/* Sections */
.section {
  padding: 5rem 0;
  position: relative;
}

.section-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
}

/* Hero Section */
.hero-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  padding-top: 80px;
}

.hero-content {
  text-align: center;
  z-index: 2;
}

.hero-title {
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-greeting {
  display: block;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  opacity: 0;
  animation: fadeInUp 0.8s ease forwards;
}

.hero-name {
  display: block;
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.3s forwards;
}

.typewriter {
  position: relative;
  display: inline-block;
}

.typewriter::after {
  content: '|';
  position: absolute;
  right: -10px;
  animation: blink 1s infinite;
}

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

.hero-subtitle {
  font-size: clamp(1.2rem, 3vw, 2rem);
  margin-bottom: 1rem;
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.6s forwards;
}

.hero-description {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.9s forwards;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeInUp 0.8s ease 1.2s forwards;
}

/* Buttons */
.btn {
  padding: 0.75rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-block;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--text-primary);
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
}

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

.btn-secondary:hover {
  background: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border-radius: 25px;
  background: var(--gradient-primary);
  color: var(--text-primary);
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s ease;
}

.btn-small:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  animation: fadeIn 1s ease 1.5s forwards;
}

.mouse {
  width: 25px;
  height: 40px;
  border: 2px solid var(--text-secondary);
  border-radius: 20px;
  position: relative;
  margin: 0 auto 0.5rem;
}

.mouse::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  width: 3px;
  height: 8px;
  background: var(--text-secondary);
  border-radius: 2px;
  transform: translateX(-50%);
  animation: scroll 2s infinite;
}

@keyframes scroll {
  0% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

.scroll-indicator p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
}

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

.about-card {
  padding: 2rem;
}

.about-card p {
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.about-card p:last-child {
  margin-bottom: 0;
}

.link-highlight {
  color: var(--primary-color);
  text-decoration: none;
  position: relative;
  font-weight: 600;
}

.link-highlight:hover {
  color: var(--secondary-color);
}

.image-container {
  position: relative;
  overflow: hidden;
  border-radius: 15px;
  transform-style: preserve-3d;
  transition: transform 0.6s;
}

.image-container:hover {
  transform: rotateY(5deg) rotateX(5deg);
}

.portrait {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 15px;
  transition: transform 0.6s;
}

.image-container:hover .portrait {
  transform: scale(1.05);
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.3s;
  border-radius: 15px;
}

.image-container:hover .image-overlay {
  opacity: 0.1;
}

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

.project-card {
  height: 350px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s, box-shadow 0.3s;
  cursor: pointer;
  transform: rotateY(0deg);
  perspective: 1000px;
}

/* Override glass-card backdrop-filter for project cards to prevent 3D transform issues */
.project-card.glass-card {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: rgba(255, 255, 255, 0.08);
}

.project-card:hover:not(.flipped) {
  transform: rotateY(0deg) scale(1.02);
  box-shadow: 0 10px 30px rgba(0, 212, 255, 0.2);
}

.project-card.flipped {
  transform: rotateY(180deg);
}

.project-card.flipped:hover {
  transform: rotateY(180deg) scale(1.02);
  box-shadow: 0 10px 30px rgba(0, 212, 255, 0.2);
}

.project-front,
.project-back {
  position: absolute;
  width: 100%;
  height: 100%;
  padding: 2rem;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  transform-style: preserve-3d;
}

.project-front::after {
  content: 'Click to flip';
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  font-size: 0.7rem;
  color: var(--text-secondary);
  opacity: 0.6;
  transition: opacity 0.3s;
}

.project-card:hover .project-front::after {
  opacity: 1;
}

.project-back {
  transform: rotateY(180deg);
}

.project-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.project-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

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

.project-back p {
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.project-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.coming-soon {
  opacity: 0.6;
}

/* Education Section - Timeline */
.timeline {
  position: relative;
  padding: 2rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gradient-primary);
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
  width: 50%;
}

.timeline-item:nth-child(odd) {
  left: 0;
  padding-right: 3rem;
  text-align: right;
}

.timeline-item:nth-child(even) {
  left: 50%;
  padding-left: 3rem;
}

.timeline-dot {
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--gradient-primary);
  border-radius: 50%;
  top: 0;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.timeline-item:nth-child(odd) .timeline-dot {
  right: -10px;
}

.timeline-item:nth-child(even) .timeline-dot {
  left: -10px;
}

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

.timeline-content h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.timeline-date {
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 1rem;
}

.timeline-content p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

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

.skill-card {
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.skill-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, var(--primary-color) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.skill-card:hover::before {
  opacity: 0.1;
}

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

.skill-card i {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  transition: transform 0.3s ease;
}

.skill-card:hover i {
  transform: scale(1.2) rotate(5deg);
}

.skill-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.skill-level {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.skill-progress {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 2px;
  position: relative;
  animation: progressLoad 2s ease-out;
}

@keyframes progressLoad {
  0% { width: 0; }
}

/* Contact Section */
.contact-section {
  text-align: center;
}

.contact-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.contact-links {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.contact-link {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.3s ease;
}

.contact-link:hover {
  transform: translateY(-5px) scale(1.1);
  color: var(--primary-color);
  box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
}

/* Terminal Section */
.terminal-container {
  max-width: 800px;
  margin: 0 auto;
  overflow: hidden;
  font-family: var(--font-mono);
}

.terminal-header {
  background: #1e1e1e;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.terminal-buttons {
  display: flex;
  gap: 0.5rem;
}

.terminal-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.terminal-btn.close {
  background: #ff5f56;
}

.terminal-btn.minimize {
  background: #ffbd2e;
}

.terminal-btn.maximize {
  background: #27c93f;
}

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

.terminal-body {
  background: #0a0a0a;
  padding: 1rem;
  min-height: 300px;
  max-height: 400px;
  overflow-y: auto;
}

.terminal-line {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.terminal-prompt {
  color: var(--primary-color);
  font-weight: 600;
}

.terminal-text {
  color: var(--text-primary);
}

.terminal-input-line {
  background: #0a0a0a;
  padding: 0 1rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
}

/* Footer */
.footer {
  background: var(--bg-darker);
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid var(--glass-border);
}

.footer p {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.footer i {
  color: var(--secondary-color);
}

/* Animations */
@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

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

/* AOS-like animations */
[data-aos="fade-up"] {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

[data-aos="fade-up"].aos-animate {
  opacity: 1;
  transform: translateY(0);
}

[data-aos="fade-right"] {
  opacity: 0;
  transform: translateX(-30px);
  transition: all 0.8s ease;
}

[data-aos="fade-right"].aos-animate {
  opacity: 1;
  transform: translateX(0);
}

[data-aos="fade-left"] {
  opacity: 0;
  transform: translateX(30px);
  transition: all 0.8s ease;
}

[data-aos="fade-left"].aos-animate {
  opacity: 1;
  transform: translateX(0);
}

[data-aos="flip-left"] {
  opacity: 0;
  transform: perspective(2500px) rotateY(-90deg);
  transition: all 0.8s ease;
}

[data-aos="flip-left"].aos-animate {
  opacity: 1;
  transform: perspective(2500px) rotateY(0);
}

[data-aos="zoom-in"] {
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.6s ease;
}

[data-aos="zoom-in"].aos-animate {
  opacity: 1;
  transform: scale(1);
}

/* Loading State */
body:not(.loaded) {
  overflow: hidden;
}

body:not(.loaded) .hero-section {
  opacity: 0;
}

body.loaded .hero-section {
  opacity: 1;
  transition: opacity 1s ease;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .about-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .timeline::before {
    left: 30px;
  }
  
  .timeline-item {
    width: 100%;
    padding-left: 70px;
    padding-right: 0;
    text-align: left;
  }
  
  .timeline-item:nth-child(even) {
    left: 0;
  }
  
  .timeline-dot {
    left: 20px !important;
  }
}

@media (max-width: 768px) {
  .glass-header {
    padding: 1rem 2rem;
    justify-content: space-between;
  }
  
  .nav-items {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: var(--bg-dark);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: right 0.3s ease;
    z-index: 998;
  }
  
  .nav-items.active {
    right: 0;
  }
  
  .hamburger {
    display: flex;
    position: relative;
    z-index: 9999;
  }
  
  .hero-cta {
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 200px;
    text-align: center;
  }
  
  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
  }
  
  .skill-card {
    padding: 1.5rem;
  }
  
  .skill-card i {
    font-size: 2rem;
  }
  
  .contact-link {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }
  
  .section {
    padding: 3rem 0;
  }
  
  .timeline {
    padding: 1rem 0;
  }
  
  .timeline-item {
    padding-left: 50px;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  /* Ensure hamburger stays visible on small screens */
  .hamburger {
    display: flex !important;
    width: 35px;
    height: 30px;
    padding: 5px;
    z-index: 9999;
  }
  
  /* Increase header z-index for mobile */
  .glass-header {
    z-index: 999;
    /* padding: 0.75rem 2rem; */
  }
  
  /* Adjust logo size for small screens */
  #logo {
    font-size: 1.5rem;
  }
}