:root {
  --bg: #0f0f12;
  --bg-light: #D8DCE8;
  --panel: #17171c;
  --accent: #263452;
  --accent-light: #515F7D;
  --dark: #151E2A;
  --text: #fff;
  --muted: #9a9aa3;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body { background: var(--bg); padding: 0px 0px; font-family: 'Almarai:Regular', sans-serif; color: var(--text);}

.header-s {
  position: relative;
  height: 350px;
  width: 100%;
  /* Move background here to ensure it's tied to the 300px height */
  background-image: url('assets/banner-sea.png');
  background-size: auto auto;
  background-position: right;
  background-repeat: no-repeat;
  
  /* This is key: it forces the container to 'clip' anything 
     leaking out, like margins from the name or role */
  overflow: hidden; 
}

/* Use .header-s::after instead of header::after */
.header-s::after {
  content: "";
  position: absolute;
  /* 'inset: 0' is a pro-shorthand for top, bottom, left, right: 0 */
  inset: 0; 
  background: linear-gradient(to right, rgba(0,0,0,0.85) 40%, rgba(0,0,0,0) 100%);
  pointer-events: none;
  z-index: 1;
}

.main-wrap {
  position: relative;
  z-index: 2; /* Keeps text above the filter */
  height: 100%; /* Force the grid to be exactly 300px */
  width: 100%;
  display: grid;
  grid-template-columns: 400px 1fr;
  align-items: center; /* Vertically centers everything */
  margin: 0;
  padding: 0;
}

/* Fix your contacts-wrap position */
.contacts-wrap {
  position: absolute;
  display: flex;
  flex-direction: row;
  gap: 80px;
  /* Use a positive number to keep it inside the 300px box */
  bottom: 20px; 
}

.hero-info{
  z-index:1;
  height:100%;
  position:relative;
  display:flex;
  flex-direction: column;
  align-items: start;
  justify-content: center;
  gap:0;
}


.contacts-wrap{
  position:absolute;
  display:flex;
 flex-direction: row;
 gap:80px;
}

.location, .telephone, .email{
  display:flex;
  flex-direction: row;
  gap:10px;
  height:30px;
  font-size: 20px;
  white-space: nowrap;
}

.location img, .telephone img, .email img{
  height:28px;
}

.contacts-t{
  font-family: 'Anta', sans-serif;
}
.profile-photo {
    z-index:1;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  overflow: hidden;
  margin-left:50px;
  transition: transform 0.4s ease;
}
.profile-photo:hover {
  transform: scale(1.05);
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.name {
  font-family: 'Anta', sans-serif;
  font-size: 64px;
  text-align: left;
}

.surname {
  font-family: 'Anta', sans-serif;
  font-size: 40px;
  text-align: left;
}

.role {
  text-align: center;
  color: var(--accent-light);
  margin-top:10px;
  font-weight:1000;
  font-size:24px;
}

.portfolio-t{
    width:100%;
    font-family: 'Anta', sans-serif;
    padding:50px;
    font-size:40px;
    text-align: center;
}

.port-container { max-width: 1200px; margin: 0 auto; }
.port-header { margin-bottom: 60px; text-align: left; }
.project-title { font-family: 'Anta', sans-serif; font-size: 48px; color: var(--text); }
.back-link { color: var(--accent-light); text-decoration: none; font-size: 18px; margin-bottom: 10px; display: block; }
.back-link:hover { text-decoration: underline; }





/* Portfolio specific Grid */
.gallery-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
gap: 30px;
}

.project-s{
  background: var(--accent);
  margin:0;
  padding-left: 30px;
  padding-right: 30px;
  padding-bottom: 20px;
  
}

.project-card {
  width: 500px; /* Adjust based on your needs */
  margin: 0 auto;
}

.featured-video-section {
    width: 100%;
    padding: 60px 20px;
    display: flex;
    justify-content: center; /* Centers the card horizontally */
}

.showreel-card {
    width: 100%;
    max-width: 800px; /* Adjust this number to make the video smaller or larger */
    cursor: pointer;
    transition: transform 0.4s ease;
}

.showreel-card:hover {
    transform: scale(1.02); /* Subtle lift on hover */
}

/* Ensure the image container maintains the 16:9 ratio even when smaller */
.showreel-card .image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9; 
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0px 40px rgba(255, 255, 255, 0.2);
}


