/* Basic Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Assistant', sans-serif;
  background: linear-gradient(120deg, #fccbcb, #d2e0ff);
  color: #333;
  scroll-behavior: smooth;
}

/*******************************
 * HEADER (RESPONSIVE, 1 LINE)
 *******************************/
header {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: #fafafa;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}
nav {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.5rem 1rem;
}
nav .logo {
  font-weight: 700;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: #444;
  white-space: nowrap;
  text-decoration: none;
}
nav ul {
  list-style: none;
  display: flex;
  white-space: nowrap;
  gap: clamp(0.5rem, 2vw, 1rem);
}
nav ul li a {
  font-size: clamp(0.8rem, 2vw, 1rem);
  text-decoration: none;
  color: #444;
  padding: 0.3rem 0.6rem;
  border-radius: 20px;
  transition: background-color 0.3s, color 0.3s;
}
nav ul li a:hover {
  background-color: #e8e8e8;
  color: #000;
}

/* Main Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 1rem 2rem; /* top padding offset for fixed nav */
}

/* Hero / Introduction Section */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  text-align: center;
  margin-top: 2rem;
}
.hero-img {
  display: flex;
  flex-direction: column;
  align-items: center;
}

@media (max-width: 700px) {
  .hero-img {
    overflow: hidden;
  }
  .hero-img img {
    width: 70%;  
  }
}

.hero-img img {
  
  max-width: 450px;
  height: auto;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
  position: relative;
  z-index: 10;
  margin-top: 20px;
}
.hero-img img:hover {
  transform: scale(1.05);
}

/* Pulse animation for profile image */
.pulse-once {
  animation: pulse 0.4s cubic-bezier(.4,1.8,.4,1);
}
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.13); box-shadow: 0 0 32px #ffb6b644; }
  100% { transform: scale(1); }
}

/* Confetti effect */
.confetti-container {
  pointer-events: none;
  overflow: visible;
  isolation: isolate;
}

.confetti-container .confetti-piece {
  all: unset;
  display: block;
  position: absolute;
  width: 38px;
  height: 38px;
  filter: grayscale(1) drop-shadow(0 2px 8px #0002);
  will-change: transform, opacity;
  z-index: 1;
}
.confetti-piece {
  will-change: transform, opacity;
  filter: grayscale(1) drop-shadow(0 2px 8px #0002);
}

.hero-content {
  max-width: 600px;
}
.hero-content h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 1rem;
  color: #333;
  font-weight: 700;
}
.hero-content p {
  line-height: 1.6;
  font-weight: 1000;
  font-size: clamp(1rem, 3vw, 1.2rem);
  color: #555;
}

/* CTA Buttons */
.cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  justify-content: center;
}
.cta-buttons a,
.cta-buttons button {
  padding: 0.8rem 1.2rem;
  border: none;
  border-radius: 20px;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  background-color: #999;
  color: #ffffff;
  transition: background-color 0.3s, color 0.3s;
}
#Recommendations{
  font-weight: 900;
  background-color: #6c63ff;
}
.cta-buttons a:hover,
.cta-buttons button:hover,
#Recommendations:hover {
  background-color: #b3daff;
  color: #000;
}

/* Emphasized Recommendations CTA */
.cta-buttons .recommendations-btn {
  background: linear-gradient(135deg, #6c63ff, #8a7cff);
  color: #fff;
  border-radius: 999px;
  padding: 0.9rem 1.4rem;
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(108, 99, 255, 0.25), 0 4px 10px rgba(108, 99, 255, 0.15);
  transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}
.cta-buttons .recommendations-btn i {
  margin-inline-start: 0.5rem; /* RTL-friendly spacing */
  font-size: 0.9em;
}
.cta-buttons .recommendations-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #7b74ff, #9b8fff);
  box-shadow: 0 12px 24px rgba(108, 99, 255, 0.28), 0 6px 14px rgba(108, 99, 255, 0.18);
  color: #fff;
}
.cta-buttons .recommendations-btn:focus-visible {
  outline: 3px solid #a7a3ff;
  outline-offset: 2px;
}
.cta-buttons .recommendations-btn::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 48%;
  transform: translateX(-160%) skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  opacity: 0.6;
  transition: transform 0.8s ease;
}
.cta-buttons .recommendations-btn:hover::after {
  transform: translateX(220%) skewX(-20deg);
}

  /* Responsive AAJ logo in hero section */
  .hero-img .hero-logo-img {
    position: absolute;
    left: -110px;
    top: -65px;
    width: 150px;
    height: auto;
    max-width: 35vw;
    z-index: 1;
    pointer-events: none;
  }

  @media (max-width: 600px) {
    .hero-img .hero-logo-img {
      position: static;
      display: block;
      margin: 0 auto 1em auto;
      width: 70px;
      max-width: 40vw;
      left: unset;
      top: unset;
    }
    .hero-content {
      position: relative;
      z-index: 2;
    }
    .hero-img {
      display: flex;
      flex-direction: column;
      align-items: center;
      position: relative;
    }
  }

/* About Section */
#about {
  margin-top: 3rem;
  background-color: #fdf1f1;
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  animation: fadeInUp 1s ease;
}
#about h2 {
  text-align: center;
  font-weight: 700;
  font-size: 2rem;
  margin-bottom: 1rem;
}
#about p {
  line-height: 1.6;
  font-size: 1.1rem;
}

