/* ==========================================================================
   Custom Styling for Yuan Gao's Academic Website
   ========================================================================== */

/* ==========================================================================
   Variables and Global Settings
   ========================================================================== */
:root {
  --primary-color: #72777f;        /* Dark grey for titles and primary text */
  --secondary-color: #f27380;      /* Pink accent color for subtitles in bubbles */
  --tertiary-color: #72777f;       /* Dark grey */
  --background-color: #ffffff;     /* Pure white background */
  --card-background: #ffffff;      /* White cards */
  --text-primary: #72777f;         /* Dark grey text */
  --text-secondary: #72777f;       /* Same grey for descriptions */
  --border-color: #f27380;         /* Subtle borders */
  --shadow-light: 0 1px 8px rgba(0, 0, 0, 0.06);
  --shadow-medium: 0 2px 16px rgba(0, 0, 0, 0.08);
  --shadow-heavy: 0 4px 24px rgba(0, 0, 0, 0.12);
  --border-radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom text selection color */
::selection {
  background-color: var(--secondary-color); /* Pink background */
  color: white; /* White text for better contrast */
}

::-moz-selection {
  background-color: var(--secondary-color); /* Pink background for Firefox */
  color: white; /* White text for better contrast */
}

/* ==========================================================================
   Typography Improvements
   ========================================================================== */
body {
  font-family: 'Academicons';
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--background-color);
}

/* Ensure all text elements use consistent dark grey color */
body, html, p, h1, h2, h3, h4, h5, h6, div, span, .page__content, 
.page__title, .archive__item-title, .masthead__menu-item, .greedy-nav a,
.sidebar a, .breadcrumbs a, .author__name, .author__bio, li, .list__item {
  color: var(--text-primary) !important;
}

/* Links maintain dark grey color */
a {
  color: var(--text-primary) !important;
  text-decoration: none;
}

a:hover {
  color: var(--secondary-color) !important;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1.25rem;  /* Match project container spacing for consistency */
  margin-top: 1.5rem;  /* Add top margin for better spacing from previous content */
  color: var(--text-primary);
}

/* Exception for first heading on page */
h1:first-child, h2:first-child, h3:first-child, 
h4:first-child, h5:first-child, h6:first-child {
  margin-top: 0;
}

h1 { font-size: 1.9rem; }  /* Slightly increased */
h2 { font-size: 1.6rem; }  /* Slightly increased */
h3 { font-size: 1.4rem; }  /* Slightly increased */
h4 { font-size: 1.3rem; }  /* Slightly increased */
h5 { font-size: 1.2rem; }  /* Slightly increased */
h6 { font-size: 1.1rem; }  /* Slightly increased */

p {
  margin-bottom: 1.2rem;
  color: var(--text-primary);
  font-size: 1rem;  /* Increased to match project box text better */
}

/* Fix alignment for content wrapper */
.content-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
  text-align: left;  /* Ensure left alignment */
}

/* Remove unnecessary spacing from Jekyll's default header/title area */
.single {
  padding-top: 0;
}

.single .initial-content {
  margin-top: 0;
  padding-top: 0;
}

.archive {
  padding-top: 0;
}

.archive .initial-content {
  margin-top: 0;
  padding-top: 0;
}

/* Add base margin to push content away from sidebar on larger screens */
@media (min-width: 50em) {
  .archive {
    margin-left: 16rem;  /* Base left margin to avoid sidebar */
    padding-right: 2rem;
  }
}

/* Ensure main content starts right away */
.layout--single .page__inner-wrap,
.layout--archive .page__inner-wrap {
  margin-top: 0;
  padding-top: 0;
}

/* ==========================================================================
   Enhanced Custom Line
   ========================================================================== */
.custom-line {
  width: 60px;
  height: 4px;
  background: var(--primary-color);  /* Solid black */
  border-radius: 2px;
  margin: 0 0 2rem 0;
  position: relative;
}

.custom-line::after {
  content: '';
  position: absolute;
  right: -10px;
  top: -2px;
  width: 8px;
  height: 8px;
  background: var(--secondary-color);  /* Dark gray dot */
  border-radius: 50%;
}

