/* 
   Modern CV Stylesheet for MarTech Specialist
   2025 Edition - Mobile Optimized
*/

:root {
  /* Primary colors - updated to a more sophisticated palette */
  --primary-color: #5a67d8; /* Indigo */
  --primary-dark: #4c51bf;
  --primary-light: #7f9cf5;
  
  /* Neutral colors */
  --text-dark: #1a202c;
  --text-light: #f7fafc;
  --text-muted: #718096;
  --bg-light: #ffffff;
  --bg-dark: #0f172a;
  --bg-alternate: #f7fafc;
  
  /* Accent colors */
  --accent-color: #38b2ac; /* Teal */
  --accent-light: #4fd1c5;
  --accent-dark: #2c7a7b;
  
  /* UI colors */
  --border-color: #e2e8f0;
  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  --hover-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  
  /* Typography - updated to more modern and readable fonts */
  --font-heading: 'DM Serif Display', Georgia, serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Spacing system - increased for more breathing room */
  --space-xs: 0.375rem;    /* 6px */
  --space-sm: 0.75rem;     /* 12px */
  --space-md: 1.25rem;     /* 20px */
  --space-lg: 2rem;        /* 32px */
  --space-xl: 3rem;        /* 48px */
  --space-2xl: 5rem;       /* 80px */
  --space-3xl: 8rem;       /* 128px - new extra large spacing */
  
  /* Border radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.5rem;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 500ms ease;
  
  /* Z-index layers */
  --z-nav: 1000;
  --z-modal: 2000;
  --z-tooltip: 3000;
}

/* Dark mode theme variables */
.dark-mode {
  --primary-color: #7f9cf5;
  --primary-dark: #5a67d8;
  --primary-light: #a3bffa;
  
  --text-dark: #f7fafc;
  --text-light: #1a202c;
  --text-muted: #a0aec0;
  --bg-light: #1a202c;
  --bg-dark: #f7fafc;
  --bg-alternate: #2d3748;
  
  --border-color: #4a5568;
  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  max-width: 100%; /* Ensure no element exceeds its container width */
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 3rem;
  font-size: 16px; /* Base font size */
}

@media (min-width: 1200px) {
  html {
    font-size: 18px; /* Slightly larger base font size on large screens */
  }
}

body {
  font-family: var(--font-body);
  color: var(--text-dark);
  background-color: var(--bg-light);
  line-height: 1.7; /* Increased line height for better readability */
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  letter-spacing: 0.01em;
}

img {
  max-width: 100%;
  height: auto;
}
.img-circle {
  border-radius: 50%;
}
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* Container - adjusted for mobile */
.container {
  width: 100%;
  max-width: 1300px; /* Increased max-width for more spacious layout */
  margin: 0 auto;
  padding: 0 var(--space-md); /* Reduced side padding for mobile by default */
  overflow-x: hidden; /* Prevent horizontal scroll on mobile */
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--space-lg); /* Larger padding on larger screens */
  }
}

.section-padding {
  padding: var(--space-2xl) 0;
}

@media (min-width: 992px) {
  .section-padding {
    padding: var(--space-3xl) 0; /* Increased padding on desktop */
  }
}

.alternate-bg {
  background-color: var(--bg-alternate);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-md);
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem); /* Larger heading */
  margin-bottom: var(--space-lg);
}

h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  margin-bottom: var(--space-lg);
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  margin-bottom: var(--space-md);
}

p {
  margin-bottom: var(--space-lg); /* Increased margin */
  font-size: 1.1rem;
}

.section-title {
  position: relative;
  display: inline-block;
  margin-bottom: var(--space-xl);
  font-family: var(--font-heading);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -15px; /* Position further from text */
  left: 0;
  width: 100px; /* Wider underline */
  height: 5px; /* Thicker underline */
  background: var(--primary-color);
  border-radius: var(--radius-full);
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  top: var(--space-md);
  right: var(--space-md);
  z-index: var(--z-nav);
}

#theme-switch {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-light);
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dark);
  font-size: 1.25rem;
  transition: transform var(--transition-fast);
}

#theme-switch:hover {
  transform: scale(1.1);
}

.dark-icon, .light-icon {
  position: absolute;
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}

body:not(.dark-mode) .dark-icon {
  opacity: 1;
  transform: rotate(0);
}

