@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #60a5fa;
  --secondary: #8b5cf6;
  --accent: #06b6d4;
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #334155;
  --bg-hover: #475569;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border: #475569;
  --shadow: rgba(0, 0, 0, 0.25);
  --glow: rgba(59, 130, 246, 0.5);
}

body.light-mode {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --secondary: #7c3aed;
  --accent: #0891b2;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: rgba(0, 0, 0, 0.1);
  --glow: rgba(37, 99, 235, 0.3);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Background Pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 80%, var(--primary) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, var(--secondary) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, var(--accent) 0%, transparent 50%);
  opacity: 0.03;
  z-index: -1;
  pointer-events: none;
}

/* Header */
header {
  width: 100%;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid var(--border);
  position: relative;
  box-shadow: none;
  border-radius: 0;
  left: 0;
  top: 0;
  z-index: 100;
}

body.light-mode header {
  background: rgba(248, 250, 252, 0.95);
}

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

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

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

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

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

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

.theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.2rem;
}

.theme-toggle:hover {
  background: var(--bg-hover);
  transform: scale(1.1);
}

/* Main Content */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  box-sizing: border-box;
  width: 100%;
}

/* Hero Section */
.hero {
  padding: 6rem 0;
  text-align: center;
  position: relative;
  width: 100%;
  margin: 0;
  border-radius: 20px;
  box-shadow: 0 10px 40px var(--shadow);
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 0.8s ease;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeInUp 0.8s ease 0.2s both;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 1rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px var(--glow);
  animation: fadeInUp 0.8s ease 0.4s both;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--glow);
}

/* About Section */
.about-section {
  padding: 6rem 0;
  background: var(--bg-secondary);
  margin: 0;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  width: 100%;
  box-shadow: 0 10px 40px var(--shadow);
}

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

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

.profile-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 60px var(--shadow);
}

.profile-img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  border: 4px solid var(--primary);
  object-fit: cover;
}

.contact-icons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

.contact-icons a {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 1px solid var(--border);
}

.contact-icons a:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px var(--glow);
}

.about-text h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

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

/* Projects Section */
.projects-section {
  padding: 3rem 0 6rem 0;
  width: 100%;
  box-shadow: none;
}

/* Skills Section */
.skills-section {
  padding: 6rem 0;
  background: var(--bg-secondary);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.skill-category {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: 15px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 30px var(--shadow);
  transition: all 0.3s ease;
  text-align: left;
}

.skill-category:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 50px var(--shadow);
}

.skill-category h3 {
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.skill-category h3 i {
  color: var(--primary);
  font-size: 1.3rem;
}

.skills-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: flex-start;
}

.skill-tag {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 0.6rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: default;
  border: none;
  box-shadow: 0 4px 15px rgba(138, 43, 226, 0.2);
  text-align: center;
  white-space: nowrap;
}

.skill-tag:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(138, 43, 226, 0.3);
  background: linear-gradient(135deg, var(--secondary), var(--primary));
}

/* Skills Animation */
.skill-category {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s ease forwards;
}

.skill-category:nth-child(1) { animation-delay: 0.1s; }
.skill-category:nth-child(2) { animation-delay: 0.2s; }
.skill-category:nth-child(3) { animation-delay: 0.3s; }
.skill-category:nth-child(4) { animation-delay: 0.4s; }

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

/* Timeline Section */
.timeline-section {
  padding: 4rem 0 3rem 0;
  width: 100%;
  box-shadow: none;
}

.timeline {
  position: relative;
  max-width: 1000px;
  margin: 2rem auto 0;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
  width: 50%;
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.6s ease;
}

.timeline-item.animate {
  opacity: 1;
  transform: translateY(0);
}

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

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

.timeline-marker {
  position: absolute;
  top: 0;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 15px var(--glow);
}

.timeline-item:nth-child(odd) .timeline-marker {
  right: -25px;
}

.timeline-item:nth-child(even) .timeline-marker {
  left: -25px;
}

.timeline-marker i {
  color: white;
  font-size: 1.2rem;
}

.timeline-content {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 30px var(--shadow);
  transition: all 0.3s ease;
  max-width: 350px;
}

