/* ===================================
   Portfolio Header Creative Design
   صورة كبيرة فوق بتشاور + بوكس رسالة تحت
   التصميم مستوحى من الصورة المرفقة
   =================================== */

.portfolio-hero-section {
  padding: 40px 0 20px 0;
  /* تقليل المسافات */
  position: relative;
  overflow: visible;
  margin-bottom: 30px;
  /* إضافة مسافة فوق Recent Projects */
}

.portfolio-hero-wrapper {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  padding: 0 20px;
}

/* Removed portfolio-hero-chat-sequence */

.chat-message {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 8px;
  opacity: 0;
  transform: translateY(15px);
  animation: messageSlideIn 0.5s forwards cubic-bezier(0.2, 0.8, 0.2, 1);
}

.chat-sender-wrapper {
  position: relative;
  margin-bottom: 22px;
  /* Align with bottom of bubble */
}

.chat-sender-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: white;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(17, 24, 39, 0.08);
  border: 1px solid rgba(102, 126, 234, 0.15);
}

.online-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background-color: #10B981;
  /* Green */
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-message-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 100%;
}

.chat-bubble {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(102, 126, 234, 0.15);
  border-radius: 18px 18px 18px 4px;
  padding: 12px 16px;
  box-shadow: 0 8px 25px rgba(17, 24, 39, 0.08);
  backdrop-filter: blur(10px);
  position: relative;
  max-width: 100%;
}

/* Voice Note Styles */
.voice-note-bubble {
  padding: 10px 14px;
  min-width: 200px;
}

.voice-note-player {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.play-btn {
  width: 32px;
  height: 32px;
  background: #667eea;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
}

.waveform {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 20px;
  flex-grow: 1;
}

.waveform span {
  width: 3px;
  background: #cbd5e1;
  border-radius: 2px;
  animation: waveformAnim 1.2s infinite ease-in-out;
}

/* Create random heights for waveform effect */
.waveform span:nth-child(1) {
  height: 10px;
  animation-delay: 0.1s;
}

.waveform span:nth-child(2) {
  height: 16px;
  animation-delay: 0.2s;
}

.waveform span:nth-child(3) {
  height: 8px;
  animation-delay: 0.3s;
}

.waveform span:nth-child(4) {
  height: 14px;
  animation-delay: 0.4s;
}

.waveform span:nth-child(5) {
  height: 18px;
  animation-delay: 0.5s;
}

.waveform span:nth-child(6) {
  height: 12px;
  animation-delay: 0.2s;
}

.waveform span:nth-child(7) {
  height: 6px;
  animation-delay: 0.1s;
}

.waveform span:nth-child(8) {
  height: 10px;
  animation-delay: 0.3s;
}

@keyframes waveformAnim {

  0%,
  100% {
    height: 6px;
    opacity: 0.6;
  }

  50% {
    height: 18px;
    opacity: 1;
    background: #667eea;
  }
}

.duration {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}

.voice-caption {
  font-size: 11px;
  color: #64748b;
  margin: 4px 0 0 0;
}

/* Reply Suggestions */
.chat-reply-suggestions {
  display: flex;
  gap: 8px;
  margin-left: 44px;
  /* Align with text */
  margin-top: 8px;
  opacity: 0;
  animation: messageSlideIn 0.5s forwards 4.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  flex-wrap: wrap;
}

.reply-chip {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(102, 126, 234, 0.3);
  padding: 6px 12px;
  border-radius: 16px;
  color: #4b5563;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.reply-chip:hover {
  background: #667eea;
  color: white;
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

/* The little tail for the first message only */
.chat-msg-1 .chat-bubble::after {
  content: '';
  position: absolute;
  left: -8px;
  bottom: 0;
  width: 16px;
  height: 16px;
  background: rgba(255, 255, 255, 0.95);
  border-left: 1px solid rgba(102, 126, 234, 0.15);
  border-bottom: 1px solid rgba(102, 126, 234, 0.15);
  border-bottom-left-radius: 8px;
  clip-path: polygon(0 100%, 100% 100%, 100% 0);
}

.chat-bubble p {
  font-size: 13.5px;
  line-height: 1.5;
  color: #1f2937;
  margin: 0;
}

.chat-list {
  list-style: none;
  padding: 8px 0 0 0;
  margin: 0;
  display: grid;
  gap: 8px;
  border-top: 1px dashed rgba(0, 0, 0, 0.05);
  margin-top: 8px;
}

.chat-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  color: #374151;
}

.chat-list img {
  width: 14px;
  height: 14px;
  margin-top: 2px;
  flex: 0 0 14px;
}

.chat-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  margin-left: 4px;
}

