/* style.css */

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

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  overflow-x: hidden;
  transition: background-color 0.3s, color 0.3s;
}

html {
  scroll-behavior: smooth;
}

/* ==========================================================================
   CSS Custom Properties (Theme Variables)
   ========================================================================== */
:root {
  --bg-color: #f0f2f5;
  --text-color: #333;
  --card-bg: #ffffff;
  --accent-color: #f3c623;
  --border-color: #ddd;
  --secondary-bg: #ececec;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --hover-shadow: rgba(0, 0, 0, 0.2);
  --muted-text: #888;
}

body.dark {
  --bg-color: #121212;
  --text-color: #ddd;
  --card-bg: #1e1e1e;
  --accent-color: #f3c623;
  --border-color: #333;
  --secondary-bg: #2a2a2a;
  --shadow-color: rgba(0, 0, 0, 0.4);
  --hover-shadow: rgba(0, 0, 0, 0.6);
  --muted-text: #aaa;
}

/* ==========================================================================
   Layout and Container
   ========================================================================== */
.container {
  display: flex;
  gap: 50px;
  padding: 50px 200px;
  max-width: 100%;
}

/* ==========================================================================
   Sidebar Styles
   ========================================================================== */
.sidebar {
  position: fixed;
  top: 50px;
  left: 230px;
  width: 355px; /* Updated from 300px to 330px */
  background: var(--card-bg);
  border-radius: 20px;
  box-shadow: 0 10px 30px var(--shadow-color);
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: background-color 0.3s, opacity 0.4s ease-out, transform 0.4s ease-out;
}

body.is-initial-load .sidebar {
  opacity: 0;
  transform: translateX(-30px);
}

.sidebar .sidebar-top,
.sidebar .separator,
.sidebar .contact-list li,
.sidebar .social-icons {
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

body.is-initial-load .sidebar .sidebar-top,
body.is-initial-load .sidebar .separator,
body.is-initial-load .sidebar .contact-list li,
body.is-initial-load .sidebar .social-icons {
  opacity: 0;
  transform: translateX(-20px);
}

body.is-initial-load .sidebar .separator { transition-delay: 0.05s; }
body.is-initial-load .sidebar .contact-list li:nth-child(1) { transition-delay: 0.1s; }
body.is-initial-load .sidebar .contact-list li:nth-child(2) { transition-delay: 0.15s; }
body.is-initial-load .sidebar .contact-list li:nth-child(3) { transition-delay: 0.2s; }
body.is-initial-load .sidebar .contact-list li:nth-child(4) { transition-delay: 0.25s; }
body.is-initial-load .sidebar .social-icons { transition-delay: 0.3s; }

.sidebar-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.avatar-box {
  background: var(--secondary-bg);
  border-radius: 20px;
  padding: 20px;
  width: 120px;
  height: 120px;
  display: flex;
  justify-content: center;
  align-items: center;
}

@keyframes avatar-animate {
  0%, 100% { transform: rotate(0); }
  10%, 30% { transform: rotate(-10deg); }
  20%, 40% { transform: rotate(10deg); }
}

.avatar {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 50%;
  animation: avatar-animate 10s infinite ease-in-out;
}

.name {
  font-size: 26px;
  font-weight: 600;
  margin: 10px 0 5px;
  color: var(--text-color);
}

.role {
  font-size: 13px;
  background: var(--secondary-bg);
  padding: 6px 12px;
  border-radius: 10px;
  color: var(--text-color);
  margin: 20px 0px 10px 0px; /* Reduced to decrease gap */
}

.separator {
  width: 100%;
  height: 1px;
  background: grey;/*var(--border-color);*/
  margin: 0px 0px 20px 0px; /* Reduced from 20px to decrease gap */
}


.contact-list {
  width: 100%;
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}

.contact-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.icon-box {
  width: 42px;
  height: 42px;
  background: var(--secondary-bg);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 6px var(--shadow-color);
}

.icon-box ion-icon {
  font-size: 20px;
  color: var(--accent-color);
}

.icon-box:hover ion-icon {
  color: var(--text-color);
}

.info .label {
  font-size: 11px;
  color: var(--muted-text);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.info .text {
  font-size: 14px;
  color: var(--text-color);
  font-weight: 400;
}

.download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--accent-color); /* Adjust orange tone */
  color: #000;
  padding: 14px 24px;
  border-radius: 24px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  margin-bottom: 5px;
  box-shadow: 0 4px 10px var(--shadow-color);
  transition: background-color 0.3s, box-shadow 0.3s;
}