/* ==========================================================================
   Enhanced Project Cards
   ========================================================================== */
.project-container {
  display: grid;
  gap: 1rem;  /* Reduced from 1.5rem for tighter spacing */
  margin: 1rem 0 0 0;  /* Reduce top margin, remove bottom margin */
}

.project-card {
  background: var(--card-background);
  border-radius: var(--border-radius);
  padding: 0.75rem;  /* Reduced from 1rem for more compact horizontal spacing */
  box-shadow: var(--shadow-light);
  transition: var(--transition);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--secondary-color);  /* Add pink left border like experience items */
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  max-width: 100%;
  margin-bottom: 0;  /* Remove bottom margin since container handles spacing */
}

.project-card::before {
  display: none;  /* Remove since we now have a pink left border */
}

.project-card:hover {
  transform: translateX(4px);  /* Match experience-item hover effect */
  box-shadow: var(--shadow-medium);
  border-color: var(--border-color);  /* Keep consistent border color */
}

.project-card:hover::before {
  display: none;  /* Remove hover effect for ::before */
}

/* Disable project card hover effects on touch devices */
@media (hover: none) {
  .project-card:hover {
    transform: none;
    box-shadow: var(--shadow-light);
  }
}

.icon-wrapper {
  flex: 0 0 90px;  /* Further reduced from 100px for more compact spacing */
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.75rem;  /* Reduced from 1rem for tighter spacing */
  background: linear-gradient(135deg, var(--primary-color)10, var(--secondary-color)10);
  border-radius: var(--border-radius);
  padding: 0.5rem;  /* Further reduced from 0.75rem */
  position: relative;
}

.project-icon {
  width: 80px;  /* Reduced from 90px to fit better in smaller wrapper */
  height: 80px;  /* Reduced from 90px to fit better in smaller wrapper */
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
  transition: var(--transition);
}

.project-card:hover .project-icon {
  transform: scale(1.1);
}

/* Disable hover effects on touch devices */
@media (hover: none) {
  .project-card:hover .project-icon {
    transform: none;
  }
}

.project-info h5 {
  margin-top: 0;
  margin-bottom: 0.3rem; /* Reduced from 0.75rem for tighter spacing */
  font-size: 1.3rem;  /* Reduced from 1.4rem to be smaller */
  font-weight: 600;
  color: var(--primary-color);
  line-height: 1.2;
}

.project-info h6 {
  margin-top: 0;
  margin-bottom: 0.3rem; /* Tight spacing between title and text */
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-color);
  line-height: 1.2;
}

.project-info p {
  margin: 0;
  font-size: 1.0rem;  /* Reduced from 1.15rem to be smaller */
  color: var(--text-primary);  /* Changed to match other text - dark grey */
  line-height: 1.5;
}

/* ==========================================================================
   Enhanced Button Styling
   ========================================================================== */
/* Elegant inline CV download link */
.cv-download-link {
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  background: linear-gradient(135deg, var(--secondary-color)15, var(--secondary-color)25);
  border: 2px solid var(--secondary-color);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
  box-shadow: var(--shadow-light);
}

.cv-download-link:hover {
  background: var(--secondary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  text-decoration: none;
}

.download-button {
  background: var(--primary-color);  /* Solid black */
  color: white;
  padding: 1rem 2rem;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  box-shadow: var(--shadow-light);
  position: relative;
  overflow: hidden;
}

.download-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.download-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  background: var(--secondary-color);  /* Hover to dark gray */
}

.download-button:hover::before {
  left: 100%;
}

.download-button:active {
  transform: translateY(0);
}

/* ==========================================================================
   Content Wrapper Improvements
   ========================================================================== */
.content-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
  text-align: left;  /* Moved to page title section to avoid duplication */
}

/* ==========================================================================
   Enhanced CV Styling
   ========================================================================== */
.cv-section {
  margin-bottom: 3rem;
}

.cv-section h2 {
  color: var(--primary-color);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;  /* Reduced from 2rem */
}