.chat-meta .time {
  font-size: 10px;
  color: #6b7280;
  font-weight: 500;
}

.read-tick {
  width: 12px;
  height: 12px;
  opacity: 0.6;
}

.read-tick.tick-2 {
  margin-left: -8px;
}

/* Typing Indicator */
.typing-dots {
  display: flex;
  gap: 4px;
  padding: 4px 2px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  background: #9ca3af;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

/* Animations & Delays */
.chat-msg-1 {
  animation-delay: 2s;
}

.chat-msg-2 {
  animation-delay: 3.5s;
}

.chat-msg-3 {
  animation-delay: 5s;
}

.typing-indicator {
  animation: showTyping 5s forwards;
  /* Shows immediately, hides after 5s */
}

@keyframes messageSlideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes typingBounce {

  0%,
  80%,
  100% {
    transform: scale(0);
  }

  40% {
    transform: scale(1);
  }
}

@keyframes showTyping {
  0% {
    opacity: 0;
    transform: translateY(15px);
    display: flex;
  }

  10% {
    opacity: 1;
    transform: translateY(0);
  }

  85% {
    opacity: 1;
    transform: translateY(0);
  }

  95% {
    opacity: 0;
    transform: translateY(-10px);
  }

  100% {
    opacity: 0;
    transform: translateY(-10px);
    display: none;
    height: 0;
    margin: 0;
    overflow: hidden;
  }
}

/* ===== Profile Image on Top ===== */
.portfolio-hero-image-top {
  position: absolute;
  z-index: 0;
  /* خلف البطاقة */
  top: -100px;
  /* right: 700px; */
  left: 50px;
  display: flex;
  justify-content: center;
}

.hero-profile-pointing {
  width: 100%;
  max-width: 550px;
  /* تصغير الصورة */
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.1));
  animation: gentleFloat 3s ease-in-out infinite;
  opacity: 0.9;
  /* شفافية خفيفة لتظهر خلف البطاقة */
}

/* Chat Sequence for Portfolio Image */
.portfolio-image-chat-sequence {
  position: absolute;
  top: 0px;
  right: -250px;
  /* Position to the right of the image */
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 10;
  pointer-events: none;
}

.portfolio-image-chat-sequence>* {
  pointer-events: auto;
}

.portfolio-image-chat-sequence .chat-message {
  flex-direction: row;
  /* Icon on the left */
  align-self: flex-start;
  width: 100%;
  justify-content: flex-start;
}

.portfolio-image-chat-sequence .chat-sender-wrapper {
  margin-right: 12px;
  margin-bottom: 0;
}

.portfolio-image-chat-sequence .chat-bubble {
  border-radius: 18px 18px 18px 4px;
  /* Point to bottom-left */
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.portfolio-image-chat-sequence .chat-msg-1 .chat-bubble::after {
  content: '';
  position: absolute;
  left: -8px;
  bottom: 0;
  width: 16px;
  height: 16px;
  background: rgba(255, 255, 255, 0.98);
  border-left: 1px solid rgba(102, 126, 234, 0.15);
  border-bottom: 1px solid rgba(102, 126, 234, 0.15);
  border-bottom-left-radius: 8px;
  clip-path: polygon(0 100%, 100% 100%, 100% 0);
}

/* Responsive adjustments for portfolio chat */


/* ===== Message Box Below ===== */
.portfolio-message-box-bottom {
  position: relative;
  z-index: -1;
  /* فوق الصورة */
  padding-top: 20px;
  max-width: 450px;
  /* تصغير البطاقة */
  margin: 0 auto;
  left: -500px;
  top: 30px;
}

.message-box-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  /* تصغير الحواف */
  padding: 30px 40px 25px 40px;
  /* تصغير الحشو */
  box-shadow:
    0 15px 40px rgba(102, 126, 234, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
  animation: slideUp 0.8s ease-out;
}

/* Subtle Pattern Overlay */
.message-box-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

/* ===== Message Header ===== */
.message-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
  position: relative;
  z-index: 1;
}