.download-btn:hover {
  background: #fff;
  box-shadow: 0 6px 12px var(--hover-shadow);
  color: #f3c623;
  border: 1px solid var(--accent-color);
}

.download-btn ion-icon {
  font-size: 20px;
}

.social-icons {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 15px;
}

.social-icons ion-icon {
  font-size: 20px;
  color: var(--muted-text);
}

.social-icons ion-icon:hover {
  color: var(--accent-color);
}

/* ==========================================================================
   Main Content Styles
   ========================================================================== */
.main {
  margin-left: 400px; /* Updated from 400px to 430px to accommodate wider sidebar */
  flex-grow: 1;
  padding: 20px 40px;
  background: var(--card-bg);
  border-radius: 20px;
  box-shadow: 2px 2px 12px var(--shadow-color);
  transition: background-color 0.3s;
}

.main > section {
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

body.is-loading .main > section {
  opacity: 0;
  transform: translateY(30px);
}

body.is-leaving .main > section {
  opacity: 0;
}

.nav {
  display: flex;
  justify-content: center;
  background: var(--secondary-bg);
  padding: 6px;
  border-radius: 50px;
  width: fit-content;
  margin: 0 auto 40px;
  box-shadow: 0 2px 6px var(--shadow-color);
  border: 1px solid var(--border-color);
  position: relative;
}

.nav a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  padding: 10px 24px;
  border-radius: 50px;
  transition: all 0.3s ease;
  z-index: 1;
}

.nav a.active {
  color: #000;
}
body.dark .nav a.active {
  color: #000;
}
.nav a:hover {
  color: #000;
}

body.dark .nav a {
  color: #ddd;
}

.nav .nav-highlight {
  position: absolute;
  top: 6px;
  left: 6px;
  height: calc(100% - 12px);
  background-color: var(--accent-color);
  border-radius: 50px;
  transition: all 0.4s ease;
  z-index: 0;
}

.nav .nav-highlight.no-transition {
  transition: none;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h2, h3, h4 {
  color: var(--text-color);
  margin-bottom: 15px;
}

p {
  margin-bottom: 15px;
  line-height: 1.6;
  color: var(--text-color);
}

/* ==========================================================================
   About Page - What I'm Doing Section & Certifications
   ========================================================================== */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 20px;
}

.card {
  display: flex;
  background: var(--card-bg);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px var(--shadow-color);
  align-items: flex-start;
  gap: 16px;
  transition: transform 0.2s ease, background-color 0.3s;
}

.card:hover {
  transform: translateY(-5px);
}

.card-icon img {
  width: 40px;
  height: 40px;
}

.card-content h4 {
  margin: 0 0 10px;
  color: var(--text-color);
  font-size: 16px;
  font-weight: 600;
}

.card-content p {
  font-size: 14px;
  color: var(--muted-text);
}

/* Certifications Section - Modern Card Layout */
.section-subtitle {
  margin-top: 2rem;
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
  font-weight: 600;
}

/* Certifications Grid Layout */
.certifications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 20px;
  margin-bottom: 2rem;
}

/* Individual Certification Card */
.cert-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--card-bg);
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 4px 12px var(--shadow-color);
  text-decoration: none;
  color: var(--text-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s;
  border: 1px solid transparent;
  cursor: pointer;
}

