/* 
 * Jacob Voytovich - Portfolio Stylesheet
 * This file contains all styles for the portfolio website
 * Organized by section with mobile-first approach
 */

/* ==================== 
   Base styles
   ==================== */
:root {
  --primary-color: #333;
  --secondary-color: #f8f8f8;
  --accent-color: #555;
  --text-color: #333;
  --text-light: #666;
  --text-white: #fff;
  --shadow: 0 2px 5px rgba(0,0,0,0.1);
  --shadow-hover: 0 4px 10px rgba(0,0,0,0.1);
  --transition: all 0.3s ease;
  --border-radius: 8px;
  --container-width: 1200px;
}

body, html {
  margin: 0;
  padding: 0;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: #fff;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
  box-sizing: border-box;
}

.section {
  padding: 40px 0 20px;
  scroll-margin-top: 70px; /* Offset for fixed header */
}

.visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 300;
  line-height: 1.2;
  margin-top: 0;
}

h1 {
  font-size: 2.5em;
  margin-bottom: 10px;
  color: var(--text-color);
  cursor: pointer;
}

h2 {
  font-size: 2em;
  margin-bottom: 20px;
  padding-top: 20px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 10px;
}

p {
  margin: 10px 0;
  font-weight: 300;
}

ul {
  padding-left: 20px;
}

.intro-text {
  font-size: 1.6rem;
  line-height: 1.4;
}

/* ==================== 
   Header styles
   ==================== */
header {
  background-color: var(--secondary-color);
  padding: 20px 0;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow);
}

.profile-img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 10px;
  cursor: pointer;
  border: 2px solid var(--accent-color);
  transition: transform 0.3s ease;
}

.profile-img:hover {
  transform: scale(1.05);
}

/* ==================== 
   Navigation styles
   ==================== */
nav {
  background-color: var(--primary-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  padding: 10px 0;
  transition: padding 0.3s;
  box-shadow: var(--shadow);
}

nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

nav ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 15px;
  justify-content: center;
  transition: transform 0.3s;
}

nav ul li a {
  color: var(--text-white);
  text-decoration: none;
  padding: 10px 15px;
  display: block;
  white-space: nowrap;
  transition: background-color 0.2s;
  border-radius: 4px;
}

nav ul li a:hover, 
nav ul li a:focus {
  background-color: var(--accent-color);
  outline: none;
}

/* Sticky profile styles */
.sticky-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-white);
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s, opacity 0.3s;
  position: relative;
}

.sticky-profile.show {
  visibility: visible;
  opacity: 1;
}

.sticky-profile img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  object-fit: cover;
  border: 1px solid var(--text-white);
  transition: transform 0.2s;
}

.sticky-profile img:hover {
  transform: scale(1.1);
}

.sticky-profile .name {
  font-size: 1.2em;
  font-weight: 300;
  cursor: pointer;
  white-space: nowrap;
}

/* Hamburger menu */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 5px;
}

.hamburger span {
  height: 2px;
  width: 25px;
  background-color: var(--text-white);
  margin: 2px 4px;
  transition: var(--transition);
}

.hamburger[aria-expanded="true"] span:first-child {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] span:last-child {
  transform: rotate(-45deg) translate(5px, -5px);
}

.linkedin-logo {
  display: block;
  margin-left: 60px;
  transform: translateX(-40px);
  transition: opacity 0.2s;
}

.linkedin-logo:hover {
  opacity: 0.8;
}

/* ==================== 
   Skills section 
   ==================== */
.skills-container {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 20px;
  padding: 20px 0;
}

