/* ===== Font Faces ===== */
@font-face {
  font-family: 'Anton';
  src: url('../fonts/Anton-Regular.woff2') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Titan One';
  src: url('../fonts/TitanOne-Regular.woff2') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Lato';
  src: url('../fonts/Lato-Regular.woff2') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Roboto';
  src: url('../fonts/Roboto-Light.woff2') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ===== HTML and Body Setup ===== */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  min-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  scrollbar-width: none;
  font-family: 'Rubik', sans-serif;
}

body::-webkit-scrollbar {
  display: none;
}

body {
  padding: 3vw;
  background-color: #ECECFF;
}

/* ===== Fixed Background ===== */
#background {
  position: fixed;
  inset: 0;
  background-color: #ECECFF;
  z-index: -1;
  pointer-events: none;
}

/* ===== Profile Picture ===== */
#profile {
  position: fixed;
  top: 1.5vw;
  left: 1.5vw;
  width: clamp(6rem, 9vw, 7rem);
  height: clamp(6rem, 9vw, 7rem);
  z-index: 10;
}

#profile-bg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #655FFF;
  box-shadow: 0 4px 8px #110adb66;
  transition: transform 0.3s ease, filter 0.3s ease;
  filter: brightness(1) contrast(1);
}

#profile-bg:hover {
  transform: scale(1.05);
  filter: brightness(1.05) contrast(1.05);
}

/* ===== Rotating Logo ===== */
#rotating-image-bg {
  position: fixed;
  top: calc(1.5vw + 8rem);
  left: 1.5vw;
  width: clamp(5rem, 8vw, 7rem);
  height: clamp(5rem, 8vw, 7rem);
  border-radius: 50%;
  object-fit: cover;
  animation: spin 5s linear infinite;
  opacity: 0.9;
  pointer-events: none;
  z-index: 10;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ===== Language Section ===== */
.language-section {
  position: fixed;
  top: 3vw;
  right: 3vw;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: transparent !important;
  border: none !important;
  z-index: 10;
}

/* Language Toggle Switch */
.language-toggle {
  position: relative;
  width: 3rem;
  height: 1.5rem;
  min-width: 3.125rem;
  min-height: 1.5rem;
  cursor: pointer;
}

.language-toggle input {
  display: none;
}

.language-toggle span {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%; 
  height: 100%;          
  background-color: #8CEFEA;
  border-radius: 0.75rem;
  transition: background-color 0.3s;
} 

.language-toggle span::before {
  content: "";
  position: absolute;
  width: 1.25rem;        
  height: 1.25rem;       
  left: 0.125rem;        
  top: 0.125rem;         
  background-color: #DE9002;
  border-radius: 50%;
  transition: transform 0.3s;
}

.language-toggle input:checked + span {
  background-color: #655FFF;
}

.language-toggle input:checked + span::before {
  transform: translateX(1.625rem);
}

/* Language Labels */
.language-labels {
  display: flex;
  gap: 0.8rem;
}

.lang-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.3s ease;
  border-bottom: none !important;
  padding-bottom: 10px;
  position: relative;
  color: #999;
}

.lang-text {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 2px;
  color: #655FFF;
}

.lang-option.active {
  color: #655FFF;
}

.lang-option.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 1.875rem;             
  height: 0.5rem;              
  pointer-events: none;
  transform: translateX(-50%);
  border-radius: 50% / 100%;
  border-bottom: 0.4375rem solid #DE9002;
  box-sizing: border-box;
}

/* ===== General Title ===== */
.general-title-area {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 0;
  margin-bottom: 0.3rem;
  position: relative;
  box-sizing: border-box;
}

.general-title {
  font-family: 'Anton', 'Titan One', sans-serif;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: normal;
  color: #4A45BD;
  text-align: center;
  margin: 0;
  line-height: 1.2;
  transition: color 0.3s ease, transform 0.3s ease;
}

.general-title:hover {
  color: #5A50D1;
  transform: translateY(-10px);
}

/* ===== Slides Wrapper ===== */
.slides-wrapper {
  position: relative;
  max-width: 62.5rem;
  width: 100%;
  margin: 0 auto;
  margin-top: 0.1rem;
  padding: 0 max(3vw, 8rem);
  box-sizing: border-box;
  overflow: hidden;
  min-height: calc(93vh - 6vw);
}

/* ===== Slide Container ===== */
.slide {
  width: 100%;
  height: 100%;
  background-color: #FFF;
  margin: 0 auto;
  display: flex;
  opacity: 0;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  border-radius: 8px;
  overflow: hidden;
  transform: translateY(50px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
}

.slide.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  z-index: 10;
}

.slide-title {
  font-family: 'Anton', 'Titan One', sans-serif;
  font-size: 1.6rem;
  font-weight: normal;
  color: #4A45BD;
  vertical-align: middle;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  margin-bottom: -1rem;
}

