/* Color Variables */
:root {
  --primary-color: #022840; /* Deep navy for headings */
  --accent-color: #037f8c; /* Vibrant teal for accents */
  --secondary-color: #e94560; /* Red for potential errors/alerts (optional) */
  --text-primary: #022840; /* Deep navy for primary text */
  --text-secondary: #025373; /* Medium blue-teal for secondary text */
  --background-light: #f2f2f2; /* Very light gray */
  --background-white: #ffffff; /* White */
  --border-color: #f2f2f2; /* Light gray border */
  --hover-color: #025e73; /* Darker blue-teal for hover */
  --tag-bg: #f2f2f2; /* Very light gray tag background */
  --tag-hover: #037f8c; /* Vibrant teal for tag hover */
  --shadow-color: rgba(2, 40, 64, 0.2); /* Shadow based on primary color */
  --divider-color: #f2f2f2; /* Very light gray for section dividers */
  --gradient-start: #f2f2f2; /* Very light gray */
  --gradient-end: rgba(3, 127, 140, 0.05); /* Subtle teal hint */
}

/* General Styles */
* {
  box-sizing: border-box;
}

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

@keyframes slideIn {
  from {
    transform: translateX(-20px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

body {
  font-family: 'Lato', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: linear-gradient(
    135deg,
    var(--gradient-start) 0%,
    var(--gradient-end) 100%
  );
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  padding: 20px; /* Add some padding around the container */
  overflow-wrap: break-word; /* Prevent long words/URLs from overflowing */
  animation: fadeIn 0.8s ease-out;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1200px;
  background-color: var(--background-white);
  padding: 20px;
  border-radius: 8px;
  position: relative;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 20px var(--shadow-color);
  animation: scaleIn 0.8s ease-out;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.container:hover {
  box-shadow: 0 6px 30px var(--shadow-color);
}

h1,
h2,
h3 {
  margin-top: 0;
  color: var(--primary-color);
}

h2 {
  border-bottom: 1px solid var(--divider-color);
  padding-bottom: 8px;
  margin-bottom: 20px;
  margin-top: 30px;
  font-weight: 700;
  opacity: 0.9;
  position: relative;
  transition: all 0.3s ease;
}

h2:hover {
  opacity: 1;
  transform: translateX(5px);
}

h2::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--accent-color);
  transition: width 0.3s ease;
}

h2:hover::after {
  width: 100%;
}

p {
  margin-bottom: 1em;
  color: var(--text-secondary);
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.3s ease, transform 0.2s ease;
}

a:hover {
  color: var(--hover-color);
  transform: translateY(-1px);
}

/* Override default link color within the container */
.container a {
  color: var(--text-primary);
  text-decoration: underline; /* Ensure underline is always present */
  transition: color 0.3s ease, transform 0.2s ease;
}

.container a:hover {
  color: var(
    --accent-color
  ); /* Optional: Change color on hover, e.g., to teal */
  transform: translateY(-1px); /* Keep underline on hover */
}

/* Header */
header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 30px;
  position: relative;
  padding-bottom: 20px;
  animation: slideIn 0.8s ease-out;
}

.header-content {
  width: 100%;
  margin-bottom: 20px;
}

header h1 {
  margin-bottom: 0; /* Reduced from 5px */
  font-size: 2.5em; /* Large name */
  font-weight: 700;
}

.subtitle {
  font-size: 1.1em;
  color: var(--text-secondary);
  margin-bottom: 10px;
  margin-top: 0;
}

.location {
  font-size: 0.85em; /* Make font slightly smaller */
  color: var(--text-secondary);
  margin-top: -5px; /* Reduce space above */
}

/* Remove old initial circle style */
/*
.initial-circle {
    width: 80px;
    height: 80px;
    background-color: #008080; 
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5em;
    font-weight: bold;
    position: absolute; 
    top: 40px; 
    right: 40px; 
}
*/

.profile-picture {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 20px;
  border: 3px solid var(--accent-color);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.profile-picture:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 20px var(--shadow-color);
  animation: float 3s ease-in-out infinite;
}

.profile-picture::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shine 3s infinite linear;
  pointer-events: none;
}

/* About Section */
.about h2 {
  margin-top: 0; /* No top margin for the first section heading */
  margin-bottom: 1px; /* Reduced space below the heading */
}