.experience-item {
  background: var(--card-background);
  border-radius: var(--border-radius);
  padding: 0;  /* Remove padding since we'll handle it in flip cards */
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-light);
  border-left: 4px solid var(--secondary-color);  /* Pink accent */
  transition: var(--transition);
  perspective: 1000px;  /* Enable 3D perspective for flip */
  min-height: 120px;  /* Ensure consistent height */
}

.experience-item:hover {
  box-shadow: var(--shadow-medium);
  transform: translateX(4px);
}

/* Disable experience item hover effects on touch devices */
@media (hover: none) {
  .experience-item:hover {
    box-shadow: var(--shadow-light);
    transform: none;
  }
}

/* Flip card container */
.flip-card {
  position: relative;
  width: 100%;
  height: 120px;
  cursor: pointer;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: left;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.flip-card-front {
  background: var(--card-background);
  color: var(--text-primary);
}

.flip-card-back {
  background: var(--secondary-color);
  color: white !important;  /* Force white text on flip card back */
  transform: rotateY(180deg);
}

/* Corner flip indicator - folded page effect */
.flip-card-front::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-left: 20px solid var(--card-background);
  border-bottom: 20px solid var(--card-background);
  border-top: 20px solid var(--secondary-color);
  border-right: 20px solid var(--secondary-color);
  border-top-right-radius: var(--border-radius);
  transition: var(--transition);
  opacity: 0.7;
}

.flip-card:hover .flip-card-front::after {
  opacity: 1;
  border-top: 22px solid var(--secondary-color);
  border-right: 22px solid var(--secondary-color);
  border-left: 22px solid var(--card-background);
  border-bottom: 22px solid var(--card-background);
}

.experience-title {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-size: 1.1rem !important;  /* Match project card titles and force override */
}

.flip-card-front .experience-title {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-size: 1.1rem !important;  /* Ensure consistency */
}

.flip-card-back .experience-title {
  color: white !important;  /* Force white title on back */
  margin-bottom: 1rem;
  font-size: 1.1rem !important;  /* Ensure consistency */
}

.location-time {
  color: var(--secondary-color);  /* Pink accent */
  font-weight: 500;
  font-size: 0.95rem !important;  /* Consistent with sidebar text */
}

.flip-card-front .location-time {
  color: var(--secondary-color) !important;  /* Force pink on front */
  font-size: 0.95rem !important;
}

.flip-card-back .location-time {
  color: var(--secondary-color) !important;  /* Force pink on back too */
  margin-bottom: 0.5rem;
  font-size: 0.95rem !important;
}

.experience-description {
  color: var(--text-secondary);
  margin-top: 0.75rem;
  line-height: 1.6;
}