.timeline-content:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 60px var(--shadow);
}

.timeline-date {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timeline-content h3 {
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.timeline-content h4 {
  color: var(--secondary);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.8rem;
}

.timeline-content p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.8rem;
}

.timeline-content p:last-child {
  margin-bottom: 0;
}

.timeline-content strong {
  color: var(--text-primary);
}

/* Mobile Timeline */
@media (max-width: 768px) {
  .timeline::before {
    left: 30px;
  }

  .timeline-item {
    width: 100%;
    left: 0 !important;
    padding-left: 4rem !important;
    padding-right: 0 !important;
  }

  .timeline-marker {
    left: 0 !important;
    right: auto !important;
  }
}

/* Mobile Timeline */
@media (max-width: 768px) {
  .timeline::before {
    left: 30px;
  }

  .timeline-item {
    width: 100%;
    left: 0 !important;
    padding-left: 4rem !important;
    padding-right: 0 !important;
  }

  .timeline-marker {
    left: 0 !important;
    right: auto !important;
  }

  .skills-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
  }

  .skill-category {
    padding: 1.5rem;
  }

  .skill-category h3 {
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
  }

  .skill-category h3 i {
    font-size: 1.1rem;
  }

  .skills-tags {
    gap: 0.6rem;
  }

  .skill-tag {
    font-size: 0.8rem;
    padding: 0.5rem 0.8rem;
    border-radius: 15px;
  }
}

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

.section-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.section-header p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
  width: 100%;
}

@media (max-width: 900px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

.project-card {
  background: var(--bg-card);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  cursor: pointer;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  box-shadow: 0 10px 40px var(--shadow);
}

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

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

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

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

.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-card:hover .project-overlay {
  opacity: 0.9;
}

.project-overlay i {
  color: white;
  font-size: 2rem;
}

.project-content {
  padding: 2rem;
}

.project-content h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.project-tag {
  background: var(--primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 500;
}

.project-content p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.project-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.stat {
  text-align: center;
}

.stat-value {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary);
  display: block;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Feedback Section */
.feedback-section {
  padding: 4rem 0;
  background: var(--bg-secondary);
  margin: 4rem 0 0 0;
  border-radius: 20px;
  box-shadow: 0 10px 40px var(--shadow);
}

.feedback-form {
  max-width: 600px;
  margin: 0 auto;
  background: var(--bg-card);
  padding: 3rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 40px var(--shadow);
}

.form-group {
  margin-bottom: 2rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--glow);
}

.form-group textarea {
  min-height: 120px;
}

.submit-button {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 1rem 2rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.submit-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--glow);
}

.submit-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Footer */
footer {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  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"><circle cx="20" cy="20" r="2" fill="rgba(59,130,246,0.1)"/><circle cx="80" cy="40" r="1.5" fill="rgba(139,92,246,0.1)"/><circle cx="40" cy="80" r="1" fill="rgba(6,182,212,0.1)"/></svg>');
  pointer-events: none;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr;
  gap: 1.5rem;
  padding: 1.5rem 0 1rem;
  position: relative;
  z-index: 1;
}

.footer-info h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-info p {
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 0.3rem;
  font-size: 0.95rem;
}

.footer-info p:first-of-type {
  font-weight: 500;
  font-size: 1rem;
}

.footer-links h4,
.footer-contact h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
  position: relative;
}

.footer-links h4::after,
.footer-contact h4::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 30px;
  height: 2px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 1px;
}

.footer-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links ul li {
  margin-bottom: 0.25rem;
}

.footer-links ul li a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  padding-left: 15px;
  font-size: 0.9rem;
}

.footer-links ul li a::before {
  content: '→';
  position: absolute;
  left: 0;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
  color: var(--primary);
}

.footer-links ul li a:hover {
  color: var(--primary);
  padding-left: 20px;
}

.footer-links ul li a:hover::before {
  opacity: 1;
  transform: translateX(0);
}