.cert-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 24px var(--hover-shadow);
  border-color: var(--accent-color);
}

/* Certification Logo Container */
.cert-logo {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--secondary-bg);
  border-radius: 12px;
  padding: 10px;
  transition: background-color 0.3s;
}

.cert-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cert-card:hover .cert-logo {
  background: var(--accent-color);
}

/* Certification Details */
.cert-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cert-title {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  color: var(--text-color);
  line-height: 1.3;
}

.cert-year {
  font-size: 13px;
  color: var(--muted-text);
  margin: 0;
  font-weight: 500;
}

.cert-cta {
  font-size: 13px;
  color: var(--accent-color);
  font-weight: 600;
  margin-top: 4px;
  transition: color 0.3s;
}

.cert-card:hover .cert-cta {
  color: var(--text-color);
}

/* Legacy certification styles (kept for backwards compatibility) */
.certifications {
  display: flex;
  gap: 4rem;
  flex-wrap: wrap;
}

.cert-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  font-weight: 500;
}

.cert-item .dot {
  width: 8px;
  height: 8px;
  background-color: currentColor;
  border-radius: 50%;
  display: inline-block;
}

.cert-item a {
  text-decoration: none;
  color: inherit;
}

.cert-item a:hover {
  color: #d4a017; /* matches your gold accent */
}

/* ==========================================================================
   Resume Section
   ========================================================================== */
.timeline {
  position: relative;
  padding-left: 0;
  margin: 40px 0 60px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 20px;
  bottom: 0;
  width: 2px;
  background: repeating-linear-gradient(
    to bottom,
    var(--border-color),
    var(--border-color) 5px,
    transparent 5px,
    transparent 10px
  );
}

.timeline-header {
  position: relative;
  height: 40px;
  margin-bottom: 20px;
}

.timeline-icon {
  width: 35px;
  height: 35px;
  background: var(--accent-color);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 6px var(--shadow-color);
  position: absolute;
  top: 0;
  left: -5px;
  z-index: 3;
}

.timeline-icon ion-icon {
  font-size: 18px;
  color: var(--text-color);
}

.timeline-heading {
  margin-left: 50px;
  margin-bottom: 30px;
  color: var(--text-color);
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
}

.timeline-dot {
  position: absolute;
  left: 2px;
  top: 4px;
  width: 20px;
  height: 20px;
  background: var(--card-bg);
  border: 4px solid var(--accent-color);
  border-radius: 50%;
  z-index: 2;
}

.timeline-content {
  margin-left: 50px;
}

.job-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-color);
}

.company-name {
  font-style: italic;
  font-weight: 300;
  font-size: 16px;
}
.job-years {
  font-size: 14px;
  color: var(--accent-color);
  display: block;
  margin-bottom: 4px;
}

.skill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 25px;
}

.skill-info {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 190px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-color);
}

.skill-info img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.skill-bar {
  flex: 1;
  height: 8px;
  background: var(--secondary-bg);
  border-radius: 50px;
  overflow: hidden;
}

.fill {
  height: 100%;
  background: var(--accent-color);
  border-radius: 50px;
}

.skill-percentage {
  width: 40px;
  text-align: right;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-color);
}

/* ==========================================================================
   Portfolio Section
   ========================================================================== */
.portfolio-filters {
  display: flex;
  gap: 5px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.portfolio-filters .filter {
  padding: 10px 20px;
  border: none;
  background: var(--secondary-bg);
  border-radius: 20px;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
}

.portfolio-filters .filter.active,
.portfolio-filters .filter:hover {
  background: var(--accent-color);
  color: var(--text-color);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.portfolio-item {
  background: var(--card-bg);
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 2px 10px var(--shadow-color);
  transition: transform 0.2s ease, background-color 0.3s;
  text-align: center;
}

.portfolio-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
}

.portfolio-item:hover {
  transform: translateY(-5px);
}


.portfolio-item p {
  margin-top: 10px;
  font-weight: 500;
  color: var(--text-color);
}

.portfolio-item a {
  text-decoration: none;
  color: var(--text-color); /* Keeps it consistent with your theme */
  font-weight: 600;
}

.portfolio-item a:hover {
  color: var(--accent-color); /* Optional: add hover effect */
}



/* ==========================================================================
   Contact Section
   ========================================================================== */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 30px;
}

