/* Importing Custom Fonts */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&family=Open+Sans:wght@400;600;700&family=Lora:wght@400;600;700&display=swap');

/* General Styles */
:root {
  --primary-color: #b7ccb8;
  --secondary-color: #ebd8c1;
  --dark-bg: #2c2c2c;
  --light-text: #ffffff;
  --dark-text: #333333;
  --overlay-opacity: 0.7;
  --section-padding: 80px 20px;
  --card-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  --transition-speed: 0.3s;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Roboto', sans-serif;
  line-height: 1.6;
  color: #fff; /* Strong white for best contrast */
  background: linear-gradient(135deg, #4CAF50, #FF8C00, #3B5998, #8B0000);
  background-size: 400% 400%;
  animation: gradientAnimation 15s ease infinite;
  overflow-x: hidden;
  text-shadow: 0 2px 8px rgba(0,0,0,0.7); /* Add shadow for readability */
}

/* Make sure all main text elements use high-contrast color */
.section-title,
.summary-content .lead,
.highlight-box,
.highlight-box h3,
.highlight-box li,
.highlight-box p
.timeline-content,
.timeline-content h3,
.timeline-content h4,
.education-card,
.education-card h3,
.education-item h4,
.repo-card,
.repo-name,
.repo-description,
.repo-link,
.contact-info,
.contact-info a,
.social-links a {
  color: #fff !important;
  text-shadow: 0 2px 8px rgba(0,0,0,0.7);
}

/* For links, use a brighter accent on hover for clarity */
a:hover, a:focus {
  color: #ffe066 !important;
  text-shadow: 0 2px 8px rgba(0,0,0,0.7);
}

/* Gradient Animation */
@keyframes gradientAnimation {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--dark-bg);
  color: white;
  padding: 8px;
  z-index: 100;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header Styles */
header {
  background: rgba(0, 0, 0, var(--overlay-opacity));
  padding: 6px 0; /* Reduced from 15px 0 */
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px; /* Ensures a smaller but consistent height */
}

header h1 {
  font-family: 'Lora', serif;
  font-size: 1.5rem; /* Reduced from 2.5rem */
  margin: 0;
  color: var(--light-text);
}

#position {
  font-family: 'Open Sans', sans-serif;
  font-size: 1rem; /* Reduced from 1.2rem */
  margin: 2px 0 0;
  color: var(--primary-color);
}

/* Navigation */
#main-nav ul {
  display: flex;
  list-style: none;
  gap: 25px;
}

#main-nav a {
  color: var(--light-text);
  text-decoration: none;
  font-family: 'Open Sans', sans-serif;
  font-weight: 600;
  font-size: 1rem; /* Slightly smaller nav links */
  transition: color var(--transition-speed);
  padding: 2px 0;
  position: relative;
}

#main-nav a:hover,
#main-nav a:focus {
  color: var(--primary-color);
}

#main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width var(--transition-speed);
}

#main-nav a:hover::after {
  width: 100%;
}

#menu-button {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.8rem;
  cursor: pointer;
  padding: 5px;
}

/* Mobile Menu */
#dropdown-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 10vw; /* Make the dropdown menu about 1/10th of the screen width */
  min-width: 120px;   /* Optional: set a minimum width for usability */
  max-width: 180px;   /* Optional: set a maximum width */
  background: rgba(0, 0, 0, 0.97);
  z-index: 2000;
  border-radius: 0 0 12px 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  transform: translateY(-100%);
  transition: transform 0.4s ease;
  padding-top: 60px; /* Adjust if you want space below the navbar */
  height: auto; /* Let the menu grow with content */
}

#dropdown-menu.visible {
  transform: translateY(0);
}

#menu-list {
  list-style: none;
  padding: 20px;
}

#menu-list li {
  margin-bottom: 15px;
}

#menu-list a {
  color: white;
  text-decoration: none;
  font-size: 1.2rem;
  display: block;
  padding: 10px;
  transition: color var(--transition-speed);
}

#menu-list a:hover {
  color: var(--primary-color);
}

@media (max-width: 768px) {
  #dropdown-menu {
    width: 80vw; /* Slightly wider on small screens if you want */
    min-width: 180px;
    max-width: 100vw;
    padding-top: 60px;
  }
}

