/* Typography & Base */
:root {
  --primary-color: #2563eb;
  --secondary-color: #7c3aed;
  --accent-color: #059669;
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: auto;
}

h1, h2, h3 {
  margin: 0.5em 0;
}

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

/* Header */
.navbar {
  background: var(--bg-primary);
  box-shadow: var(--shadow-md);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-color);
}

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

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
  transition: all 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  padding: 0.5rem 0;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none; /* Hidden on desktop, shown on mobile */
  flex-direction: column;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
  position: relative;
}

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

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

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

.nav-links a:hover {
  color: var(--primary-color);
}

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

.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
  font-weight: 700;
  color: var(--text-primary);
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--primary-color);
  border-radius: 2px;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 6rem 2rem;
  display: flex;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.3;
}

.hero-wrapper {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  max-width: 1200px;
  width: 100%;
  gap: 4rem;
  position: relative;
  z-index: 1;
}

.hero-text {
  flex: 1;
  min-width: 300px;
  text-align: left;
  color: white;
}

.hero-text h2 {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-text p {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  opacity: 0.9;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.hero-img {
  flex: 1;
  min-width: 300px;
  display: flex;
  justify-content: center;
}

.hero-img img {
  max-width: 350px;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  border: 4px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.3s ease;
}

.hero-img img:hover {
  transform: scale(1.05);
}

.highlight {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
}

.email {
  color: #fbbf24;
  font-weight: 600;
  font-size: 1.1rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  background: rgba(251, 191, 36, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 25px;
  display: inline-block;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.exp {
  font-size: 1.2rem;
  margin-top: 1rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  display: inline-block;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/*Icon */
.skill-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

/* Cards */
.cards {
  background: var(--bg-primary);
  padding: 5rem 0;
  position: relative;
}

.cards::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  margin-top: 3rem;
}

.card {
  background: var(--bg-primary);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow-md);
  transition: all 0.4s ease;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.card:hover::before {
  transform: scaleX(1);
}

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

.card h3 {
  color: var(--text-primary);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  transition: color 0.3s ease;
}

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

.card p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
  font-weight: 500;
}

.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 15px;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.card-img:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

/* Skill Cards Special Styling */
#skills .card {
  text-align: center;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

#skills .card:hover {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
}

#skills .skill-icon {
  display: block;
  margin: 0 auto 1rem;
}

#skills .card:hover .skill-icon {
  transform: scale(1.1) rotate(5deg);
}

/* Education Section */
#education {
  background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
  padding: 5rem 0;
  position: relative;
}

#education::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="%232563eb" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
  opacity: 0.5;
}

#education ul li {
  margin-bottom: 1rem;
}

/* Timeline Layout */
.timeline {
  position: relative;
  margin: 0 auto;
  padding: 2rem 0 2rem 3rem;
  border-left: 4px solid var(--primary-color);
  max-width: 800px;
  z-index: 1;
}

.timeline::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.3);
}

.timeline-item {
  position: relative;
  margin: 2rem 0;
  padding-left: 2rem;
}

.timeline-dot {
  position: absolute;
  left: -18px;
  top: 8px;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border: 4px solid var(--bg-primary);
  border-radius: 50%;
  z-index: 2;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

.timeline-content {
  padding: 1.5rem 2rem;
  background: var(--bg-primary);
  border-radius: 15px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  position: relative;
}

.timeline-content::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 20px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 8px solid var(--bg-primary);
}

.timeline-content h3 {
  font-size: 1.2rem;
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
  font-weight: 700;
}

.timeline-content p {
  margin: 0;
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.timeline-item:hover .timeline-dot {
  transform: scale(1.2);
  box-shadow: var(--shadow-lg);
}

.timeline-item:hover .timeline-content {
  transform: translateX(10px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}


/* Contact Form */
#contact {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  padding: 5rem 0;
  position: relative;
}

#contact::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="waves" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M0 20 Q10 0 20 20 T40 20" stroke="%232563eb" stroke-width="1" fill="none" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23waves)"/></svg>');
  opacity: 0.3;
}

form {
  background: var(--bg-primary);
  padding: 3rem;
  border-radius: 20px;
  margin-top: 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 1;
}

form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
}