.pm-message {
  background-color: #f0f0f0;
  border-radius: var(--border-radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: var(--shadow);
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.skill {
  background-color: var(--secondary-color);
  border-radius: var(--border-radius);
  padding: 15px;
  text-align: center;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 150px;
  width: 200px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.skill:hover,
.skill:focus {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  outline: none;
}

.skill img {
  width: 64px;
  height: 64px;
  margin-bottom: 10px;
  transition: transform 0.3s;
}

.skill:hover img {
  transform: scale(1.1);
}

.skill h3 {
  margin: 0;
  font-size: 1em;
  font-weight: 300;
  margin-bottom: 10px;
}

.skill p {
  margin: 0;
  font-size: 0.9em;
  color: var(--text-light);
  display: block;
  text-align: center;
}

/* ==================== 
   Projects section - Enhanced and updated
   ==================== */
.projects {
  display: flex;
  gap: 20px;
  position: relative;
  padding: 20px 0;
  scroll-snap-type: x mandatory;
  overflow-x: auto;
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;     /* Firefox */
  scroll-behavior: smooth;
  user-select: none;         /* Prevent text selection during swipe */
}

.projects::-webkit-scrollbar {
  display: none;             /* Chrome, Safari and Opera */
}

.project {
  background-color: var(--secondary-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  min-width: 300px;
  max-width: 400px;
  height: 300px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
  scroll-snap-align: center;
}

.project:hover,
.project:focus {
  transform: scale(1.05);
  box-shadow: var(--shadow-hover);
  outline: none;
}

.project-image-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: block; /* Ensure it's a block element */
}

.project img.project-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
  display: block; /* Force block display */
  position: absolute; /* Position absolutely within container */
  top: 0;
  left: 0;
}

.project:hover img.project-image {
  transform: scale(1.1);
}

/* Enhanced project overlay with better contrast */
.project-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(
    rgba(0, 0, 0, 0),
    rgba(0, 0, 0, 0.75) 40%,
    rgba(0, 0, 0, 0.9)
  );
  padding: 20px;
  color: white;
  text-align: center;
  padding-top: 60px; /* More gradient space above text */
}

.project-overlay h3 {
  margin: 0;
  font-size: 1.3em;
  font-weight: 500;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
}

.project-overlay p {
  margin: 0;
  font-size: 0.95em;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.5s, opacity 0.4s;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
  line-height: 1.5;
  font-weight: 400;
}

.project:hover .project-overlay p,
.project:focus .project-overlay p {
  max-height: 100px;
  opacity: 1;
}

/* Company logo with black border */
.company-logo {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  background-color: white;
  border-radius: 50%;
  padding: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  object-fit: contain;
  z-index: 5;
  border: 2px solid #000; /* Adding black border */
}

/* Carousel Controls */
.carousel-controls {
  display: flex;
  justify-content: center;
  margin-top: 15px;
  gap: 15px;
}

.carousel-control {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.carousel-control:hover {
  background-color: var(--accent-color);
  transform: scale(1.1);
}

.carousel-control:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* ==================== 
   Resume section 
   ==================== */
.resume-button {
  display: inline-block;
  background-color: var(--primary-color);
  color: var(--text-white);
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1em;
  text-decoration: none;
  transition: background-color 0.3s, transform 0.3s;
  margin-bottom: 30px;
}

.resume-button:hover,
.resume-button:focus {
  background-color: var(--accent-color);
  transform: translateY(-2px);
}

.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.timeline::after {
  content: '';
  position: absolute;
  width: 2px;
  background-color: #ddd;
  top: 0;
  bottom: 0;
  left: 20px;
  margin-left: -1px;
}

.experience-item {
  margin-bottom: 30px;
  position: relative;
  padding-left: 40px;
}

.experience-item::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background-color: var(--accent-color);
  border: 2px solid #fff;
  border-radius: 50%;
  top: 15px;
  left: 9px;
  z-index: 1;
}

.experience-item h3 {
  margin-bottom: 5px;
  font-weight: 300;
  color: var(--text-color);
}

.experience-item p {
  margin: 5px 0;
  font-weight: 300;
  color: var(--text-light);
  font-style: italic;
}

/* ==================== 
   Interests section 
   ==================== */
.interests {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.interest {
  background-color: #f0f0f0;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.9em;
  transition: var(--transition);
}

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

/* ==================== 
   Footer 
   ==================== */
footer {
  background-color: var(--primary-color);
  color: var(--text-white);
  text-align: center;
  padding: 20px 0;
  margin-top: 40px;
}

footer a {
  color: var(--text-white);
  text-decoration: none;
  border-bottom: 1px dotted;
  transition: opacity 0.2s;
}

footer a:hover {
  opacity: 0.8;
}

/* ==================== 
   Modal styles - Updated
   ==================== */
.modal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.9);
  transition: opacity 0.3s;
}