body:not(.dark-mode) .light-icon {
  opacity: 0;
  transform: rotate(90deg);
}

body.dark-mode .dark-icon {
  opacity: 0;
  transform: rotate(-90deg);
}

body.dark-mode .light-icon {
  opacity: 1;
  transform: rotate(0);
}

/* Navigation */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) 0;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: var(--space-lg);
}

.nav-links a {
  color: var(--text-dark);
  font-weight: 500;
  position: relative;
}

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

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

.menu-toggle {
  display: none;
  font-size: 1.5rem;
}

/* Hero Section */
.hero {
  padding: var(--space-2xl) 0;
  overflow: hidden;
}

@media (min-width: 992px) {
  .hero {
    padding: var(--space-3xl) 0; /* More space on desktop */
    min-height: 90vh; /* Taller hero section on desktop */
    display: flex;
    align-items: center;
  }
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
}

@media (min-width: 992px) {
  .hero-content {
    gap: var(--space-2xl); /* More space between columns on desktop */
  }
}

.hero-text {
  max-width: 650px; /* Slightly wider text container */
}

.animated-text {
  position: relative;
  display: inline-block;
  overflow: hidden;
  font-family: var(--font-heading);
}

.animated-text::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0.1em;
  background-color: var(--primary-color);
  transform: scaleX(0);
  transform-origin: left;
  animation: underline 1.5s cubic-bezier(0.76, 0, 0.24, 1) forwards 0.5s;
}

@keyframes underline {
  to {
    transform: scaleX(1);
  }
}

.hero h2 {
  color: var(--primary-color);
  margin-bottom: var(--space-md);
}

.intro-text {
  font-size: 1.35rem; /* Larger intro text */
  margin-bottom: var(--space-xl);
  color: var(--text-muted);
  line-height: 1.6;
}

.cta-buttons {
  display: flex;
  gap: var(--space-md);
}

.primary-btn, .secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.primary-btn {
  background: var(--primary-color);
  color: white;
}

.primary-btn:hover {
  background: var(--primary-dark);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}

.secondary-btn {
  background: transparent;
  color: var(--text-dark);
  border: 1px solid var(--border-color);
}

.secondary-btn:hover {
  color: var(--primary-color);
  border-color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.profile-container {
  position: relative;
  width: 300px;
  height: 300px;
  overflow: hidden;
}

.profile-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8rem;
  color: rgba(255, 255, 255, 0.8);
}

/* About Section */
.about-content {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: var(--space-xl);
  align-items: start;
}

@media (min-width: 992px) {
  .about-content {
    gap: var(--space-2xl); /* More space between columns on desktop */
  }
}

.about-text p {
  margin-bottom: var(--space-md);
  font-size: 1.15rem;
  line-height: 1.8; /* Increased line height for readability */
}

.personal-info {
  margin-top: var(--space-xl);
  display: grid;
  gap: var(--space-md);
}

.info-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.info-item i {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alternate);
  border-radius: var(--radius-full);
  font-size: 1.25rem;
  color: var(--primary-color);
}

.stats-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.stat-card {
  background: var(--bg-light);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--card-shadow);
  text-align: center;
  transition: transform var(--transition-normal);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--hover-shadow);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: var(--space-xs);
  font-family: var(--font-heading);
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Experience Section */
.timeline {
  position: relative;
  max-width: 900px; /* Wider timeline container */
  margin: 0 auto;
}

@media (min-width: 992px) {
  .timeline {
    margin: var(--space-xl) auto; /* Add top/bottom margin on desktop */
  }
}

.timeline::before {
  content: '';
  position: absolute;
  width: 3px; /* Slightly thicker line */
  background: var(--border-color);
  top: 0;
  bottom: 0;
  left: 120px;
}

.timeline-item {
  display: flex;
  margin-bottom: var(--space-2xl); /* More space between timeline items */
  position: relative;
}

.timeline-date {
  flex: 0 0 120px;
  padding-top: 0.5rem;
  font-weight: 600;
  color: var(--text-muted);
}

.timeline-dot {
  position: absolute;
  left: 120px;
  width: 16px;
  height: 16px;
  background: var(--primary-color);
  border-radius: var(--radius-full);
  transform: translateX(-50%);
  border: 3px solid var(--bg-light);
  z-index: 1;
}