.slide-left {
  flex: 1.3; 
  padding: 1rem;
  min-width: 0; 
  overflow-x: auto;
  position: relative;
}

.slide-right {
  flex: 1.7;
  padding: 0.1rem;
  overflow-x: auto;
}

/* Paragraph Text Styling */
[paragraph-translate]:not(h1):not(h2):not(h3) {
  text-align: justify;
  line-height: 1.7;
  font-family: 'Lato', 'Roboto', sans-serif;
  font-weight: medium;
  color: #333;
  font-size: 1.15rem;
  margin-top: 0.7rem;
  padding: 0.5rem;
  overflow-y: hidden;
}

.para-highlight-word {
  color: #4A45BD;
  font-weight: bold;
}

.para-highlight-word-bis {
  color: #F66944;
  font-weight: bold;
}

/* ===== DataTable Styles ===== */
div.dataTables_wrapper table#exp_data {
  border: 2px solid #655FFF;
  border-radius: 15px;
  width: 100%;
}

#exp_data th,
#exp_data td {
  border: 1px solid #D3D3D3;
}

#exp_data thead th {
  background-color: #A6F3F0;
}

#exp_data tbody tr:nth-child(even) {
  background-color: #E4E1E1;
}

#exp_data tbody tr:nth-child(odd) {
  background-color: #FFFFFF;
}

/* DataTables Filter */
div.dataTables_filter {
  float: left !important;
  margin: 0.5rem 0 !important;
}

.dataTables_filter label {
  font-family: 'Anton', 'Titan One', sans-serif;
  font-size: 1.6rem;
  font-weight: normal;
  color: #4A45BD;
  vertical-align: middle;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

div.dataTables_filter input {
  border: 2px solid #655FFF !important;
  border-radius: 8px !important;
  padding: 0.4rem 0.6rem !important;
  outline: none !important;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

div.dataTables_filter input:focus {
  border-color: #3273DC;
  box-shadow: 0 0 5px #3273DC;
}

/* ===== Iframe Plotly Chart ===== */
.iframe-container {
  position: relative;
  overflow-y: hidden; 
}

.transparent-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 410px;
  background: transparent;
  z-index: 10;
}

/* ===== Code Tabs ===== */
.code-tabs {
  position: relative;
  background: #ECECFF;
  border-radius: 8px 8px 0 0;
  margin-top: 2.8rem;
  width: 100%;
  max-width: 25rem;
  height: auto;
  max-height: 55vh;
}

.tabs {
  display: flex;
  margin: 0;
  padding: 0;
  border-bottom: 1.3px solid #ECECFF;
  position: relative;
  z-index: 1002;
}

.tabs button {
  background: #D1D1FA;
  border: none;
  color: #100f0f;
  padding: 12px 20px;
  font-family: 'Courier New', monospace;
  font-size: 15px;
  font-weight: 550;
  cursor: pointer;
  border-radius: 0;
  border-right: 1.3px solid #333;
  transition: all 0.2s ease;
}

.tabs button:first-child {
  border-radius: 8px 0 0 0;
}

.tabs button:hover {
  background: #404040;
  color: #fff;
}

.tabs button.active {
  background: #2D2C58;
  color: #fff;
}

.code-display {
  position: relative;
  max-height: 285px;
  overflow: auto;
  transition: max-height 0.3s ease;
}

.code-display pre {
  margin: 0;
  max-width: 100%;
  max-height: none;
  overflow-y: auto;
  overflow-x: auto;
  box-sizing: border-box;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 0 0 8px 8px;
  transition: max-height 0.3s ease;
  overflow: visible;
  font-size: 1rem;
}

/* Code Expand Toggle */
.expand-toggle {
  display: none;
}

.expand-btn {
  position: absolute;
  top: 9px;
  right: 11.5px;
  cursor: pointer;
  background: #404040;
  color: #ccc;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.2s ease, transform 0.3s ease;
  z-index: 1003;
}

.expand-btn:hover {
  background: #555;
  color: #fff;
}

.expand-toggle:checked ~ .tabs {
  display: none !important;
}

.expand-toggle:checked ~ .code-display {
  position: fixed !important;
  top: 100px;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  background: #ECECFF;
  max-height: none;
  padding: 20px;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.expand-toggle:checked ~ .code-display pre {
  max-height: none;
  height: calc(100vh - 180px);
}

.expand-toggle:checked + .expand-btn {
  transform: rotate(180deg);
  position: fixed !important;
  top: 30px;
  right: 30px;
  z-index: 1003;
  background: #2D2C58;
  color: #fff;
}

.expanded-tabs {
  display: none !important;
  margin: 0;
  padding: 0;
}

.expand-toggle:checked ~ .code-display .expanded-tabs {
  display: flex !important;
  position: fixed;
  top: 60px;
  left: 20px;
  right: 20px;
  z-index: 1002;
  background: #ECECFF;
  border-bottom: 1.3px solid #ECECFF;
  border-radius: 8px 8px 0 0;
}

.expanded-tabs button {
  background: #D1D1FA;
  border: none;
  color: #100f0f;
  padding: 12px 20px;
  font-family: 'Courier New', monospace;
  font-size: 15px;
  font-weight: 550;
  cursor: pointer;
  border-radius: 0;
  border-right: 1.3px solid #333;
  transition: all 0.2s ease;
}

.expanded-tabs button:first-child {
  border-radius: 8px 0 0 0;
}

.expanded-tabs button:hover {
  background: #404040;
  color: #fff;
}

.expanded-tabs button.active {
  background: #2D2C58;
  color: #fff;
}

/* ===== Grid Animation Container ===== */
.animation-container {
  width: calc(100% - 2rem);
  height: calc(100% - 2rem);
  max-height: 100%;
  min-height: 200px;
  position: relative;
  display: grid;
  grid-template-areas: "product-details payment-form";
  grid-template-columns: 1.5fr 1fr;
  grid-template-rows: 1fr;
  gap: 15px;
  animation: layoutSwitch 5s infinite ease-in-out;
  margin: 1rem;
  overflow: hidden;
  box-sizing: border-box;
}

.product-details {
  grid-area: product-details;
  background: linear-gradient(135deg, #A6F3F0 0%, #A6F3F0 50%, rgba(166, 243, 240, 0.8) 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #2c3e50;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  transition: all 0.8s ease-in-out;
  min-height: 80px;
}

.payment-form {
  grid-area: payment-form;
  background: #D8B87D;
  background-size: 100% 100%, 20px 20px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  transition: all 0.8s ease-in-out;
  height: 10rem;
  width: 13rem;
  justify-self: center;
  align-self: center;
}

@keyframes layoutSwitch {
  0%, 45% {
    grid-template-areas: "product-details payment-form";
    grid-template-columns: 1.5fr 1fr;
    grid-template-rows: 1fr;
  }
  55%, 100% {
    grid-template-areas: 
      "product-details"
      "payment-form";
    grid-template-columns: 1fr;
    grid-template-rows: 1.5fr 1fr;
  }
}

/* Background Images */
#product-bg {
  position: fixed;
  width: 13rem;
  height: 13rem;
  image-rendering: auto;
  pointer-events: none;
  z-index: 0;
}

#checkout-bg {
  position: fixed;
  width: 10rem;
  height: 8.5rem;
  image-rendering: auto;
  pointer-events: none;
  z-index: 0;
}

/* ===== Responsive Adjustments 1 ===== */
@media screen and (max-width: 1024px) {
  .payment-form {
    width: 11rem;
    height: 8rem;
  }

  #product-bg {
    width: 8rem;
    height: 8rem;
  }

  #checkout-bg {
    width: 8rem;
    height: 6.5rem;
  }
}