/* Section Styles */
section {
  padding: var(--section-padding);
  position: relative;
}

section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: -1;
}

.section-title {
  font-family: 'Lora', serif;
  font-size: 2.5rem;
  margin-bottom: 40px;
  text-align: center;
  position: relative;
  color: var(--light-text);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: var(--primary-color);
}

/* About Section */
.profile-img {
  width: 250px;
  height: 250px;
  object-fit: cover;
  border: 5px solid var(--light-text);
  box-shadow: var(--card-shadow);
}

.summary-content {
  padding: 20px;
}

.summary-content .lead {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 20px;
  color: var(--light-text);
}

.highlight-box {
  background: rgba(0, 0, 0, 0.4);
  border-left: 4px solid var(--primary-color);
  padding: 20px;
  margin: 20px 0;
  border-radius: 0 5px 5px 0;
}

.highlight-box h3 {
  margin-bottom: 10px;
  color: var(--light-text);
}

.highlight-box ul {
  padding-left: 20px;
}

.highlight-box li {
  margin-bottom: 8px;
}

.cta-buttons {
  display: flex;
  gap: 15px;
  margin-top: 30px;
}

.btn {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 600;
  transition: all var(--transition-speed);
}

.btn-primary {
  background: var(--primary-color);
  color: white;
  border: 2px solid var(--primary-color);
}

.btn-primary:hover {
  background: transparent;
  color: var(--primary-color);
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-outline-primary:hover {
  background: var(--primary-color);
  color: white;
}

/* Experience Section */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: var(--primary-color);
}

.timeline-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 40px;
  position: relative;
}

.timeline-date {
  width: 45%;
  padding: 10px;
  text-align: right;
  font-weight: 600;
  color: var(--primary-color);
}

.timeline-content {
  width: 45%;
  padding: 20px;
  background: rgba(229, 235, 178, 0.616);
  border-radius: 5px;
  box-shadow: var(--card-shadow);
  position: relative;
}

.timeline-content::before {
  content: '';
  position: absolute;
  top: 20px;
  right: -10px;
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 10px solid rgba(0, 0, 0, 0.4);
}

.timeline-item:nth-child(even) .timeline-date {
  order: 2;
  text-align: left;
}

.timeline-item:nth-child(even) .timeline-content {
  order: 1;
}

.timeline-item:nth-child(even) .timeline-content::before {
  right: auto;
  left: -10px;
  border-left: none;
  border-right: 10px solid rgba(0, 0, 0, 0.4);
}

.timeline-content h3 {
  color: var(--primary-color);
  margin-bottom: 5px;
}

.timeline-content h4 {
  margin-bottom: 10px;
}

.timeline-content h4 a {
  color: var(--light-text);
  text-decoration: none;
}

.timeline-content h4 a:hover {
  text-decoration: underline;
}

/* Education Section */
.education-card {
  background: rgba(0, 0, 0, 0.4);
  padding: 25px;
  border-radius: 5px;
  height: 100%;
  box-shadow: var(--card-shadow);
}

.education-card h3 {
  color: var(--primary-color);
  margin-bottom: 20px;
  font-size: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 10px;
}

.education-item {
  margin-bottom: 20px;
}

.education-item h4 {
  font-size: 1.2rem;
  margin-bottom: 5px;
}

.education-item p {
  margin-bottom: 5px;
  opacity: 0.9;
}

.cert-link {
  display: inline-block;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  margin-top: 5px;
  transition: opacity var(--transition-speed);
}

.cert-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Skills Section */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 25px;
  max-width: 1000px;
  margin: 0 auto;
}

.skill-card {
  background: rgba(226, 230, 182, 0.363);
  padding: 25px;
  border-radius: 5px;
  text-align: center;
  transition: transform var(--transition-speed);
  box-shadow: var(--card-shadow);
}

.skill-card:hover {
  transform: translateY(-5px);
}

.skill-icon {
  font-size: 4.5rem;
  margin-bottom: 15px;
  color: unset !important;
  filter: none !important;
}

.skill-icon i {
  color: inherit !important;
  filter: none !important;
}

