/* --- ROOT VARIABLES --- */
:root {
  /* Colors */
  --primary-color: #359dff;
  --secondary-color: #e6edf4;
  --text-dark: #0c151d;
  --text-light: #eef2f6;
  --background-light: #f8fafc;
  
  /* Cards */
  --card-background-light: #ffffff;
  --border-light: #e6edf4;
  
  /* Shadows */
  --shadow-light: rgba(0, 0, 0, 0.05);
  --shadow-hover: rgba(0, 0, 0, 0.12);
  
  --hero-gradient: linear-gradient(
    135deg,
    #fffbeb 0%,   
    #ecfccb 20%,  
    #cffafe 40%,
    #e0e7ff 60%, 
    #fae8ff 80%, 
    #ffe4e6 100%   
  );

  --skill-gradient: linear-gradient(90deg, #359dff, #00c6ff);
}

/* --- DARK MODE VARIABLES --- */
body.dark-mode {
  --text-dark: #eef2f6;
  --background-light: #0c151d;
  --card-background-light: #162433;
  --border-light: #2d3b4a;
  --secondary-color: #1e2e3e;
  
  --shadow-light: rgba(0, 0, 0, 0.2);
  --shadow-hover: rgba(0, 0, 0, 0.4);
  
  --hero-gradient: linear-gradient(
    15deg,
    #0037c3 0%,
    #002b91 15%,
    #3e30ff 30%,
    #0043af 45%,
    #002e9a 60%,
    #1501b0 80%,
    #002fff 100%
  );
}

/* --- GLOBAL --- */
* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  color: var(--text-dark);
  background-color: var(--background-light);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

h1, h2, h3, h4, p { margin: 0; color: inherit; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; font-family: inherit; }
img { max-width: 100%; height: auto; display: block; }

/* --- LAYOUT --- */
.main-content {
  padding: 40px 5%;
  display: flex;
  justify-content: center;
}

.content-wrapper {
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  gap: 100px;
}

/* --- HEADER --- */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 40px;
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--background-light);
  border-bottom: 1px solid var(--border-light);
  border-radius: 0 0 24px 24px;
  backdrop-filter: blur(10px);
  transition: all 0.4s ease;
}