@media screen and (max-width: 800px) {
  .payment-form {
    width: 9rem;
    height: 7rem;
  }

  #product-bg {
    width: 4rem;
    height: 4rem;
  }

  #checkout-bg {
    width: 6rem;
    height: 4.5rem;
  }
}

@media screen and (max-width: 600px) {
  .code-tabs {
    width: 100%;
    max-width: none;
  }
  
  .code-display {
    max-height: 300px;
  }
  
  .expand-toggle:checked ~ .code-display {
    top: 80px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding: 15px;
  }
  
  .expand-toggle:checked ~ .code-display .expanded-tabs {
    top: 40px;
    left: 10px;
    right: 10px;
  }
  
  .expand-toggle:checked + .expand-btn {
    top: 10px;
    right: 20px;
  }
}

/* ===== Responsive Adjustments 2: Large Desktop Screens ===== */
@media screen and (min-width: 1920px) {
  
  /* Scale up profile picture for large screens */
  #profile {
    width: clamp(8rem, 9vw, 11rem);
    height: clamp(8rem, 9vw, 11rem);
  }
  
  /* Scale up rotating logo for large screens */
  #rotating-image-bg {
    top: calc(1.5vw + 10rem);
    width: clamp(7rem, 8vw, 10rem);
    height: clamp(7rem, 8vw, 10rem);
  }
  
  /* Scale up language toggle for large screens */
  .language-toggle {
    width: 4rem;
    height: 2rem;
    min-width: 4rem;
    min-height: 2rem;
  }
  
  .language-toggle span::before {
    width: 1.75rem;
    height: 1.75rem;
  }
  
  .language-toggle input:checked + span::before {
    transform: translateX(2rem);
  }
  
  .lang-text {
    font-size: 1.1rem;
  }
  
  .lang-option::after {
    width: 2.25rem;
    height: 0.6rem;
    border-bottom: 0.5rem solid #DE9002;
  }
  
  /* I am increasing slides wrapper width for large screens */
  .slides-wrapper {
    max-width: 80rem;
  }
  
  /* Add max-height to product-details to prevent excessive stretch */
  .product-details {
    max-height: 450px;
  }
  
  /* Add max-height to payment-form and scale it up */
  .payment-form {
    max-height: 280px;
    height: 12rem;
    width: 15rem;
  }
  
  /* Scale up background images */
  #product-bg {
    width: 15rem;
    height: 15rem;
  }
  
  #checkout-bg {
    width: 12rem;
    height: 10rem;
  }
  
  /* I am increasing code-display max-height */
  .code-display {
    max-height: 500px;
  }
  
  /* I am increasing code-tabs max-height */
  .code-tabs {
    max-height: 65vh;
  }
  
  /* I am increasing iframe height */
  .iframe-container {
    min-height: 500px;
  }
  
  .transparent-overlay {
    height: 500px;
  }
  
  /* Specific styling for Slide 5 iframe */
  .slide:nth-child(5) .slide-right .iframe-container iframe {
    height: 480px !important;
    margin-top: 29px;
  }
}