/* Work Experience & Education */
.job,
.edu-item {
  margin-bottom: 25px;
}

.job-header,
.edu-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline; /* Align baseline of title and date */
  margin-bottom: 5px;
}

.job h3,
.edu-item h3 {
  margin-bottom: 0;
  font-size: 1.2em;
  font-weight: 700;
  display: inline; /* Keep title and tag on same line */
}

.location-tag {
  display: inline-block;
  background-color: var(--tag-bg);
  color: var(--text-secondary);
  font-size: 0.8em;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 10px;
  vertical-align: middle; /* Align with text */
  transition: all 0.3s ease;
}

.location-tag:hover {
  background-color: var(--accent-color);
  color: white;
}

.date {
  font-size: 0.9em;
  color: #777;
  font-style: italic;
  white-space: nowrap; /* Prevent date wrapping */
  margin-left: 15px; /* Space between title/tag and date */
}

.company {
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 5px;
}

.company-description {
  font-size: 0.9em;
  color: var(--text-secondary);
  margin-top: -5px; /* Reduce space after company name */
  margin-bottom: 10px; /* Add space before bullet points */
}

.job p:last-child,
.edu-item p:last-child {
  margin-bottom: 0; /* Remove margin from last paragraph in entry */
}

/* Style for bullet points in work experience */
.job ul {
  list-style: none; /* Remove default bullets */
  padding-left: 20px; /* Add indentation */
  margin-top: 10px; /* Add some space above the list */
}

.job li {
  margin-bottom: 8px; /* Space between bullet points */
  padding-left: 5px; /* Small space between imaginary bullet and text */
  position: relative; /* Needed for potential custom bullets later if desired */
}

/* Optional: Add a custom bullet character if you prefer */
/*
.job li::before {
    content: "\2022";
    color: #008080;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
    position: absolute;
    left: 0;
}
*/
.job li::before {
  content: '\2022'; /* Unicode bullet character */
  color: #414040; /* Teal color */
  font-weight: bold;
  display: inline-block;
  width: 1em;
  margin-left: -1.2em; /* Adjust positioning relative to padding */
}

/* Skills */
.skills h2 {
  margin-bottom: 15px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  padding: 10px;
  gap: 8px;
  justify-content: flex-start;
  width: 100%;
}

.tag {
  background-color: var(--tag-bg);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 0.9em;
  white-space: normal;
  word-wrap: break-word;
  max-width: 100%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.tag:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 12px var(--shadow-color);
  background-color: var(--tag-hover);
  color: white;
}

.tag::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tag:hover::before {
  opacity: 1;
  animation: shine 2s infinite linear;
}

/* Languages Section */
.language-list {
  display: flex;
  gap: 20px; /* Add space between the language items */
  flex-wrap: wrap; /* Allow wrapping on smaller screens if needed */
}

.language-item {
  /* Remove margin-bottom, handled by gap in .language-list */
  display: flex; /* Re-added: Arrange h3 and p in a row */
  align-items: baseline; /* Re-added: Align text baselines */
}

.language-item h3 {
  margin-bottom: 0; /* Remove bottom margin */
  font-size: 1.1em;
  font-weight: 700;
  margin-right: 8px; /* Add space between name and proficiency */
}

.language-item p {
  margin-bottom: 0;
  color: #555;
  font-size: 0.95em;
}

/* Responsive Breakpoints */
@media (min-width: 768px) {
  .container {
    padding: 40px;
  }

  header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    text-align: left;
  }

  .header-content {
    max-width: calc(100% - 140px);
    margin-bottom: 0;
  }

  .profile-picture {
    width: 100px;
    height: 100px;
    margin: 0;
    position: absolute;
    top: 0;
    right: 0;
  }
}