.flip-card-back .experience-description {
  color: white !important;  /* Force white text on back */
  margin-top: 0;
  line-height: 1.5;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.skill-category {
  background: var(--card-background);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  border-top: 3px solid var(--primary-color);
}

.skill-category h4 {
  color: var(--primary-color);
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.skill-category ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.skill-category li {
  padding: 0.25rem 0;
  color: var(--text-secondary);
  position: relative;
  padding-left: 1rem;
}

.skill-category li::before {
  content: '▪';
  color: var(--secondary-color);
  position: absolute;
  left: 0;
}

/* ==========================================================================
   Animation Enhancements
   ========================================================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.project-card, .experience-item {
  animation: fadeInUp 0.6s ease-out;
}

.project-card:nth-child(2) { animation-delay: 0.1s; }
.project-card:nth-child(3) { animation-delay: 0.2s; }
.project-card:nth-child(4) { animation-delay: 0.3s; }

/* ==========================================================================
   Enhanced Navigation Styling
   ========================================================================== */
.masthead {
  background: var(--card-background);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-light);
}

.masthead__inner-wrap {
  padding: 1rem;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  position: relative;
}

.masthead__menu {
  width: 100%;
}

.greedy-nav {
  display: flex;
  align-items: center;
  width: 100%;
  position: relative;
}

.greedy-nav .visible-links {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  position: relative;
}

/* Position "Yuan Gao / About" centered over sidebar area */
.masthead__menu-item--lg {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  text-align: center;
  padding-left: 1rem;  /* Add some left padding to prevent edge cutoff */
}

.masthead__menu-item--lg a {
  font-weight: 600;
  font-size: 1.1rem !important; /* Increased site title/logo font size */
  color: var(--primary-color);
  text-decoration: none;
  display: block;
}

/* Keep navigation items aligned properly */
.greedy-nav .visible-links {
  justify-content: flex-start;
  width: 100%;
}

.masthead__menu-item:not(.masthead__menu-item--lg) {
  margin-left: 1.5rem;
}

.masthead__menu-item:not(.masthead__menu-item--lg):first-of-type {
  margin-left: 0;
}

/* General masthead menu item font size */
.masthead__menu-item a {
  font-size: 1rem !important; /* Increased navigation menu font size */
}

/* Responsive positioning for different screen sizes */
@media screen and (min-width: 925px) {
  .masthead__menu-item--lg {
    width: min(18vw, 240px);  /* Match reduced sidebar width */
    left: 0.5rem;    /* Small left margin to prevent cutoff */
  }
  
  /* Create flex container for proper alignment */
  .greedy-nav .visible-links {
    display: flex;
    align-items: flex-start;
    width: 100%;
    padding-right: calc(400px); /* Moved starting point further left (reduced from 450px) */
  }
  
  /* Create a smaller spacer to move navigation buttons more to the left */
  .greedy-nav .visible-links::before {
    content: '';
    width: min(5vw, 200px); /* Reduced from 20vw, 260px to start buttons further left */
    flex-shrink: 0;
  }
  
  /* Group navigation buttons and right-align them within content bounds */
  .greedy-nav .visible-links .masthead__menu-item:not(.masthead__menu-item--lg) {
    display: flex;
  }
  
  /* Push buttons to the right but constrain within content area */
  .greedy-nav .visible-links .masthead__menu-item:not(.masthead__menu-item--lg):first-of-type {
    margin-left: auto;
  }
}

@media screen and (min-width: 1280px) {
  .masthead__menu-item--lg {
    width: min(18vw, 240px);  /* Match reduced sidebar width */
    left: 0.5rem;    /* Small left margin to prevent cutoff */
  }
  
  .greedy-nav .visible-links {
    padding-left: min(20vw, 260px);  /* Match sidebar + buffer */
  }
}

/* Medium screens and smaller: normal horizontal flow */
@media screen and (max-width: 924px) {
  .masthead__menu-item--lg {
    position: static;
    width: auto;
    transform: none;
    text-align: left;
  }
  
  .greedy-nav .visible-links {
    padding-left: 0;
    justify-content: space-between;
  }
  
  .masthead__menu-item:not(.masthead__menu-item--lg) {
    margin-left: 0;
  }
}

/* Mobile: stack vertically */
@media screen and (max-width: 768px) {
  .greedy-nav .visible-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .masthead__menu-item {
    margin: 0;
  }
}

.greedy-nav a {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 1rem !important; /* Increased from default navigation font size */
  transition: var(--transition);
  position: relative;
  text-decoration: none;
}

.greedy-nav a:hover {
  color: var(--primary-color);
}

.greedy-nav a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 50%;
  background: var(--primary-color);
  transition: var(--transition);
  transform: translateX(-50%);
}

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

/* ==========================================================================
   Sidebar Enhancements
   ========================================================================== */
.sidebar {
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  margin-bottom: 2rem;
  padding: 1.5rem;
  margin-top: 1rem;
}

.author__avatar {
  text-align: center;
  margin-bottom: 1rem;
  margin-top: 0.5rem;  /* Small top margin for better spacing */
}

.author__avatar img {
  border: 2px solid var(--border-color);
  box-shadow: var(--shadow-light);
  transition: var(--transition);
  max-width: 100%;  /* Ensure image fits within container */
  height: auto;
}

.author__avatar img:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-medium);
}

/* Disable hover effects on touch devices */
@media (hover: none) {
  .author__avatar img:hover {
    transform: none;
    box-shadow: var(--shadow-light);
  }
}

