@import url('https://fonts.googleapis.com/css2?family=Playball&display=swap'); /* elegant fallback script */

/* style.css */
/* This applies whenever the page is in RTL mode (i.e. <html dir="rtl">) */
:dir(rtl) {
  direction: rtl;
  unicode-bidi: embed; /* make sure text flows correctly */
}

/* Swap sidebar to the right, main content to the left */
:dir(rtl) #sidebar {
  float: right;
  margin-left: 0;
  margin-right: 1rem;
}
:dir(rtl) .page-wrapper {
  margin-left: 0;
  margin-right: 1rem;
}

/* Align text in headers & buttons */
:dir(rtl) .site-header,
:dir(rtl) .site-footer,
:dir(rtl) .search-section,
:dir(rtl) .chat-form input,
:dir(rtl) .chat-form button {
  text-align: right;
}



/* If you have any hard-coded padding/margins: swap left/right */
:dir(rtl) .chat-form {
  gap: 12px; /* gap works both ways */
}
:dir(rtl) .chat-form input {
  /* padding stays same; text-align: right will move the cursor */
  text-align: right;
}

/* Flip any arrow icons if you have them via transform */
:dir(rtl) .fa-paper-plane {
  transform: scaleX(-1);
}

/* ——— Variables & Reset ——— */
:root {
  --black: #000;
  --white: #fff;
  --gold: #e3ae55;
  --red: #ff003b;
  --font: 'Poppins', sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }

/* ——— Layout ——— */
body {
  display: flex;
  font-family: var(--font);
  background: var(--white);
  color: var(--black);
  min-height: 100vh;
}
#sidebar {
  width: 250px;
  background: #000;
  color: #fff;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
#sidebar button {
  display: block;
  width: 100%;
  margin: 0.5rem 0;    /* equal vertical spacing */
  padding: 0.75rem;
  background: var(--gold);
  color: var(--black);
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.page-wrapper {
  flex: 1;
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

/* ——— Header & Search ——— */
.site-header {
  text-align: center;
  border-bottom: 1px solid var(--gold);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}
.site-header .logo {
  max-width: 600px;
  width: 100%;
  height: auto;
  margin: 0 auto 0.5rem;
  display: block;
}
.search-section {
  margin-bottom: 1.5rem;
  text-align: center;
}
.search-section input {
  width: 100%;
  max-width: 400px;
  padding: 0.5rem;
  border: 1px solid var(--gold);
  border-radius: 4px;
}

/* ——— Product Grid ——— */
#productsContainer {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.product-card {
  flex: 1 1 calc(25% - 1rem);
  border: 1px solid #eee;
  border-radius: 4px;
  text-align: center;
  padding: 0.5rem;
  position: relative;
  cursor: pointer;
  transition: box-shadow 0.2s;
}
.product-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.product-card img {
  max-width: 100%;
  height: auto;
}
.product-card h3 {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.2;
  height: 2.4em;
  overflow: hidden;
}

/* tooltip */
.tooltip {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 0.5rem;
  font-size: 0.8rem;
  border-radius: 4px;
  pointer-events: none;
  z-index: 10;
}

/* ——— Routine Cart ——— */
.selected-products {
  margin: 1.5rem 0;
  border: 2px solid var(--gold);
  padding: 1rem;
  border-radius: 4px;
}
.selected-products h3 {
  margin-bottom: 0.5rem;
}
.selected-products ol {
  padding-left: 1.2rem;
}

/* ——— Chat Area ——— */
.chatbox {
  margin-top: auto; /* push to bottom if page grows */
}
.chat-window {
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 1rem;
  height: 200px;
  overflow-y: auto;
  margin-bottom: 0.75rem;
}
.chat-form {
  display: flex;
  gap: 0.5rem;
}
.chat-form input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid var(--gold);
  border-radius: 4px;
}
.chat-form button {
  background: var(--black);
  color: var(--white);
  border: none;
  padding: 0 1rem;
  border-radius: 4px;
  cursor: pointer;
}

/* ——— AI messages ——— */
.msg.ai {
  background: #FFF9F3;
  border-left: 4px solid var(--gold);
  padding: 0.75rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}
.msg.ai.thinking {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: bold;
}
.msg.ai.thinking .dot {
  width: 8px; height: 8px;
  background: var(--gold);
  border-radius: 50%;
  animation: blink 1s infinite;
}
@keyframes blink {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.2); }
}

/* ——— Responsive ——— */
@media (max-width: 768px) {
  #sidebar { display: none; }
  .product-card { flex: 1 1 calc(50% - 1rem); }
}
@media (max-width: 480px) {
  .product-card { flex: 1 1 100%; }
}


.branding.vertical {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}


/* ——— Loading Screen Styling ——— */
#loadingScreen {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  background-color: black;
}


.spiral-container {
  position: relative;
  width: 300px;
  height: 300px;
}
/* ——— Intro Overlay Container ——— */
#introOverlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  pointer-events: all; 
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  overflow: hidden;
  opacity: 1;
  transform: translateX(0); /* ← establish a start point for the animation */
  will-change: transform;   /* ← hint to the compositor that transform will change */
}


/* ——— White Logo Styling ——— */
.loreal-logo-intro {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 180px;
  z-index: 10;
  animation: fadeInLogo 1s ease 0.5s forwards;
}

/* ——— Spiral Circles ——— */
.circle {
  position: absolute;
  border: 2px solid var(--gold);
  border-radius: 50%;
  opacity: 0.9;
}

#circle1 {
  width: 220px;
  height: 220px;
  top: 40px;
  left: 40px;
  animation: spiralOut 1.5s ease-in 0.2s forwards;
}

#circle2 {
  width: 260px;
  height: 260px;
  top: 20px;
  left: 20px;
  animation: spiralOut 2s ease-in 0.4s forwards;
}