.modal-content {
  margin: 5vh auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 90%;
  max-width: 1200px;
  height: 90vh;
  animation: zoom 0.3s;
}

@keyframes zoom {
  from {transform: scale(0.9);}
  to {transform: scale(1);}
}

.modal-content img {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--border-radius);
}

.close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
  z-index: 1002;
}

.close:hover,
.close:focus {
  color: #bbb;
  text-decoration: none;
  transform: rotate(90deg);
}

.modal-caption {
  margin-top: 20px;
  color: white;
  text-align: center;
  max-width: 800px;
}

.modal-caption h3 {
  margin: 0;
  margin-bottom: 10px;
  font-size: 1.5em;
}

.modal-caption p {
  margin: 0;
  font-size: 1em;
}

.modal-company {
  margin-top: 10px;
  font-style: italic;
  font-size: 0.9em;
  color: #ddd;
}

/* ==================== 
   Media queries 
   ==================== */
@media (max-width: 1024px) {
  .skills-container {
    grid-template-columns: 1fr;
  }
  
  .container {
    padding: 0 15px;
  }
}

@media (max-width: 845px) {
  .container {
    padding: 0 10px;
  }

  h1 {
    font-size: 2em;
  }

  h2 {
    font-size: 1.5em;
    padding-top: 20px;
  }
  
  .intro-text {
    font-size: 1.4rem;
  }

  .hamburger {
    display: flex;
    margin-right: 35px; /* Space to ensure no overlap with LinkedIn */
  }

  nav ul {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--primary-color);
    padding: 20px;
    gap: 10px;
    z-index: 1000;
    box-shadow: 0 5px 10px rgba(0,0,0,0.2);
  }

  nav ul.active {
    display: flex;
    animation: slideDown 0.3s ease forwards;
  }
  
  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .linkedin-logo {
    position: absolute;
    right: 20px; /* Properly positioned and not overlapping */
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
  }
  
  .timeline::after {
    left: 15px;
  }
  
  .experience-item {
    padding-left: 35px;
  }
  
  .experience-item::before {
    left: 4px;
  }
  
  .projects {
    gap: 15px;
  }
  
  .project {
    min-width: 280px;
    max-width: 350px;
  }
  
  .carousel-control {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
}

@media (max-width: 600px) {
  .sticky-profile .name {
    display: inline;
  }
  
  .project {
    min-width: 250px;
    height: 250px;
  }
  
  .modal-content {
    margin: 25% auto;
    width: 95%;
    height: auto;
  }
  
  .close {
    top: 10px;
    right: 20px;
    font-size: 35px;
  }
  
  .company-logo {
    width: 30px;
    height: 30px;
  }
  
  .carousel-control {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .projects {
    padding-left: 10px;
  }
  
  .skill {
    width: 100%;
    max-width: 300px;
  }
  
  .intro-text {
    font-size: 1.2rem;
  }
  
  h1 {
    font-size: 1.8em;
  }
  
  h2 {
    font-size: 1.3em;
  }
  
  .section {
    padding: 30px 0 15px;
  }
  
  .project-overlay h3 {
    font-size: 1.1em;
  }
  
  .project-overlay p {
    font-size: 0.8em;
  }
}

/* Print styles */
@media print {
  nav, footer, .projects, .skills, .interests, button {
    display: none;
  }
  
  body {
    color: black;
    font-size: 12pt;
    line-height: 1.4;
  }
  
  h1, h2, h3 {
    page-break-after: avoid;
  }
  
  .experience-item {
    page-break-inside: avoid;
  }
  
  a {
    text-decoration: none;
    color: black;
  }
  
  .container {
    width: 100%;
    max-width: 100%;
    padding: 0;
  }
  
  .timeline::after, .experience-item::before {
    display: none;
  }
  
  .experience-item {
    padding-left: 0;
  }
}