/* 1. Image & Gradient Container */
.image-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10; /* Maintains the rectangle shape */
  overflow: visible;
}

.play-button{
  z-index: 1;
  position:absolute;
  height:50px;
  width:50px;
  bottom:10px;
  left:10px;
  opacity: 0.1;
  transition: all 0.8s ease;
}

.project-card:hover .play-button {
  transform: scale(1.15);
  opacity: 1;
}

.play-button img{
  height: 100%;
  width: 100%;
}

.main-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gradient-overlay {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 99%;
  background: linear-gradient(to right, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 40%);
  pointer-events: none;
}

.labels-wrapper {
  position: absolute;
  top: -5px;
  left: -5px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.badge {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 9px;
  overflow: visible;
  max-width: 150px;
  max-height:50px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: transform 0.4s ease;
}


.badge:hover{
  transform: scale(1.20);
  
}

.badge img {
  height: 52px;
  width:52px;
  max-width: 80px;
  border-radius: 8px;
  object-fit: cover;
}

.badge span {
  padding: 0 8px;
  font-size: 10px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.2;
}

.project-info {
  text-align: center;
  margin-top: 8px;
  color: var(--text-light);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); 
  gap: 40px 20px; 
  padding: 20px;
  width: 100%;
  margin: 0 auto;
}

.project-card {
  width: 100%; 
  transition: transform 0.4s ease;
}

.project-card:hover{
  transform: scale(1.05);
}



.project-s h3{
  font-size:25px;
  padding-top:50px;
}

.project-s h4{
  font-size:20px;
}

.description {
  font-size: 20px;
  font-weight: 300;
  opacity: 0.9;
}

.project-title {
  font-size: 25px;
  font-weight: 700;
  margin: 0;
}

.personal-dev-s{
  padding:20px;
  margin:20px;
}

.gallery-card { background: var(--panel); overflow: hidden; transition: transform 0.3s ease; }
.gallery-card:hover { transform: translateY(-10px); }
.gallery-card img { width: 100%; height: 250px; object-fit: cover; }
.gallery-content { padding: 20px; }
.gallery-content h3 { font-family: 'Anta', sans-serif; color: var(--text); margin-bottom: 10px; }
.gallery-content p { color: var(--muted); font-size: 16px; }

.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 9999;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 1100px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;

    opacity: 0;
    animation: modalAppear 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) 0.1s forwards;
}

/* KEYFRAMES */
@keyframes fadeInBg {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Animation for closing the background */
@keyframes fadeOutBg {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Animation for shrinking the modal box */
@keyframes modalDisappear {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
}

/* This class will be added via JavaScript when closing */
.modal.is-closing {
    animation: fadeOutBg 0.3s ease-in forwards;
}

.modal.is-closing .modal-content {
    animation: modalDisappear 0.3s ease-in forwards;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.close-header {
    width: 100%;
    height: 60px; /* Gives the button its own space */
    background: #000;
    display: flex;
    justify-content: flex-end; /* Pushes button to the right */
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid #1a1a1a;
}

.close-area {
    position: relative; /* Changed from absolute */
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: white;
    font-family: 'Anta', sans-serif;
    transition: all 0.3s ease;
    padding: 5px 10px;
}

/* The actual "X" button circle */
.x-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 2px solid white;
    border-radius: 50%;
    font-size: 22px;
    line-height: 0;
    padding-bottom: 2px;
}

.close-text {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.close-area:hover {
    color: var(--muted);
}

.close-area:hover .x-btn {
    border-color: var(--muted);
}

#modalTitle {
    padding: 15px;
    color: white;
    font-family: 'Anta', sans-serif;
    margin: 0;
    background: var(--panel);
}

/* Container to center the spinner */
.loader-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg); /* Uses your variable */
    z-index: 0;
}

/* The Spinner Animation */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top: 5px solid var(--accent-light); /* Matches your accent color */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Ensure the iframe stays above the loader once it appears */
#modalIframe {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    background: transparent;
}



.link-wrap{
  display:flex;
  flex-direction: row;
  gap: 200px;
}

.link{
  text-decoration: none; /* Removes the underline */
  color: inherit;        /* Removes the blue (adopts parent color) */
  display: inline-block; /* Ensures the anchor wraps your divs properly */
  transition: color 0.3s;
}