input, textarea {
  width: 100%;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 1rem;
  font-family: 'Poppins', sans-serif;
  transition: all 0.3s ease;
  background: var(--bg-primary);
  color: var(--text-primary);
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.btn {
  text-decoration: none;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #fff;
  padding: 1rem 2rem;
  border: none;
  border-radius: 12px;
  display: inline-block;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}

/* Footer */
footer {
  text-align: center;
  padding: 3rem 0;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  font-size: 1rem;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="stars" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23stars)"/></svg>');
  opacity: 0.3;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    width: 95%;
    padding: 0 1rem;
  }

  /* Mobile Navigation */
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    flex-direction: column;
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    border-top: 1px solid var(--border-color);
    z-index: 1000;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    font-size: 1.1rem;
  }

  .nav-links a:last-child {
    border-bottom: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  /* Ensure hamburger is visible on mobile */
  .mobile-menu-toggle {
    display: flex !important;
  }

  /* Hero Section Mobile */
  .hero {
    padding: 3rem 1rem;
    min-height: 80vh;
  }

  .hero-wrapper {
    flex-direction: column-reverse;
    text-align: center;
    gap: 2rem;
  }

  .hero-text {
    text-align: center;
  }

  .hero-text h2 {
    font-size: 2.2rem;
    line-height: 1.3;
  }

  .hero-text p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }

  .hero-img {
    margin-bottom: 1rem;
  }

  .hero-img img {
    max-width: 280px;
  }

  /* Section Titles */
  .section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
  }

  /* Cards Mobile */
  .card-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
  }

  .card {
    padding: 1.5rem;
    margin: 0 0.5rem;
  }

  /* Timeline Mobile */
  .timeline {
    padding-left: 1.5rem;
    margin: 0 1rem;
  }

  .timeline-content {
    padding: 1rem 1.5rem;
    margin-left: 0.5rem;
  }

  .timeline-dot {
    left: -15px;
    width: 20px;
    height: 20px;
  }

  /* Form Mobile */
  form {
    padding: 2rem 1.5rem;
    margin: 1rem 0.5rem;
  }

  input, textarea {
    padding: 0.8rem 1rem;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
  }

  /* Education Section Mobile */
  #education {
    padding: 3rem 0;
  }

  /* Contact Section Mobile */
  #contact {
    padding: 3rem 0;
  }

  /* Cards Section Mobile */
  .cards {
    padding: 3rem 0;
  }
}

@media (max-width: 480px) {
  .container {
    width: 100%;
    padding: 0 0.5rem;
  }

  /* Extra Small Mobile */
  .hero {
    padding: 2rem 0.5rem;
    min-height: 70vh;
  }

  .hero-text h2 {
    font-size: 1.8rem;
    line-height: 1.2;
  }

  .hero-text p {
    font-size: 0.95rem;
  }

  .hero-img img {
    max-width: 220px;
  }

  .section-title {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
  }

  /* Navigation for small screens */
  .nav-links a {
    font-size: 1rem;
    padding: 0.8rem 0;
  }

  /* Cards for small screens */
  .card {
    padding: 1.2rem;
    margin: 0 0.25rem;
  }

  .card h3 {
    font-size: 1.1rem;
  }

  .card p {
    font-size: 0.9rem;
  }

  /* Timeline for small screens */
  .timeline {
    padding-left: 1rem;
    margin: 0 0.5rem;
  }

  .timeline-content {
    padding: 0.8rem 1rem;
    margin-left: 0.25rem;
  }

  .timeline-content h3 {
    font-size: 1rem;
  }

  .timeline-content p {
    font-size: 0.85rem;
  }

  .timeline-dot {
    left: -12px;
    width: 16px;
    height: 16px;
  }

  /* Form for small screens */
  form {
    padding: 1.5rem 1rem;
    margin: 0.5rem 0.25rem;
  }

  input, textarea {
    padding: 0.7rem 0.8rem;
    font-size: 16px;
  }

  .btn {
    padding: 0.8rem;
    font-size: 1rem;
  }

  /* Skill icons for small screens */
  .skill-icon {
    font-size: 2.5rem;
  }

  /* Email and experience styling for mobile */
  .email {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
  }

  .exp {
    font-size: 1rem;
    padding: 0.6rem 1.2rem;
  }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    padding: 2rem 1rem;
    min-height: 60vh;
  }

  .hero-text h2 {
    font-size: 2rem;
  }

  .hero-img img {
    max-width: 200px;
  }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  .card:hover {
    transform: none;
  }

  .card:hover::before {
    transform: scaleX(1);
  }

  .btn:hover {
    transform: none;
  }

  .nav-links a:hover::after {
    width: 0;
  }

  /* Make touch targets larger */
  .nav-links a {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .btn {
    min-height: 44px;
  }

  input, textarea {
    min-height: 44px;
  }
}