.author__name {
  color: var(--primary-color);
  font-weight: 600;
  text-align: center;
  margin-bottom: 0.5rem;
  font-size: 1.1rem !important; /* Increased from default with !important */
}

.author__bio {
  color: var(--text-secondary);
  font-size: 1rem !important; /* Increased from 0.9rem with !important */
  line-height: 1.5;
  text-align: center;
  margin-bottom: 1rem;
}

.author__urls {
  margin-top: 1rem;
  text-align: left;  /* Align URLs to the left for better readability */
  font-size: 0.95rem !important; /* Slightly increased from default with !important */
}

.author__urls .author__url {
  display: block;
  margin-bottom: 0.5rem;
  text-align: left;
  font-size: 0.95rem !important; /* Ensure link text is also larger */
}

.author__urls .fas, .author__urls .fab, .author__urls .ai {
  color: var(--secondary-color) !important;  /* Use pink for all icons */
  transition: var(--transition);
  width: 16px;  /* Fixed width for icon alignment */
  text-align: center;
  margin-right: 8px;
}

.author__urls a:hover .fas,
.author__urls a:hover .fab,
.author__urls a:hover .ai {
  color: var(--primary-color) !important;  /* Hover to dark grey for icons */
}

/* Ensure all sidebar text elements have increased font size */
.sidebar p, .sidebar span, .sidebar a {
  font-size: 0.95rem !important;
}

.sidebar .author__name a {
  font-size: 1.1rem !important;
}

/* Specific styling for employer field */
.author__desktop {
  font-size: 0.95rem !important;
}

/* ==========================================================================
   Page Content Enhancements
   ========================================================================== */
/* Clean content styling - back to theme default positioning */
.page__content,
.archive {
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  padding: 2rem;
  margin-bottom: 2rem;
}

/* Clean page title styling */
.page__title {
  color: var(--text-primary) !important;
  margin: 0 0 1rem 0;
  font-weight: 600;
  font-size: 1.6rem !important;
  text-align: left;
  padding: 0 0 0.5rem 0;
  border-bottom: 2px solid var(--border-color);
  position: relative;
}

/* ==========================================================================
   Publication List Styling
   ========================================================================== */
.archive__item {
  background: var(--card-background);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-light);
  border-left: 4px solid var(--secondary-color);
  transition: var(--transition);
}

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

.archive__item-title {
  color: var(--primary-color);
  font-weight: 600;
}

.archive__item-excerpt {
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* ==========================================================================
   Contact Page Styling
   ========================================================================== */
.contact-section {
  margin-bottom: 3rem;
}

.contact-section h2 {
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.map-container {
  position: relative;
  padding-bottom: 25%;
  height: 0;
  overflow: hidden;
  margin-bottom: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
}

.map-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: var(--border-radius);
}

#contact-form {
  max-width: 100%;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 500;
}

#contact-form input,
#contact-form textarea {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 1rem;
  background: var(--card-background);
  transition: var(--transition);
  box-sizing: border-box;
}

#contact-form input:focus,
#contact-form textarea:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

#contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-button {
  background: var(--primary-color);  /* Black background */
  color: white;
  padding: 1rem 2rem;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-light);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.contact-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  background: var(--secondary-color);  /* Hover to dark gray */
}

.contact-button:active {
  transform: translateY(0);
}

/* ==========================================================================
   Form Styling
   ========================================================================== */
input, textarea, select {
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 0.75rem;
  font-size: 1rem;
  transition: var(--transition);
  background: var(--card-background);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

/* ==========================================================================
   Footer Enhancements
   ========================================================================== */
.page__footer {
  background: var(--secondary-color);  /* Use pink instead of tertiary grey */
  color: white !important;
  margin-top: 3rem;
}

/* Ensure all footer text elements are white */
.page__footer, .page__footer *, .page__footer a, .page__footer p, 
.page__footer li, .page__footer span, .page__footer div {
  color: white !important;
}

.page__footer a:hover {
  color: rgba(255, 255, 255, 0.8) !important;
}

.page__footer-follow {
  margin-bottom: 0;
}

/* ==========================================================================
   Scroll Animations
   ========================================================================== */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.experience-item:nth-child(odd) {
  animation: slideInLeft 0.6s ease-out;
}

.experience-item:nth-child(even) {
  animation: slideInRight 0.6s ease-out;
}

/* ==========================================================================
   Loading Animation
   ========================================================================== */
@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
  }
}