.link p{
  text-decoration: none;
  margin: 0;
}



.linked-line{
  display:flex;
  flex-direction: row;
  gap: 7px;
}

.side-links a:hover{
  color:var(--muted);
}

.side-links{
    font-family: 'Almarai:Regular',sans-serif;

    padding:70px;
}

.side-links h2{
  font-family: 'Anta', sans-serif;
  margin-bottom:20px;
}
.linked-line img{
  height:18px;
  width:18px;
}

.qr-linkedin {
  margin-top:10px;
  width: 70px;
  height: 70px;
  margin-bottom:30px;
}

.qr-linkedin img{
  height:100%;
  width:100%;
}

.project-card.is-active, 
.showreel-card.is-active {
    transform: scale(1.05);
}

.project-card.is-active .play-button,
.showreel-card.is-active .play-button {
    opacity: 1;
    transform: scale(1.15);
}

@media (max-width: 1504px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1260px) {
  
    .portfolio-t{
        font-size:20px;
    }
  .heading{
    transform: scale(0.8) translateX(-50px);
  }

  .summary-mobile h2{
    color:#fff;
  }

  .side-summary {
    display: none;
  } 

  .side-education{
  margin-top:20px;
  }

  .side-languages{
  margin-top:100px;
  }


/* 1. Header Responsiveness */
  .header-s {
    height: auto;
    min-height: 400px; /* Allow it to grow if text wraps */
    background-size: cover;
  }
  .header-s::after {
    background: linear-gradient(to right, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
  }

  .main-wrap {
    grid-template-columns: 1fr; /* Stack photo and info */
    padding: 40px 20px;
    text-align: center;
  }

  .profile-photo {
    margin: 0 auto 20px auto; /* Center the photo */
  }

  .hero-info {
    align-items: center; /* Center Name and Role */
  }

  .contacts-wrap {
    position: relative; /* Remove absolute positioning */
    flex-direction: column; /* Stack contact items */
    gap: 15px;
    bottom: 0;
    margin-top: 30px;
  }

  /* 2. Main Content Reordering */
  .cv {
    display: flex;
    flex-direction: column; /* Stack columns vertically */
  }

  .content {
    order: 1; /* Force Right side to be FIRST */
    background: var(--bg-light);
  }

  .sidebar {
    order: 2; /* Force Left side to be SECOND */
    width: 100%;
  }

  /* 3. Summary Transfer Logic */
  .summary-desktop {
    display: none; /* Hide from Sidebar */
  }

  .summary-mobile {
    display: block; /* Show at the top of Content */
    padding-bottom: 0; /* Tighten spacing */
    color:var(--dark);
  }

  /* 4. Fix Project Grid */
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

/* Specific Modal Fix for Mobile */
@media (max-width: 768px) {

    .modal-content {
        width: 100%;       /* Use full available width */
        max-width: 80vw;   /* Ensure it never exceeds the viewport width */
        border-radius: 8px; /* Slightly smaller radius for mobile */
    }

    .close-header {
        height: 50px;      /* Slimmer header for mobile */
        padding: 0 0px;
    }

    .close-text {
        font-size: 12px;   /* Smaller text to prevent pushing the X button */
    }

    #modalTitle {
        font-size: 18px;   /* Shrink title so it doesn't wrap awkwardly */
        padding: 10px;
    }

    .link-wrap{
        display:flex;
        flex-direction: column;
        gap: 50px;
    }
    .description {
      font-size: 15px;
      font-weight: 300;
      opacity: 0.9;
    }
    .location, .telephone, .email{
    font-size: 17px;
}
}

/* LANGUAGE SWITCH */
.lang-switch {
  position: absolute;
  top: 24px;
  right: 32px;
  z-index: 3;
  display: flex;
  gap: 6px;
  background: rgba(15, 15, 18, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 4px;
  backdrop-filter: blur(4px);
}

.lang-switch a {
  font-family: 'Anta', sans-serif;
  font-size: 13px;
  letter-spacing: 0.5px;
  padding: 6px 14px;
  border-radius: 16px;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.3s ease, color 0.3s ease;
}

.lang-switch a.is-active {
  background: var(--accent-light);
  color: var(--text);
  pointer-events: none;
}

.lang-switch a:not(.is-active):hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 1260px) {
  .lang-switch {
    top: 16px;
    right: 16px;
  }
}