.social-icons-footer {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.social-icons-footer a {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.social-icons-footer a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  transition: all 0.3s ease;
  z-index: 0;
}

.social-icons-footer a i {
  position: relative;
  z-index: 1;
  font-size: 1.2rem;
}

.social-icons-footer a:hover::before {
  left: 0;
}

.social-icons-footer a:hover {
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.email-text {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: 'Courier New', monospace;
  background: var(--bg-primary);
  padding: 0.3rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 0.8rem 0;
  text-align: center;
  position: relative;
  z-index: 1;
}

.footer-bottom p {
  color: var(--text-muted);
  margin: 0.1rem 0;
  font-size: 0.8rem;
}

.footer-bottom p:first-child {
  font-weight: 500;
}

/* Mobile Responsive Footer */
@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.2rem;
    text-align: center;
    padding: 1.2rem 0 0.8rem;
  }
  
  .footer-info {
    order: 1;
  }
  
  .footer-contact {
    order: 2;
  }
  
  .footer-links {
    order: 3;
  }
  
  .social-icons-footer {
    justify-content: center;
  }
}

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

.fade-in {
  animation: fadeInUp 0.6s ease forwards;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .header-content {
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .hero {
    padding: 4rem 0;
  }

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

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .feedback-form {
    margin: 0 1rem;
    padding: 2rem;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

/* Success/Error Messages */
.message {
  padding: 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  display: none;
}

.message.success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid #22c55e;
  color: #22c55e;
}

.message.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid #ef4444;
  color: #ef4444;
}

.message.show {
  display: block;
  animation: fadeInUp 0.3s ease;
}

.project-detail-img {
  max-width: 500px;
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 16px;
  box-shadow: 0 4px 24px var(--shadow);
}

.centered-media {
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 500px;
  width: 100%;
  height: auto;
  border-radius: 16px;
}

.project-gallery.custom-screens {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.project-gallery.custom-screens img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  background: #222;
  display: block;
}
@media (max-width: 900px) {
  .project-gallery.custom-screens {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 600px) {
  .project-gallery.custom-screens {
    grid-template-columns: 1fr;
  }
}

.gallery-img,
.centered-media {
  border-radius: 16px;
}

/* Section Headings Spacing */
.container h2, .container h3, .container h4 {
  margin-top: 3rem;
  margin-bottom: 1.5rem;
}

/* Special case: ensure first h2 in .container does not have extra top margin */
.container > h2:first-child {
  margin-top: 0;
}

/* Section Divider Spacing */
.section-divider {
  margin-top: 3rem;
  margin-bottom: 3rem;
  border: none;
  border-top: 2px solid var(--border);
}

/* Reduce margin-top for headings that immediately follow a divider */
.section-divider + h2,
.section-divider + h3,
.section-divider + h4 {
  margin-top: 0.5rem;
}

.project-gallery.two-rows {
  display: flex;
  flex-direction: column;
  gap: 2rem; /* Space between rows */
}

.project-gallery.two-rows .gallery-row {
  display: flex;
  justify-content: center;
  gap: 2rem; /* Space between images in a row */
}

.project-gallery.two-rows .gallery-img {
  max-width: 48%;
  min-width: 0;
}

.gallery-caption {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 1.1rem;
}

.project-detail-header {
  display: flex;
  gap: 2rem;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.small-thumb {
  max-width: 350px;
}

html {
  scroll-behavior: smooth;
}

.feedback-section h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  font-size: 2.5rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.5px;
}

/* === LAZY LOADING STYLES === */
img[data-src] {
  background: linear-gradient(90deg, #f0f0f0 25%, transparent 37%, #f0f0f0 63%);
  background-size: 400% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  filter: blur(5px);
  transition: all 0.3s ease;
}

body.dark-mode img[data-src] {
  background: linear-gradient(90deg, #334155 25%, transparent 37%, #334155 63%);
  background-size: 400% 100%;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.img-loading {
  filter: blur(5px);
  opacity: 0.7;
}

.img-loaded {
  filter: blur(0);
  opacity: 1;
  transition: all 0.3s ease;
}

.img-error {
  filter: blur(0);
  opacity: 0.5;
  background: var(--bg-secondary);
  position: relative;
}

.img-error::after {
  content: "⚠️ Failed to load";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

/* Optimize image rendering */
img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: optimize-contrast;
  image-rendering: crisp-edges;
}

/* Low quality placeholder for critical images */
.img-placeholder {
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}