.loading {
  animation: pulse 1.5s infinite;
}

/* ==========================================================================
   Responsive Design Improvements
   ========================================================================== */
@media (max-width: 1024px) {
  .page__content {
    padding: 1.5rem;
  }
  
  .project-container {
    gap: 1rem; /* Reduced from 1.5rem for tighter spacing on tablets */
  }
}

@media (max-width: 768px) {
  .project-card {
    flex-direction: column;
    text-align: center;
    padding: 1rem; /* Reduced from 1.5rem for more compact mobile spacing */
  }
  
  .icon-wrapper {
    margin-right: 0;
    margin-bottom: 1rem; /* Reduced from 1.5rem for tighter mobile spacing */
    flex: none;
  }
  
  /* Tablet responsive flip card styling */
  .experience-title,
  .flip-card-front .experience-title,
  .flip-card-back .experience-title {
    font-size: 1.05rem !important;  /* Slightly smaller for tablets */
  }
  
  .location-time,
  .flip-card-front .location-time,
  .flip-card-back .location-time {
    font-size: 0.9rem !important;  /* Slightly smaller for tablets */
  }
  
  .experience-description,
  .flip-card-back .experience-description {
    font-size: 0.95rem !important;  /* Slightly smaller for tablets */
  }
  
  .custom-line {
    margin: 0 auto 2rem auto;
  }
  
  .content-wrapper {
    width: 95%;
  }
  
  .skills-grid {
    grid-template-columns: 1fr;
  }
  
  .page__content {
    padding: 1rem;
    margin: 0 0.5rem 1rem 0.5rem;
  }
  
  .masthead__inner-wrap {
    padding: 0.5rem 0;
  }
  
  .greedy-nav a {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }  /* Even smaller on mobile */
  h2 { font-size: 1.3rem; }
  
  .page__title {
    font-size: 1.4rem !important;
  }
  
  .project-card, .experience-item {
    padding: 1.25rem;
  }
  
  /* Mobile responsive flip card styling */
  .experience-title {
    font-size: 1rem !important;  /* Reduced for mobile */
  }
  
  .flip-card-front .experience-title,
  .flip-card-back .experience-title {
    font-size: 1rem !important;  /* Consistent mobile sizing */
  }
  
  .location-time,
  .flip-card-front .location-time,
  .flip-card-back .location-time {
    font-size: 0.85rem !important;  /* Smaller on mobile */
  }
  
  .experience-description,
  .flip-card-back .experience-description {
    font-size: 0.9rem !important;  /* Smaller mobile text */
    line-height: 1.4;
  }
  
  /* Adjust flip card dimensions for mobile */
  .flip-card {
    height: auto;
    min-height: 100px;
  }
  
  .flip-card-front, .flip-card-back {
    padding: 1rem;
    height: auto;
    min-height: 100px;
  }
  
  .download-button {
    width: 100%;
    justify-content: center;
    padding: 1rem;
  }
  
  .author__avatar {
    margin-bottom: 1rem;
  }
  
  .project-icon {
    width: 60px;
    height: 60px;
  }
  
  .icon-wrapper {
    flex: 0 0 80px;
    padding: 0.75rem;
  }
}

/* ==========================================================================
   Clean White Theme Override for Dark Mode
   ========================================================================== */
@media (prefers-color-scheme: dark) {
  /* Override dark mode to maintain white theme */
  :root {
    --background-color: #ffffff;
    --card-background: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #e8e8e8;
  }
  
  body {
    background-color: var(--background-color) !important;
    color: var(--text-primary) !important;
  }
  
  .project-card, .experience-item, .page__content, .sidebar, .masthead {
    background: var(--card-background) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
  }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
  .masthead, .sidebar, .page__footer {
    display: none;
  }
  
  .page__content {
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  .project-card, .experience-item {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }
  
  a {
    text-decoration: underline;
  }
}