.input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.input-row input,
.contact-form textarea {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  font-size: 14px;
  width: 100%;
  resize: none;
  font-family: 'Poppins', sans-serif;
  background: var(--card-bg);
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.input-row input {
  flex: 1;
  min-width: 240px;
}

.send-btn {
  background: var(--accent-color);
  color: var(--text-color);
  font-weight: 600;
  border: none;
  padding: 14px 20px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  box-shadow: 0 3px 8px var(--shadow-color);
  transition: background-color 0.3s;
}

.send-btn:hover {
  background: #e6b200;
}

.form-message {
  margin-top: 20px;
  text-align: center;
  font-weight: 500;
  display: none;
}

.form-message.visible {
  opacity: 1;
}

/* ==========================================================================
   Theme Toggle Button
   ========================================================================== */
.theme-toggle-btn {
  position: fixed;
  top: 60px;
  right: 210px;
  background: var(--accent-color);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 2px 6px var(--shadow-color);
  z-index: 1000;
  transition: filter 0.3s;
}

.theme-toggle-btn:hover {
  filter: brightness(1.1);
}

.theme-toggle-btn ion-icon {
  font-size: 20px;
  transition: transform 0.3s;
  color: #000;
}

body.dark .theme-toggle-btn ion-icon {
  color: #000;
}

body.dark .timeline-icon ion-icon {
  color: #000;
}

body.dark .avatar-box {
  background: #fff;
}

body.dark .portfolio-filters .filter.active,
body.dark .portfolio-filters .filter:hover {
  background: var(--accent-color);
  color: #000;
}

body.dark .send-btn,
body.dark .send-btn:hover {
  color: #000;
}

body.dark input::placeholder,
body.dark textarea::placeholder {
  color: #fff !important;
}
/* ==========================================================================
   Mobile Layout (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
    align-items: center;
    padding: 20px;
    gap: 20px;
  }

  .sidebar,
  .main {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
  }

  .main {
    margin-left: 0;
    padding: 20px;
    border-radius: 16px;
    box-shadow: none;
  }

  .sidebar {
    position: relative;
    top: 0;
    left: 0;
    padding: 20px;
    border-radius: 16px;
    box-shadow: none;
    margin-bottom: 0px;
  }

  .sidebar-top {
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 16px;
    margin-bottom: 0;
  }

  .avatar-box {
    width: 60px;
    height: 60px;
    padding: 0;
    background: none;
  }

  .avatar {
    width: 60px;
    height: 60px;
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow-color);
    background: var(--secondary-bg);
  }

  .name {
    font-size: 18px;
    margin: 0;
  }

  .role {
    font-size: 12px;
    margin: 4px 0 0;
    padding: 4px 10px;
    border-radius: 8px;
  }

  .sidebar-toggle {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    background: var(--accent-color);
    border: none;
    padding: 6px;
    border-radius: 0 16px 0 20px;
    box-shadow: 0 2px 8px var(--shadow-color);
    width: 34px; /* Match theme-toggle-btn width */
    height: 34px; /* Match theme-toggle-btn height */
    display: flex; /* Center the icon */
    justify-content: center;
    align-items: center;
  }

  .sidebar-toggle ion-icon {
    font-size: 20px;
    color: var(--text-color);
  }

  .contact-list,
  .social-icons {
    display: none;
  }

  .contact-list {
    width: 100%;
    list-style: none;
    padding: 0;
    margin: 0 0 20px; /* Reset default margin */
  }
  
  .contact-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 0px; /* Reduced from 14px */
  }


  .icon-box {
    width: 32px; /* Reduced from 42px */
    height: 32px; /* Reduced from 42px */
    background: var(--secondary-bg);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 6px var(--shadow-color);
  }

  .icon-box ion-icon {
    font-size: 16px; /* Reduced from 20px */
    color: var(--accent-color);
  }

  .icon-box:hover ion-icon {
    color: var(--text-color);
  }

  .info .label {
    font-size: 10px; /* Reduced from 11px */
    color: var(--muted-text);
    text-transform: uppercase;
    margin-bottom: 4px;
  }

  .info .text {
    font-size: 12px; /* Reduced from 14px */
    color: var(--text-color);
    font-weight: 400;
  }

  .social-icons {
    gap: 15px;
    justify-content: center;
    margin-top: 15px; /* Reset default margin */
  }

  .social-icons ion-icon {
    font-size: 20px;
    color: var(--muted-text);
  }

  .social-icons ion-icon:hover {
    color: var(--accent-color);
  }
    
  .sidebar.show-details .contact-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 5px;
  }

  .sidebar.show-details .social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 0; /* Reduced from 15px */
    margin-bottom: 0;
  }

  .separator {
    display: none;
    margin: 10px 0;
  }
  


  .sidebar.show-details .separator {
    display: block;
  }

  .nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    padding: 8px;
    background: var(--card-bg);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -2px 10px var(--shadow-color);
    z-index: 999;
    display: flex;
    justify-content: space-around;
    margin: 0;
  }

  .nav a {
    font-size: 14px;
    padding: 8px 16px;
  }

  p {
    font-size: 14px;
  }

  .skills-section span {
    font-size: 14px;
  }

  .timeline {
    margin-top: 0;
    padding-top: 0;
  }

  /* Certifications Mobile Responsive */
  .certifications-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .cert-card {
    padding: 18px;
    gap: 16px;
  }

  .cert-logo {
    width: 56px;
    height: 56px;
  }

  .cert-title {
    font-size: 16px;
  }

  .cert-year {
    font-size: 12px;
  }

  .cert-cta {
    font-size: 12px;
  }

  .theme-toggle-btn {
    display: block;
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--accent-color);
    border: none;
    padding: 6px;
    border-radius: 16px 0px 20px 0px;
    z-index: 1000;
    cursor: pointer;
    box-shadow: 0 2px 8px var(--shadow-color);
    width: 34px;
    height: 34px; /* Match sidebar-toggle height */
    display: flex; /* Center the icon */
    justify-content: center;
    align-items: center;
  }

  .theme-toggle-btn ion-icon {
    font-size: 20px;
    color: var(--text-color);
  }

  body.dark .theme-toggle-btn ion-icon {
    color: #000; /* Black icon color in dark theme */
  }
  
  body.dark .sidebar-toggle ion-icon {
    color: #000; /* Black icon color in dark theme */
  }
}

/* ==========================================================================
   Desktop Sidebar Reset (min-width: 769px)
   ========================================================================== */
@media (min-width: 769px) {
  .sidebar-top {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
  }

  .avatar-box {
    margin-bottom: 10px;
    background: var(--secondary-bg);
    width: 120px;
    height: 120px;
    padding: 20px;
  }

  .sidebar-info {
    text-align: center;
  }

  .sidebar-toggle {
    display: none;
  }
  /* Reset contact-list and social-icons styles for desktop */
  .contact-list {
    margin: 0 0 20px;
  }

  .contact-list li {
    margin-bottom: 14px;
  }

  .icon-box {
    width: 42px;
    height: 42px;
  }

  .icon-box ion-icon {
    font-size: 20px;
  }

  .info .label {
    font-size: 11px;
  }

  .info .text {
    font-size: 14px;
  }

  .social-icons {
    margin-top: 15px;
  }
}