.message-dots {
  display: flex;
  gap: 10px;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  animation: dotPulse 2s ease-in-out infinite;
}

.dot-red {
  background: #ff5f57;
  animation-delay: 0s;
}

.dot-yellow {
  background: #ffbd2e;
  animation-delay: 0.2s;
}

.dot-green {
  background: #28ca42;
  animation-delay: 0.4s;
}

.message-badge {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  padding: 8px 20px;
  border-radius: 25px;
  color: white;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* ===== Message Content ===== */
.message-content {
  position: relative;
  z-index: 1;
}

.message-title {
  font-size: 36px;
  /* تصغير الخط */
  font-weight: 900;
  color: white;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  line-height: 1.1;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.message-subtitle {
  font-size: 18px;
  /* تصغير الخط */
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 8px;
  line-height: 1.4;
}

.message-description {
  font-size: 14px;
  /* تصغير الخط */
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 0;
  line-height: 1.6;
  font-weight: 400;
}

/* ===== Animations ===== */
@keyframes gentleFloat {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-15px);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dotPulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.15);
    opacity: 0.8;
  }
}

/* Medium Screen Fix (992px - 1200px) */
@media (max-width: 1200px) {
  .portfolio-message-box-bottom {
    left: -200px;
    /* Adjusted from -500px to fit screen */
    max-width: 400px;
  }

  .portfolio-hero-image-top {
    left: 300px;
    /* Adjusted to reduce overlap with text */
  }

  .hero-profile-pointing {
    max-width: 400px;
    /* Smaller image to fit in medium screens */
  }
}

@media (max-width: 992px) {
  .portfolio-hero-section {
    padding-top: 60px;
  }

  .portfolio-hero-image-top {
    position: relative;
    top: 0;
    left: 0;
    flex-direction: column-reverse;
    align-items: center;
  }

  .portfolio-message-box-bottom {
    left: 0;
    top: 0;
    margin-top: 30px;
  }

  .portfolio-image-chat-sequence {
    position: relative;
    top: -50px;
    right: 0;
    left: 0;
    margin: 0 auto -60px auto;
    align-items: center;
    width: 100%;
    max-width: 350px;
    z-index: 999;
  }

  .hero-profile-pointing {
    max-width: 250px;
    top: 50px;
    z-index: 1;
    position: relative;
  }

  .message-box-card {
    padding: 25px 35px 20px 35px;
  }

  .message-title {
    font-size: 32px;
  }

  .message-subtitle {
    font-size: 16px;
  }

  .message-description {
    font-size: 13px;
  }
}

@media (max-width: 768px) {


  .portfolio-hero-section {
    padding: 30px 0 15px 0;
    margin-bottom: 20px;
  }

  .hero-profile-pointing {
    max-width: 200px;
  }

  .message-box-card {
    padding: 20px 25px 18px 25px;
    border-radius: 15px;
  }

  .message-title {
    font-size: 28px;
    letter-spacing: 1.5px;
  }

  .message-subtitle {
    font-size: 15px;
  }

  .message-description {
    font-size: 12px;
  }
}

@media (max-width: 576px) {


  .chat-bubble {
    padding: 10px 14px;
  }

  .chat-bubble p {
    font-size: 12px;
  }

  .chat-list li {
    font-size: 11.5px;
  }

  .portfolio-hero-section {
    padding: 25px 0 10px 0;
    margin-bottom: 15px;
  }

  .hero-profile-pointing {
    max-width: 160px;
  }

  .message-box-card {
    padding: 18px 20px 15px 20px;
    border-radius: 12px;
  }

  .message-title {
    font-size: 24px;
    letter-spacing: 1px;
  }

  .message-subtitle {
    font-size: 14px;
    margin-bottom: 6px;
  }

  .message-description {
    font-size: 11px;
  }

  .message-badge {
    font-size: 10px;
    padding: 5px 12px;
    letter-spacing: 0.5px;
  }

  .dot {
    width: 10px;
    height: 10px;
  }
}

@media (max-width: 400px) {
  .hero-profile-pointing {
    max-width: 140px;
  }

  .message-box-card {
    padding: 15px 18px 12px 18px;
  }

  .message-title {
    font-size: 22px;
  }

  .message-subtitle {
    font-size: 13px;
  }

  .message-description {
    font-size: 10px;
  }
}