@media (max-width: 767px) {
  body {
    padding: 10px;
  }

  .container {
    padding: 15px;
  }

  header h1 {
    font-size: 2em;
  }

  .subtitle {
    font-size: 1em;
  }

  .job-header,
  .edu-header {
    flex-direction: column;
    gap: 5px;
  }

  .date {
    margin-left: 0;
  }

  .location-tag {
    display: block;
    margin: 5px 0;
  }

  .skill-tags {
    padding: 5px;
    gap: 5px;
  }

  .tag {
    font-size: 0.85em;
    padding: 4px 8px;
    max-width: calc(
      50% - 5px
    ); /* Ensure tags take up at most half the container width minus gap */
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.8em;
  }

  .subtitle {
    font-size: 0.9em;
  }

  .profile-picture {
    width: 100px;
    height: 100px;
  }

  h2 {
    font-size: 1.4em;
  }

  .job h3,
  .edu-item h3 {
    font-size: 1.1em;
  }

  .company {
    font-size: 0.9em;
  }

  .company-description {
    font-size: 0.85em;
  }

  .job ul {
    padding-left: 15px;
  }

  .job li {
    font-size: 0.9em;
  }

  .tag {
    max-width: 100%; /* On very small screens, allow tags to take full width */
    font-size: 0.8em;
    padding: 3px 6px;
  }
}

/* Certifications & Online Presence & Contact */
.certifications ul,
.online-presence ul,
.contact ul {
  list-style: none; /* Remove default bullets */
  padding-left: 0; /* Remove default padding */
}

.certifications li,
.online-presence li,
.contact li {
  margin-bottom: 10px; /* Space between list items */
  display: flex; /* Align icon and text nicely */
  align-items: center; /* Center items vertically */
}

.certifications i,
.online-presence i,
.contact i {
  margin-right: 10px; /* Space between icon and text */
  color: var(--accent-color);
  width: 20px; /* Fixed width for alignment */
  text-align: center; /* Center icon within its space */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.certifications i:hover,
.online-presence i:hover,
.contact i:hover {
  transform: scale(1.2) rotate(5deg);
  color: var(--hover-color);
}

.certifications .cert-icon,
.online-presence .cert-icon /* Apply similar styling to custom image icons */ {
  margin-right: 10px;
  width: 18px; /* Slightly adjust size if needed */
  height: 18px; /* Maintain aspect ratio */
  vertical-align: middle; /* Align vertically with text */
}

/* Download CV Button */
.download-cv-button {
  position: absolute;
  top: 0px;
  right: 0px;
  padding: 8px 8px;
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1em;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
  animation: fadeIn 0.8s ease-out;
  overflow: hidden;
}

.download-cv-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-color);
  background-color: var(--hover-color);
  animation: pulse 1s infinite;
}

.download-cv-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.download-cv-button:hover::before {
  opacity: 1;
  animation: shine 2s infinite linear;
}

/* Print Styles */
@media print {
  body {
    padding: 0;
    background: white;
  }

  .container {
    max-width: 100%;
    padding: 20px;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .download-cv-button {
    display: none;
  }

  a {
    text-decoration: none;
    color: var(--primary-color);
  }

  .profile-picture {
    width: 80px;
    height: 80px;
  }

  .profile-picture::after,
  .tag::before,
  .download-cv-button::before {
    display: none;
  }

  .container:hover {
    box-shadow: none;
  }

  :root {
    --primary-color: #000000;
    --text-primary: #000000;
    --text-secondary: #333333;
    --accent-color: #000000; /* Black for print accents */
    --divider-color: #cccccc; /* Keep light gray */
    --border-color: #cccccc; /* Light gray border for print */
  }

  h2::after {
    background-color: var(--divider-color); /* Use gray for print underline */
  }

  .job:hover {
    background-color: transparent; /* No hover background in print */
    border-left-color: var(--divider-color); /* Use gray for print job border */
  }

  .certifications i,
  .online-presence i,
  .contact i {
    color: var(--text-primary); /* Black icons for print */
  }

  .download-cv-button {
    display: none;
  }
}

/* Section Animations */
section {
  animation: fadeIn 0.8s ease-out;
  animation-fill-mode: both;
}

section:nth-child(2) {
  animation-delay: 0.1s;
}
section:nth-child(3) {
  animation-delay: 0.2s;
}
section:nth-child(4) {
  animation-delay: 0.3s;
}
section:nth-child(5) {
  animation-delay: 0.4s;
}
section:nth-child(6) {
  animation-delay: 0.5s;
}

/* Interactive Elements */
.job {
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
  padding-left: 15px;
  position: relative;
}

.job:hover {
  transform: translateX(5px);
  border-left-color: var(--accent-color);
  background-color: rgba(
    142,
    68,
    173,
    0.05
  ); /* Using accent color with opacity */
}

/* Responsive Animations */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Animations */
@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes shine {
  0% {
    background-position: -100% 0;
  }
  100% {
    background-position: 200% 0;
  }
}