.skill-card h3 {
  margin-bottom: 10px;
  font-size: 1.3rem;
}

.skill-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  margin-top: 15px;
  overflow: hidden;
}

.skill-level {
  height: 100%;
  background: var(--primary-color);
  border-radius: 4px;
}

/* Projects Section */
.project-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 15px;
}

.search-filter {
  position: relative;
  flex-grow: 1;
  max-width: 400px;
}

.search-filter i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.7);
}

#repo-filter {
  width: 100%;
  padding: 10px 15px 10px 40px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  color: white;
}

#repo-filter:focus {
  outline: none;
  border-color: var(--primary-color);
}

#repo-sort {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 10px 15px;
  border-radius: 5px;
}

#repo-sort:focus {
  outline: none;
  border-color: var(--primary-color);
}

.repo-card {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 5px;
  overflow: hidden;
  transition: transform var(--transition-speed);
  box-shadow: var(--card-shadow);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.repo-card:hover {
  transform: translateY(-5px);
}

.repo-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.repo-name {
  color: var(--primary-color);
  margin-bottom: 5px;
  font-size: 1.2rem;
}

.repo-description {
  margin-bottom: 10px;
  opacity: 0.8;
}

.repo-meta {
  display: flex;
  gap: 15px;
  font-size: 0.9rem;
  opacity: 0.7;
}

.repo-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.repo-footer {
  margin-top: auto;
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: space-between;
}

.repo-link {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-speed);
}

.repo-link:hover {
  color: var(--primary-color);
}

/* Contact Section */
.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  max-width: 1000px;
  margin: 0 auto;
}

.contact-info h3,
.social-links h3 {
  color: var(--primary-color);
  margin-bottom: 20px;
  font-size: 1.5rem;
}

.contact-info p {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.contact-info a {
  color: white;
  text-decoration: none;
  transition: color var(--transition-speed);
}

.contact-info a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.social-links ul {
  list-style: none;
}

.social-links li {
  margin-bottom: 15px;
}

.social-links a {
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color var(--transition-speed);
}

.social-links a:hover {
  color: var(--primary-color);
}

.social-links i {
  font-size: 1.2rem;
  width: 25px;
  text-align: center;
}

.copyright {
  opacity: 0.7;
  font-size: 0.9rem;
}

/* Back to Top Button */
#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-speed);
  z-index: 99;
  text-decoration: none;
}

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

#back-to-top:hover {
  background: var(--secondary-color);
  transform: translateY(-3px);
}

/* Responsive Styles */
@media (max-width: 992px) {
  .contact-content {
    grid-template-columns: 1fr;
  }
  
  .timeline::before {
    left: 30px;
  }
  
  .timeline-item {
    flex-direction: column;
  }
  
  .timeline-date,
  .timeline-content {
    width: 100%;
    text-align: left;
  }
  
  .timeline-date {
    margin-bottom: 10px;
  }
  
  .timeline-content::before {
    display: none;
  }
}

@media (max-width: 768px) {
  #main-nav {
    display: none;
  }
  
  #menu-button {
    display: block;
  }
  
  .header-content {
    flex-wrap: wrap;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .skills-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  
  .profile-img {
    width: 200px;
    height: 200px;
  }
  
  .cta-buttons {
    flex-direction: column;
  }
}

@media (max-width: 576px) {
  .section-title {
    font-size: 1.8rem;
  }
  
  header h1 {
    font-size: 2rem;
  }
  
  #position {
    font-size: 1rem;
  }
  
  .summary-content .lead {
    font-size: 1.2rem;
  }
  
  .project-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-filter {
    max-width: 100%;
  }
}

/* Skill Icons Color Customization */
.skill-icon .fa-html5 { color: #e34c26 !important; }
.skill-icon .fa-css3-alt { color: #1572b6 !important; }
.skill-icon .fa-js { color: #f7df1e !important; }
.skill-icon .fa-react { color: #61dafb !important; }
.skill-icon .fa-python { color: #3776ab !important; }
.skill-icon .fa-php { color: #777bb4 !important; }
.skill-icon .fa-git-alt { color: #f34f29 !important; }
.skill-icon .fa-bootstrap { color: #7952b3 !important; }