.timeline-content {
  flex: 1;
  background: var(--bg-light);
  border-radius: var(--radius-md);
  padding: var(--space-xl); /* More padding inside timeline content */
  margin-left: var(--space-lg);
  box-shadow: var(--card-shadow);
  transition: transform var(--transition-normal);
}

.timeline-content:hover {
  transform: translateX(5px);
  box-shadow: var(--hover-shadow);
}

.timeline-content h3 {
  margin-bottom: var(--space-xs);
  color: var(--primary-color);
}

.timeline-content h4 {
  margin-bottom: var(--space-md);
  color: var(--text-muted);
  font-weight: 400;
}

.timeline-content ul {
  list-style-position: inside;
  padding-left: var(--space-sm);
}

.timeline-content li {
  margin-bottom: var(--space-sm);
}

/* Skills Section */
.skills-container {
  display: grid;
  grid-template-columns: repeat(3, minmax(250px, 1fr)); /* Wider columns */
  gap: var(--space-2xl); /* More space between skill categories */
  margin-bottom: var(--space-2xl);
}

.skills-category h3 {
  margin-bottom: var(--space-lg);
  position: relative;
  display: inline-block;
  font-size: 1.75rem; /* Larger category titles */
}

.skills-category h3::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--primary-color);
  border-radius: var(--radius-full);
}

.skills-grid {
  display: grid;
  gap: var(--space-lg); /* More space between skill items */
}

.skill-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.skill-name {
  font-weight: 500;
}

.skill-bar {
  height: 8px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.skill-level {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  border-radius: var(--radius-full);
  width: 0;
  transition: width 1.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.tools-cloud {
  margin-top: var(--space-2xl);
}

.tools-cloud h3 {
  margin-bottom: var(--space-lg);
  text-align: center;
}

.tools-container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
}

.tool-tag {
  background: var(--bg-light);
  color: var(--text-dark);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.tool-tag:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(37, 99, 235, 0.2);
}

/* Projects Section */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); /* Wider project cards */
  gap: var(--space-2xl); /* More space between projects */
  padding-bottom: 40px;
}

.project-card {
  background: var(--bg-light);
  border-radius: var(--radius-lg); /* Larger border radius */
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--hover-shadow);
}

.project-header {
  padding: var(--space-xl) var(--space-xl) 0; /* More padding */
}

.project-header h3 {
  margin-bottom: var(--space-md);
}

.project-body {
  padding: var(--space-xl); /* More padding */
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-highlights {
  margin: var(--space-md) 0;
  list-style-position: inside;
  padding-left: var(--space-sm);
}

.project-highlights li {
  margin-bottom: var(--space-xs);
}

.project-tech {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.project-tech span {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-color);
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
}

/* Education Section */
.education-container {
  max-width: 900px; /* Wider container */
  margin: 0 auto var(--space-2xl);
}

.education-item {
  display: flex;
  gap: var(--space-xl); /* More space between icon and content */
  margin-bottom: var(--space-2xl); /* More space between education items */
}

.education-icon {
  flex: 0 0 60px;
  height: 60px;
  background: var(--primary-color);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
}

.education-details {
  flex: 1;
}

.education-details h3 {
  margin-bottom: var(--space-xs);
}

.education-details h4 {
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: var (--space-xs);
}

.education-date {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: var(--space-sm);
}

.certifications-container h3 {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.certifications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Wider certification cards */
  gap: var(--space-xl); /* More space between certifications */
  padding-bottom: 40px;
}

.certification-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--bg-light);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  transition: transform var(--transition-normal);
}

.certification-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--hover-shadow);
}

.certification-logo {
  flex: 0 0 40px;
  height: 40px;
  background: var(--primary-light);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: white;
}

.certification-details h4 {
  margin-bottom: 0;
}

.certification-details p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* Testimonials Section */
.testimonials-slider {
  position: relative;
  margin-bottom: var(--space-xl);
  max-width: 900px; /* Wider testimonial container */
  margin: 0 auto;
}

.testimonial-item {
  background: var(--bg-light);
  border-radius: var(--radius-lg); /* Larger border radius */
  padding: var(--space-2xl); /* Much more padding for testimonials */
  box-shadow: var(--card-shadow);
}