#circle3 {
  width: 300px;
  height: 300px;
  top: 0;
  left: 0;
  animation: spiralOut 2.5s ease-in 0.6s forwards;
}

@keyframes spiralOut {
  0% {
    opacity: 1;
    transform: rotate(0deg) translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: rotate(360deg) translate(200px, 200px) scale(1.8);
  }
}

/* ——— Fade-in Logo ——— */
@keyframes fadeInLogo {
  from { opacity: 1; }
  to { opacity: 1; }
}

/* ——— SLIDE LEFT OUT ——— */
#introOverlay.slide-out {
  animation: slideLeftOut 1.25s ease-out forwards;
  will-change: transform;
  pointer-events: none;
 /* opacity: 0; */
}

@keyframes slideLeftOut {
  from { transform: translateX(0);  }
  to { transform: translateX(-100vw); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* chat window */
.chatbox {
  margin: 40px 0;
}


.chat-window {
  height: 360px;
  border: 2px solid var(--gold);
  padding: 20px;
  font-size: 18px;
  background: var(--white);
  overflow-y: auto;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  white-space: pre-line;
}

/* messages */
.msg {
  margin-bottom: 14px;
  line-height: 1.5;
}

.msg.user {
  color: var(--black);
  font-weight: 500;
}



.material-icons {
  font-size: 24px;
}

.chat-form button .material-icons {
  font-size: 24px;
}

.chat-form button:hover {
  background: var(--red);

}

.chat-form button:focus {
  outline: 2px solid #000;
  outline-offset: 2px;
}

/* visually hidden */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* footer */
.site-footer {
  margin: 60px 0 40px;
  text-align: center;
  font-size: 14px;
  font-family: 'Montserrat', sans-serif;
  color: #888;
  border-top: 1px solid var(--gold);
  padding-top: 20px;
}

.site-footer nav {
  margin-top: 12px;
}

.site-footer a {
  margin: 0 8px;
  color: #000;
  text-decoration: none;
  font-family: 'Montserrat', sans-serif;

}

.site-footer a:hover {
  color: #666666;
}



.msg.ai.thinking .dot:nth-child(2) {
  animation-delay: 0.2s;
}

.msg.ai.thinking .dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.4;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

@media (max-width: 480px) {
  .site-title {
    font-size: 20px;
  }

  .loreal-logo {
    height: 40px;
    object-fit: contain;
    filter: grayscale(100%) contrast(150%);
  }

  .chat-form input {
    font-size: 16px;
  }
}




.products-grid {
  display: none;
  flex-wrap: wrap;
  gap: 20px;
  margin: 30px 0;
}

/* Center the Generate button in its own wrapper */
.generate-wrapper {
  width: 100%;
  text-align: center;
  margin: 1.5rem 0;
}

.generate-btn {
  background: var(--gold);
  color: #000;
  border: none;
  border-radius: 4px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
}


.product-card {
  flex: 0 1 calc(33.333% - 14px);
  border: 1px solid #ccc;
  padding: 15px;
  border-radius: 4px;
  display: flex;
  gap: 15px;
  min-height: 160px;
  position: relative;
  overflow: visible;
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s;
}

/* Show description on hover (desktop) */
.product-card:hover .description-hover {
  display: block;
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: rgba(255,255,255,0.95);
  padding: 0.5rem;
  font-size: 0.85rem;
  z-index: 10;
}

/* On mobile, tap to toggle a “show” class */
.product-card.show-desc .description-hover {
  display: block;
}

.product-card img {
  width: 110px;
  height: 110px;
  object-fit: contain;
}
.product-card .product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* visual feedback on selection */
.product-card.selected {
  border-color: var(--gold);
  background: #fff9f3;
}

/* “Selected Products” list */
.selected-products {
  margin: 40px auto;     /* auto left/right = center */
  padding: 20px;
  border: 2px solid var(--gold);
  border-radius: 8px;
}
#selectedProductsList {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.selected-item {
  background: #f9f9f9;
  padding: 8px 12px;
  border-radius: 4px;
  position: relative;
}
.remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: transparent;
  border: none;
  color: var(--red);
  font-size: 1.1rem;
  cursor: pointer;
}

.remove-btn:hover { color: #fff; }

h2 {
  text-align: center;
}

/* ─── SIDEBAR ─── */
#sidebar {
  width: 250px;
  background: #000;
  color: #fff;
  padding: 1rem;
}
#sidebar h2 {
  margin-bottom: 1rem;
  text-align: center;
}
#sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}
#sidebar li {
  margin-bottom: 0.5rem;
}
.page-wrapper {
  flex: 1;
  padding: 2rem;
}

#routineCartList {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

#routineCartList li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
}

#routineCartList button {
  background: transparent;
  border: none;
  color: var(--red);
  font-size: 1rem;
  cursor: pointer;
}

#printRoutineBtn {
  width: 100%;
  padding: 0.75rem;
  background: var(--gold);
  border: none;
  color: #000;
  font-weight: bold;
  cursor: pointer;
  border-radius: 4px;
}

#downloadPdfBtn {
  width: 100%;
  padding: 0.75rem;
  background: var(--gold);
  border: none;
  color: #000;
  font-weight: bold;
  cursor: pointer;
  border-radius: 4px;
  margin: 0.5rem 0; 
}

#clearCartBtn {
  background: var(--gold);
  color: var(--black);
  border: none;
  padding: 0.75rem;
  border-radius: 4px;
  width: 100%;
  cursor: pointer;
  margin-top: 0.5rem;
}


/* Responsive sidebar collapse */
@media (max-width: 768px) {
  #sidebar { display: none; }
  .page-wrapper { width: 100%; padding: 1rem; }
}