/* ===================================
   Clean Services to Projects Handoff
   =================================== */
.split-portfolio {
  padding-top: clamp(6px, 4vw, 38px);
  position: relative;
  background:
    linear-gradient(180deg, #fbfcff 0%, #ffffff 18%, #ffffff 100%);
}

.split-portfolio::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: min(760px, 86vw);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(79, 70, 229, 0.18), transparent);
  pointer-events: none;
}

.portfolio-hero-section {
  padding: 0 0 clamp(6px, 3vw, 22px) 0;
  margin-bottom: 0;
  overflow: visible;
}

.portfolio-hero-wrapper {
  max-width: 980px;
  min-height: 300px;
  display: block;
  padding: 0 20px;
}

.portfolio-hero-image-top {
  position: relative;
  top: auto;
  left: auto;
  z-index: 2;
  display: flex;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(28px, 5vw, 54px);
  min-height: 280px;
}

.hero-profile-pointing {
  max-width: 315px;
  opacity: 1;
  filter: drop-shadow(0 14px 24px rgba(15, 23, 42, 0.12));
  animation-duration: 4.5s;
}

.portfolio-image-chat-sequence {
  position: relative;
  top: auto;
  right: auto;
  width: 100%;
  max-width: 430px;
  gap: 10px;
  z-index: 3;
  align-self: center;
  pointer-events: auto;
}

.portfolio-image-chat-sequence .chat-message {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: end;
  gap: 10px;
  opacity: 1;
  transform: none;
  animation: messageSlideIn 260ms ease-out both;
}

.portfolio-image-chat-sequence .chat-message::before {
  content: '';
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ffffff url('../img/banner/me_1.png') center top / 145% auto no-repeat;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

.portfolio-image-chat-sequence .chat-message-content {
  min-width: 0;
}

.portfolio-image-chat-sequence .chat-bubble {
  width: 100%;
  border-radius: 16px 16px 16px 5px;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid rgba(79, 70, 229, 0.12);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.075);
  backdrop-filter: none;
}

.portfolio-image-chat-sequence .chat-msg-1 .chat-bubble::after {
  background: #ffffff;
}

.portfolio-image-chat-sequence .chat-bubble p {
  font-size: 12.5px;
  line-height: 1.45;
}

.portfolio-image-chat-sequence .chat-list {
  gap: 6px;
  padding-top: 8px;
  margin-top: 8px;
}

.portfolio-image-chat-sequence .chat-list li {
  font-size: 12px;
  line-height: 1.35;
}

.portfolio-image-chat-sequence .chat-list .chat-list-icon {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
}

.portfolio-message-box-bottom {
  display: none;
}

@media (max-width: 991.98px) {
  .split-portfolio {
    padding-top: 32px;
  }

  .portfolio-hero-wrapper {
    min-height: 0;
    display: block;
    max-width: 560px;
  }

  .portfolio-hero-image-top {
    min-height: 0;
    flex-direction: column;
    gap: 14px;
    align-items: center;
  }

  .hero-profile-pointing {
    max-width: 210px;
    top: auto;
    position: relative;
  }

  .portfolio-image-chat-sequence {
    top: auto;
    right: auto;
    left: auto;
    margin: -8px auto 0;
    max-width: 430px;
    width: 100%;
  }
}

@media (max-width: 575.98px) {
  .split-portfolio {
    padding-top: 26px;
  }

  .portfolio-hero-section {
    padding-bottom: 22px;
  }

  .portfolio-image-chat-sequence .chat-message {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
  }

  .portfolio-image-chat-sequence .chat-message::before {
    width: 30px;
    height: 30px;
  }

  .portfolio-image-chat-sequence .chat-bubble {
    padding: 10px 12px;
  }

  .portfolio-image-chat-sequence .chat-bubble p,
  .portfolio-image-chat-sequence .chat-list li {
    font-size: 11.5px;
  }
}

/* ===================================
   Footer Chat Sequence
   =================================== */
.footer-chat-sequence {
  position: relative;
  width: 100%;
  max-width: 450px;
  margin: 0 auto 40px auto;
  /* Center horizontally and add bottom margin */
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  /* Keep text left aligned */
}

/* Ensure messages appear on white/transparent background */
.footer-chat-sequence .chat-bubble {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