.quote-icon {
  font-size: 2rem;
  color: var(--primary-light);
  opacity: 0.3;
  margin-bottom: var(--space-md);
}

.testimonial-author {
  margin-top: var(--space-lg);
}

.author-name {
  font-weight: 600;
}

.author-title {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.testimonial-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var (--space-md);
  margin-top: var(--space-xl);
}

.testimonial-prev, .testimonial-next {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-light);
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dark);
  font-size: 1.25rem;
  transition: transform var(--transition-fast);
}

.testimonial-prev:hover, .testimonial-next:hover {
  transform: scale(1.1);
  color: var(--primary-color);
}

.testimonial-indicators {
  display: flex;
  gap: var(--space-sm);
  padding: 30px 15px;
}

.indicator {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--border-color);
  cursor: pointer;
  transition: background-color var(--transition-normal), transform var(--transition-normal);
}

.indicator.active {
  background: var(--primary-color);
  transform: scale(1.2);
}

/* Contact Section */
.contact-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl); /* More space between columns */
  max-width: 1100px; /* Wider contact container */
  margin: 0 auto;
}

.contact-info h3, .contact-form h3 {
  margin-bottom: var(--space-lg);
}

.contact-items {
  display: grid;
  gap: var(--space-lg);
  margin: var(--space-xl) 0;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.contact-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-full);
  background: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
}

.contact-text h4 {
  margin-bottom: var(--space-xs);
}

.contact-text p {
  margin-bottom: 0;
  color: var(--text-muted);
}

.availability {
  margin-top: var(--space-xl);
}

.availability h4 {
  margin-bottom: var(--space-sm);
}

.availability-status {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
}

.available .status-indicator {
  background: var(--accent-color);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

.form-group {
  margin-bottom: var(--space-md);
}

label {
  display: block;
  margin-bottom: var(--space-xs);
  font-weight: 500;
}

input, textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-light);
  color: var(--text-dark);
  font-family: var(--font-body);
  transition: border-color var(--transition-fast);
}

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

.submit-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--primary-color);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  margin-top: var(--space-sm);
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.submit-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}

/* Footer */
footer {
  background: var(--bg-alternate);
  padding: var(--space-2xl) 0 var(--space-lg);
  margin-top: var(--space-3xl); /* More space above footer */
}

.footer-content {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
  padding-top: 20px;
}

.footer-logo h3 {
  margin-bottom: var(--space-xs);
}

.footer-logo p {
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
}

.social-links {
  display: flex;
  gap: var(--space-md);
}