/* ===== Responsive Adjustments 3: For very Tall Screens (iMac, Vertical Tablets) ===== */
@media screen and (min-height: 1200px) {
  
  /* Scale up fixed elements even more for tall screens */
  #profile {
    width: clamp(9rem, 9vw, 12rem);
    height: clamp(9rem, 9vw, 12rem);
  }
  
  #rotating-image-bg {
    top: calc(1.5vw + 11rem);
    width: clamp(8rem, 8vw, 11rem);
    height: clamp(8rem, 8vw, 11rem);
  }
  
  /* I am increasing code and iframe heights for tall screens */
  .code-display {
    max-height: 600px;
  }
  
  .code-tabs {
    max-height: 70vh;
  }
  
  .iframe-container {
    min-height: 580px;
  }
  
  .transparent-overlay {
    height: 580px;
  }
  
  .slide:nth-child(5) .slide-right .iframe-container iframe {
    height: 550px !important;
  }
  
  /* I am increasing animation container max-height */
  .animation-container {
    max-height: 550px;
  }
  
  .product-details {
    max-height: 500px;
  }
  
  .payment-form {
    max-height: 300px;
  }
}

/* ===== Responsive Adjustments 4: For Ultra-Wide Displays  ===== */
@media screen and (min-width: 2560px) {
  
  /* I am scaling up fixed elements for ultra-wide */
  #profile {
    width: clamp(10rem, 9vw, 13rem);
    height: clamp(10rem, 9vw, 13rem);
  }
  
  #rotating-image-bg {
    top: calc(1.5vw + 12rem);
    width: clamp(9rem, 8vw, 12rem);
    height: clamp(9rem, 8vw, 12rem);
  }
  
  .language-toggle {
    width: 4.5rem;
    height: 2.25rem;
    min-width: 4.5rem;
    min-height: 2.25rem;
  }
  
  .language-toggle span::before {
    width: 2rem;
    height: 2rem;
  }
  
  .language-toggle input:checked + span::before {
    transform: translateX(2.25rem);
  }
  
  .lang-text {
    font-size: 1.2rem;
  }
  
  /* I am increasing slides wrapper even more */
  .slides-wrapper {
    max-width: 100rem;
  }
  
  /* I am increasing code and iframe heights */
  .code-display {
    max-height: 650px;
  }
  
  .iframe-container {
    min-height: 620px;
  }
  
  .transparent-overlay {
    height: 620px;
  }
  
  .slide:nth-child(5) .slide-right .iframe-container iframe {
    height: 600px !important;
  }
  
  /* I am scaling animation elements */
  .payment-form {
    height: 14rem;
    width: 17rem;
  }
  
  #product-bg {
    width: 17rem;
    height: 17rem;
  }
  
  #checkout-bg {
    width: 14rem;
    height: 12rem;
  }
}

/* ===== Responsive Adjustments 5: for combined Large and Tall Screens  ===== */
@media screen and (min-width: 2560px) and (min-height: 1440px) {
  
  .slides-wrapper {
    max-width: 110rem;
  }
  
  .code-display {
    max-height: 700px;
  }
  
  .code-tabs {
    max-height: 75vh;
  }
  
  .iframe-container {
    min-height: 680px;
  }
  
  .transparent-overlay {
    height: 680px;
  }
  
  .slide:nth-child(5) .slide-right .iframe-container iframe {
    height: 650px !important;
  }
  
  .animation-container {
    max-height: 650px;
  }
}