/* Swiper Carousel Section (Workplaces) */
#workplaces {
  margin-top: 3rem;
}
#workplaces h2 {
  margin-bottom: 1rem;
  font-size: 1.4rem;
  color: #333;
  text-align: center;
}
.swiper-slide {
  width: 160px;
  height: 180px;
  background-color: #fff;
  border-radius: 20px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 0 auto;
}
.swiper-slide img {
  max-width: 80%;
  max-height: 80%;
  height: auto;
  object-fit: contain;
  margin-bottom: 0.5rem;
}
.swiper-slide span {
  font-size: 0.9rem;
  white-space: nowrap;
}
.swiper-button-next,
.swiper-button-prev {
  color: #444;
}
.swiper-pagination {
  display: none !important;
}

/* Topics Section */
#topics {
  margin-top: 3rem;
}
#topics h2 {
  text-align:center;
  margin-bottom: 1rem;
  font-size: 1.4rem;
  color: #333;
}
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}
.topic {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-color: #eef7ff;
  padding: 1rem;
  border-radius: 20px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s;
  cursor: pointer;
}
.topic:hover {
  transform: translateY(-5px);
}
.topic i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: #666;
}
.topic h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

/* Contact Form */
#contact {
  margin-top: 3rem;
  background-color: #fdf1f1;
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  animation: fadeInUp 1s ease;
}
#contact h2 {
  margin-bottom: 1rem;
  text-align: center;
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 500px;
  margin: 0 auto;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
}
.contact-form button {
  align-self: flex-end;
  background-color: #cce5ff;
  border: none;
  border-radius: 20px;
  padding: 0.8rem 1.2rem;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
}
.contact-form button:hover {
  background-color: #b3daff;
}

/* Footer */
footer {
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  color: #777;
}

/* Fade-in-up Keyframe */
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal Styles */
.modal {
  display: none; /* Controlled by JS .show class */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* REMOVED overflow: auto; from here */
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 1rem; /* Padding for backdrop, ensures modal doesn't touch screen edges */
}

.modal.show {
  display: flex; /* This is already correctly managed by your JS */
}

.modal-content {
  background-color: #fff;
  /* padding: 2rem; /* REMOVED padding from here, will be on inner elements */
  border-radius: 20px;
  max-width: 600px;
  width: 100%;
  position: relative;
  animation: fadeInUp 0.4s ease;
  display: flex; /* ADDED: Use flexbox for layout */
  flex-direction: column; /* ADDED: Stack children vertically */
  max-height: 90vh; /* ADDED: Max height for the modal box (e.g., 90% of viewport height) */
  /* overflow-y: auto; /* MOVED this to .modal-body */
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  /* margin-bottom: 1rem; /* Can be replaced by padding */
  padding: 1.5rem 2rem 0.5rem 2rem; /* ADDED: Padding for header */
  flex-shrink: 0; /* ADDED: Prevent header from shrinking */
}

.modal-header i {
  font-size: 2rem;
  color: #666;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  z-index: 10; /* Ensure close button is above other modal content */
}

.modal-body {
  /* ADDED: Padding for body */
  padding: 0.5rem 2rem 1.5rem 2rem;
  /* ADDED: This is the key for scrolling */
  overflow-y: auto;
  /* ADDED: Allow body to take available space */
  flex-grow: 1;
   /* ADDED: Important for flex children that need to scroll */
  min-height: 0;
}


.ai-brainstorm-section h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    color: #333;
}
.ai-buttons{
    display:flex;
    gap:.5rem;
    margin-top:.5rem;
}
#aiPromptInput {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 0.5rem;
    font-family: 'Assistant', sans-serif;
    min-height: 60px;
}
#aiBrainstormBtn {
    background-color: #6c63ff;
    color: white;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 0.9rem;
}
#aiBrainstormBtn:hover {
    background-color: #574fd8;
}
#aiBrainstormBtn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}
#aiResponseArea {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f0f2f5; /* Light grey background */
    border-radius: 10px;
    /* min-height: 70px; /* Let it grow or shrink naturally */
    border: 1px solid #e0e0e0;
    white-space: pre-wrap; /* Preserve line breaks from AI */
    font-size: 0.95rem;
    line-height: 1.5;
}
#aiResponseArea p,
#aiResponseArea ul,
#aiResponseArea ol,
#aiResponseArea h1,
#aiResponseArea h2,
#aiResponseArea h3,
#aiResponseArea h4,
#aiResponseArea h5,
#aiResponseArea h6 {
    margin-bottom: 0.75rem; /* Spacing for Markdown elements */
    white-space: normal; /* Allow wrapping for markdown-generated content */
}
#aiResponseArea ul,
#aiResponseArea ol {
    padding-right: 20px; /* Indentation for lists in RTL */
}
#aiResponsePlaceholder {
    color: #777;
    font-style: italic;
}
#aiLoadingIndicator {
    display: none; /* Hidden by default */
    text-align: center;
    margin-top: 1rem;
    color: #6c63ff;
}
#aiLoadingIndicator i {
    margin-right: 0.5rem;
}


@media (max-width: 600px) {
  .modal-content {
    /* padding: 1rem; /* Padding is now on header/body */
    max-height: 95vh; /* Allow a bit more on small screens */
  }
  .modal-header {
    flex-direction: column;
    text-align: center;
    padding: 1rem 1rem 0.5rem 1rem; /* Adjusted padding for smaller screens */
  }
   .modal-body {
    padding: 0.5rem 1rem 1rem 1rem; /* Adjusted padding for smaller screens */
  }
}