.social-links a {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dark);
  font-size: 1.25rem;
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.social-links a:hover {
  transform: translateY(-5px);
  background: var(--primary-color);
  color: white;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Responsive Styles */
@media (max-width: 992px) {
  html {
    font-size: 15px; /* Slightly reduced base font size on tablet */
  }
  
  .container {
    width: 100%;
    max-width: 100%;
  }
  
  .hero-content,
  .about-content,
  .contact-container {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  .hero-image {
    order: -1;
    margin: 0 auto; /* Center the profile image */
  }
  
  .profile-container {
    width: 250px; /* Smaller profile container on tablet */
    height: 250px;
  }
  
  .stats-container {
    margin-top: var(--space-xl);
    grid-template-columns: 1fr 1fr; /* Keep two columns for stats on tablet */
    gap: var(--space-md);
  }
  
  .timeline::before {
    left: 30px;
  }
  
  .timeline-date {
    flex: 0 0 auto;
    width: auto;
    padding-left: var(--space-lg);
    margin-bottom: var(--space-xs);
  }
  
  .timeline-dot {
    left: 30px;
  }
  
  .timeline-item {
    flex-direction: column;
  }
  
  .timeline-content {
    margin-left: var(--space-xl);
    width: auto; /* Ensure content isn't too narrow */
    max-width: 100%; /* Prevent overflow */
  }
  
  /* Ensure project cards have proper width */
  .projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
  
  /* Adjust skill bars for tablet */
  .skills-container {
    grid-template-columns: 1fr; /* Single column layout for tablets */
  }
  
  /* Wider certification items */
  .certifications-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  html {
    font-size: 14px; /* Smaller base font size on mobile */
  }
  
  .container {
    padding: 0 var(--space-sm); /* Tighter padding on very small screens */
  }
  
  .section-padding {
    padding: var(--space-xl) 0; /* Less vertical padding on mobile */
  }
  
  h1 {
    font-size: clamp(2rem, 8vw, 2.5rem); /* Smaller heading on mobile */
  }
  
  h2 {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }
  
  .nav-links {
    display: none;
  }
  
  .menu-toggle {
    display: block;
  }
  
  .hero-content {
    gap: var(--space-md);
  }
  
  .profile-container {
    width: 200px; /* Even smaller profile on mobile */
    height: 200px;
    margin: 0 auto;
  }
  
  .cta-buttons {
    flex-direction: column;
    width: 100%; /* Full width buttons */
  }
  
  .primary-btn, .secondary-btn {
    width: 100%;
    text-align: center;
    margin-bottom: var(--space-sm);
  }
  
  /* Make stats cards better fit on mobile */
  .stats-container {
    grid-template-columns: 1fr; /* Single column for stats on mobile */
    gap: var(--space-md);
  }
  
  .stat-card {
    padding: var(--space-md);
  }
  
  /* Timeline adjustments for mobile */
  .timeline-content {
    padding: var(--space-md);
    margin-left: var(--space-lg);
  }
  
  /* Project cards full width on mobile */
  .projects-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  .project-header, .project-body {
    padding: var(--space-md);
  }
  
  /* Contact form improvements */
  .contact-container {
    grid-template-columns: 1fr;
  }
  
  /* Footer adjustments */
  .footer-content {
    flex-direction: column;
    gap: var(--space-lg);
    text-align: center;
  }
  
  .footer-links {
    flex-direction: column;
    gap: var(--space-sm);
    align-items: center;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: var(--space-sm);
    align-items: center;
    text-align: center;
  }
  
  /* Tools cloud adjustment */
  .tools-container {
    justify-content: center;
  }
  
  .tool-tag {
    margin-bottom: var(--space-xs);
  }
  
  /* Make testimonials more compact */
  .testimonial-item {
    padding: var(--space-lg);
  }
  
  /* Fix for nav menu when active on mobile */
  .nav-links.active {
    width: calc(100% - var(--space-md) * 2);
    right: var(--space-md);
  }
}

/* Fix for very small screens */
@media (max-width: 400px) {
  .container {
    padding: 0 var(--space-xs);
  }
  
  .timeline-content {
    margin-left: var(--space-md);
    padding: var(--space-sm);
  }
  
  .section-title {
    font-size: 1.75rem;
  }
  
  .timeline::before {
    left: 20px;
  }
  
  .timeline-dot {
    left: 20px;
  }
  
  /* Better spacing for small screens */
  .skill-item, .project-highlights li, .contact-item {
    margin-bottom: var(--space-xs);
  }
  
  .education-item {
    gap: var(--space-sm);
  }
  
  .education-icon {
    flex: 0 0 45px;
    height: 45px;
  }
  
  /* Ensure forms are properly sized */
  input, textarea {
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
  }
}

/* Additional spacing modifications for desktop */
@media (min-width: 992px) {
  .card-shadow {
    box-shadow: var(--card-shadow);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
  }
  
  .stat-card {
    padding: var(--space-xl); /* More padding in stat cards */
  }
  
  .tools-cloud {
    margin-top: var(--space-3xl); /* More space above tools cloud */
    margin-bottom: var(--space-xl); /* Space below */
  }
  
  .tools-container {
    gap: var(--space-md); /* More space between tools */
  }
  
  .tool-tag {
    padding: 0.75rem 1.5rem; /* Larger tool tags */
    font-size: 1rem;
  }
  
  .testimonial-controls {
    margin-top: var(--space-2xl); /* More space above controls */
  }
  
  .contact-items {
    gap: var(--space-xl); /* More space between contact items */
  }
  
  .form-group {
    margin-bottom: var(--space-lg); /* More space between form groups */
  }
  
  input, textarea {
    padding: 1rem 1.25rem; /* Larger input fields */
    font-size: 1.1rem;
  }
  
  .submit-btn {
    padding: 1rem 2rem; /* Larger submit button */
    font-size: 1.1rem;
  }
}

/* Fix for any overflow issues */
img, svg, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Ensure code blocks don't cause overflow */
pre, code {
  white-space: pre-wrap;
  word-break: break-word;
}