/* Modern Resume CSS - Main Styles */

/* Hide mobile-only elements on desktop */
.mobile-pdf-button {
  display: none;
}

/* CSS Reset and Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  line-height: 1.6;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-semibold);
  line-height: 1.2;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); }

p {
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

a:focus {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Lists */
ul, ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-lg);
}

li {
  margin-bottom: var(--space-xs);
  color: var(--text-secondary);
}

/* Skip Link for Accessibility */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-md);
  background: var(--color-primary);
  color: var(--text-inverse);
  padding: var(--space-sm) var(--space-md);
  text-decoration: none;
  border-radius: var(--radius-md);
  z-index: var(--z-tooltip);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-md);
}

/* Layout Components */
.main-content {
  padding-top: 4rem; /* Account for fixed navigation */
  min-height: calc(100vh - 4rem);
  /* Prevent layout shift */
  contain: layout style;
}

/* Section Spacing */
section {
  padding: var(--space-md) var(--space-md);
  max-width: 1400px;
  margin: 0 auto;
}

/* Experience and Skills Combined Layout */
.experience-skills-wrapper {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: var(--space-xl);
  align-items: start;
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-md);
}

/* Reset section styles within the wrapper */
.experience-skills-wrapper .section-experience,
.experience-skills-wrapper .section-skills {
  max-width: none;
  margin: 0;
  padding: 0;
}

/* Make skills sticky */
.experience-skills-wrapper .section-skills {
  position: sticky;
  top: 5rem; /* Account for nav height */
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
}

/* Hide scrollbar for skills section */
.experience-skills-wrapper .section-skills {
  /* Hide scrollbar for Chrome, Safari and Opera */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.experience-skills-wrapper .section-skills::-webkit-scrollbar {
  display: none; /* Hide scrollbar for Chrome, Safari and Opera */
}

/* Education in sidebar styling */
.experience-skills-wrapper .section-education {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 2px solid var(--color-primary);
}

.experience-skills-wrapper .section-education .section-title {
  font-size: var(--text-md);
  margin-bottom: var(--space-sm);
}

.experience-skills-wrapper .education-compact {
  font-size: var(--text-xs);
  line-height: 1.4;
  color: var(--text-secondary);
}

.section-title {
  text-align: left;
  margin-bottom: var(--space-md);
  position: relative;
  font-size: var(--text-xl);
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: var(--space-xs);
}

/* Remove the decorative line since we have border-bottom now */

/* Cards and Containers */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--card-shadow);
  transition: all var(--transition-normal);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn:focus {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--button-primary-bg);
  color: var(--button-primary-text);
}

.btn-primary:hover {
  background: var(--button-primary-hover);
  color: var(--button-primary-text);
  text-decoration: none;
}

.btn-secondary {
  background: var(--button-secondary-bg);
  color: var(--button-secondary-text);
  border: 1px solid var(--border-primary);
}

.btn-secondary:hover {
  background: var(--button-secondary-hover);
  color: var(--button-secondary-text);
  text-decoration: none;
}

/* Form Elements */
details {
  margin-bottom: var(--space-md);
}

summary {
  cursor: pointer;
  font-weight: var(--font-medium);
  color: var(--color-primary);
  padding: var(--space-sm) 0;
  user-select: none;
  transition: color var(--transition-fast);
}

summary:hover {
  color: var(--color-primary-hover);
}

summary:focus {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

summary::marker {
  content: '';
}

summary::before {
  content: '▶';
  display: inline-block;
  margin-right: var(--space-xs);
  transition: transform var(--transition-fast);
}

details[open] summary::before {
  transform: rotate(90deg);
}

/* Utility Classes */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-light { font-weight: var(--font-light); }
.font-normal { font-weight: var(--font-normal); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-md { font-size: var(--text-md); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.text-4xl { font-size: var(--text-4xl); }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-muted { color: var(--text-muted); }

.bg-primary { background-color: var(--bg-primary); }
.bg-secondary { background-color: var(--bg-secondary); }
.bg-tertiary { background-color: var(--bg-tertiary); }

/* Grid System */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }

.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* Spacing */
.p-xs { padding: var(--space-xs); }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

.px-xs { padding-left: var(--space-xs); padding-right: var(--space-xs); }
.px-sm { padding-left: var(--space-sm); padding-right: var(--space-sm); }
.px-md { padding-left: var(--space-md); padding-right: var(--space-md); }
.px-lg { padding-left: var(--space-lg); padding-right: var(--space-lg); }
.px-xl { padding-left: var(--space-xl); padding-right: var(--space-xl); }

.py-xs { padding-top: var(--space-xs); padding-bottom: var(--space-xs); }
.py-sm { padding-top: var(--space-sm); padding-bottom: var(--space-sm); }
.py-md { padding-top: var(--space-md); padding-bottom: var(--space-md); }
.py-lg { padding-top: var(--space-lg); padding-bottom: var(--space-lg); }
.py-xl { padding-top: var(--space-xl); padding-bottom: var(--space-xl); }

.m-xs { margin: var(--space-xs); }
.m-sm { margin: var(--space-sm); }
.m-md { margin: var(--space-md); }
.m-lg { margin: var(--space-lg); }
.m-xl { margin: var(--space-xl); }

.mx-auto { margin-left: auto; margin-right: auto; }

/* Experience-Skills Responsive Layout */
@media (max-width: 1200px) {
  .experience-skills-wrapper {
    grid-template-columns: 1fr 350px;
    gap: var(--space-lg);
  }
}

@media (max-width: 1024px) {
  .experience-skills-wrapper {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  .experience-skills-wrapper .section-skills {
    position: static;
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
    order: 1; /* Show skills after experience on mobile */
  }
  
  .experience-skills-wrapper .section-experience {
    order: 0; /* Show experience before skills on mobile */
  }
  
  /* Reset education styling on mobile */
  .experience-skills-wrapper .section-education {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
  }
  
  /* Make skills more compact on mobile */
  .experience-skills-wrapper .skills-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  section {
    padding: var(--space-2xl) var(--space-md);
  }
  
  .experience-skills-wrapper {
    padding: var(--space-md) var(--space-sm);
  }
  
  /* Make skills single column on small mobile */
  .experience-skills-wrapper .skills-container {
    grid-template-columns: 1fr;
  }
  
  /* Improve education readability on mobile */
  .experience-skills-wrapper .education-compact {
    font-size: var(--text-sm);
  }
  
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }
  
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }
}

@media (max-width: 480px) {
  section {
    padding: var(--space-xl) var(--space-sm);
  }
  
  .card {
    padding: var(--space-md);
  }
  
  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-xl); }
  h3 { font-size: var(--text-lg); }
}

/* Focus and Accessibility */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border-primary: #000000;
    --border-secondary: #000000;
    --card-shadow: none;
    --shadow-md: none;
    --shadow-lg: none;
  }
  
  .card {
    border-width: 2px;
  }
}

/* Loading and Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-up {
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}