.main-header.scrolled {
  padding: 10px 40px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.portfolio-title { font-size: 1.3rem; font-weight: 700; }

.header-actions, .header-nav, .header-buttons {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-link {
  font-weight: 500;
  position: relative;
  transition: color 0.3s;
}

.nav-link:hover { color: var(--primary-color); }

/* --- BUTTONS --- */
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 28px;
  border-radius: 30px;
  background-color: #0c151d;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.primary-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

/* Dark Mode */
body.dark-mode .primary-button {
  background-color: var(--primary-color);
  box-shadow: 0 0 15px rgba(53, 157, 255, 0.4);
}

body.dark-mode .primary-button:hover {
  background-color: #2980b9;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 20px;
  border-radius: 30px;
  border: 1px solid var(--border-light);
  color: var(--text-dark);
  font-weight: 500;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.secondary-button:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

body.dark-mode .secondary-button {
  border-color: #4a5568;
  color: #eef2f6;
}

body.dark-mode .secondary-button:hover {
  border-color: #fff;
  color: #fff;
  background-color: rgba(255,255,255,0.1);
}

/* --- HERO SECTION --- */
.hero-section {
  width: 100%;
  min-height: 520px;
  padding: 60px;
  border-radius: 32px;
  background-image: var(--hero-gradient);
  background-size: 300% 300%;
  animation: gradientShift 15s ease infinite alternate;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes gradientShift { 
  0% { background-position: 0% 50%; } 
  100% { background-position: 100% 50%; } 
}

.hero-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  max-width: 1100px;
  width: 100%;
}

.hero-left {
  flex: 1;
  max-width: 580px;
  margin-left: 60px; 
}

.hero-heading {
  font-size: 3rem;
  line-height: 1.15;
  margin-bottom: 16px;
  font-weight: 800;
}

.hero-subheading {
  font-size: 1.05rem;
  margin-bottom: 28px;
  opacity: 0.92;
}

.hero-btn { margin-top: 10px; }

/* Hero Image Ring */
.hero-image {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.image-ring {
  width: 300px;
  height: 300px;
  padding: 6px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.5);
}

.image-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.typing-cursor {
  display: inline-block;
  width: 4px;
  height: 1em;
  background-color: var(--primary-color);
  animation: blink 0.75s infinite;
  margin-left: 5px;
}
@keyframes blink { 50% { opacity: 0; } }

/* --- PROJECTS --- */
.section-heading {
  font-size: 2.2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 50px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
}

.project-item {
  background-color: var(--card-background-light);
  border: 1px solid var(--border-light);
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-item:nth-child(1) .project-image { background-image: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
.project-item:nth-child(2) .project-image { background-image: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%); }
.project-item:nth-child(3) .project-image { background-image: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); }
.project-item:nth-child(4) .project-image { background-image: linear-gradient(135deg, #a8edea 0%, #8ec5fc 100%); }

.project-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px var(--shadow-hover);
}

.project-image {
  width: 100%;
  aspect-ratio: 16/9;
  background-color: var(--secondary-color);
  background-size: cover;
  background-position: center;
}

.project-details {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 8px; }
.project-description { font-size: 0.95rem; color: #64748b; margin-bottom: 20px; flex-grow: 1; }
body.dark-mode .project-description { color: #aebfd4; }

/* Project Links Container */
.project-links { display: flex; gap: 12px; margin-top: auto; }
.small-btn { height: 38px; padding: 0 16px; font-size: 0.85rem; flex: 1; }

/* --- SKILLS --- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 25px;
}

.skill-item {
  background-color: var(--card-background-light);
  padding: 24px;
  border-radius: 20px;
  border: 1px solid var(--border-light);
  box-shadow: 0 4px 6px var(--shadow-light);
  transition: transform 0.3s;
}

.skill-item:hover { transform: translateY(-5px); }
.skill-item h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 15px; }

/* Modern Bar */
.skill-bar-container {
  height: 8px;
  background-color: var(--secondary-color);
  border-radius: 10px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  background: var(--skill-gradient);
  width: 0%;
  border-radius: 10px;
  transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- CERTIFICATES --- */
.certificates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.certificate-card {
  background-color: var(--card-background-light);
  border-radius: 24px;
  border: 1px solid var(--border-light);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.certificate-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px var(--shadow-hover);
}



.certificate-card:hover .certificate-image {
  transform: scale(1.05);
}

.certificate-details {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 12px;
}

.certificate-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}

.certificate-issuer {
  font-size: 0.95rem;
  color: #64748b;
  margin-bottom: 10px;
  flex-grow: 1;
}

body.dark-mode .certificate-issuer {
  color: #aebfd4;
}


/* --- ABOUT / CONTACT / FOOTER --- */
.about-me-text, .contact-info-text {
  text-align: center; max-width: 700px; margin: 0 auto 40px; font-size: 1.1rem; color: #64748b;
}
body.dark-mode .about-me-text, body.dark-mode .contact-info-text { color: #aebfd4; }
.about-me-actions { display: flex; justify-content: center; }

#my-form {
  max-width: 600px; margin: 0 auto; padding: 60px;
  background-color: var(--card-background-light);
  border-radius: 24px; border: 1px solid var(--border-light);
}

#my-form input, #my-form textarea {
  width: 100%; padding: 28px; margin-bottom: 30px;
  border-radius: 24px; border: 1px solid var(--border-light);
  background-color: var(--background-light); color: var(--text-dark);
  font-family: inherit; font-size: 1rem;
}

#my-form input:focus, #my-form textarea:focus { outline: none; border-color: var(--primary-color); }

.social-links {
  display: flex; justify-content: center; gap: 30px; margin-top: 60px; flex-wrap: wrap;
}

.social-item {
  display: flex; flex-direction: column; align-items: center; gap: 10px; width: 80px; height: 110px; padding: 25px; transition: transform 0.3s;
}
.social-item:hover { transform: translateY(-5px); }
.social-icon-wrapper svg { width: 30px; height: 30px; fill: var(--text-dark); }
.social-item:hover svg { fill: var(--primary-color); }

.main-footer {
  text-align: center; padding: 40px 20px;
  border-top: 1px solid var(--border-light); margin-top: 60px;
  font-size: 0.9rem; color: #64748b;
}

#dark-mode-toggle, .mobile-menu-button {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background-color: var(--secondary-color); color: var(--text-dark);
}
.mobile-menu-button { display: none; }

/* --- ANIMATIONS --- */
.reveal-element { opacity: 0; transform: translateY(30px); transition: 0.8s ease; }
.reveal-element.is-revealed { opacity: 1; transform: translateY(0); }

/* --- RESPONSIVENESS --- */
@media (max-width: 950px) {
  .main-header { padding: 15px 20px; }
  
  .hero-section {
    padding: 40px 20px;
    height: 550px;
    min-height: auto;
  }
  
  .hero-container {
    flex-direction: column; 
    text-align: center;
    gap: 30px;
  }
  
  .hero-left {
    margin-left: 0; 
    margin-top: 20px;
  }
  
  .hero-heading { font-size: 2.2rem; }
  
  .image-ring { width: 200px; height: 200px; }
}

@media (max-width: 768px) {
  .header-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; background-color: var(--card-background-light);
    padding: 30px; border-bottom: 1px solid var(--border-light);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1); z-index: 999;
  }
  .header-nav.active { display: flex; }
  .mobile-menu-button { display: flex; }
  .header-buttons .primary-button { display: none; }

  .projects-grid, .testimonials-grid { 
    grid-template-columns: 1fr;
  }
  
  #my-form { padding: 30px 20px; }
  
  .main-content { padding: 30px 5%; }
  .content-wrapper { gap: 60px; }
}

@media (max-width: 480px) {
  .hero-heading { font-size: 2rem; }
  .image-ring { width: 170px; height: 170px; }
  .project-links { flex-wrap: wrap; }
  
  .primary-button { padding: 0 20px; width: 100%; }
}
