/* Mobile Friendly Adjustments */

/* Define new class for splitbox behavior */
.splitbox-stack-mobile {
  /* This class will be used to indicate a splitbox-right that should stack below splitbox-left on mobile */
}

.splitbox-hide-mobile {
  /* This class will be used to indicate a splitbox-right that should be hidden on mobile */
}

/* Media query for tablets */
/* @media (max-width: 1260px) {

  .content-wrapper {
    width: 90%;
  }

  .welcome h1 {
    font-size: 6vw;
    line-height: 7vw;
  }

  .welcome p {
    width: 90%;
    font-size: 18px;
  }

  .participate-button {
    font-size: 2vw;
  }

  .iframe-wrapper iframe {
    width: 50vw;
    height: 60vh;
  }

  .terminal,
  .terminal-code {
    width: 50vw;
  }
} */


/* Media query for mobile devices */
@media (max-width: 1025px) {

  /* Add spacing for fixed menu bar (except on index page where logo needs to animate) */
  body:not(:has(.landing)) {
    padding-top: 60px;
  }

  /* On index page, no body padding but ensure menu bar is fixed */
  body:has(.landing) .menu-bar {
    position: fixed;
    top: 0;
  }

  /* Adjust translation notice for mobile */
  .translation-notice {
    height: auto;
    padding: 8px 0;
    position: static;
  }

  .translation-notice p {
    font-size: 12px;
    line-height: 1.4;
  }

  .menu-bar {
    top: 0;
  }

  /* Remove border/background container on mobile - full width content */
  .page-container {
    margin: 0;
    padding: 20px 0 40px 0;
    background: transparent !important;
    width: 100%;
  }

  section {
    width: 100% !important;
    max-width: 100% !important;
    padding: 40px 20px;
    margin: 0 auto;
    background: transparent !important;
    box-shadow: none !important;
    display: block;
  }

  .content-wrapper {
    width: 100%;
    max-width: 100%;
    padding: 0 20px;
    margin: 0 auto;
    box-sizing: border-box;
  }

  .welcome h1 {
    font-size: 6vw;
    line-height: 7vw;
  }

  .welcome p {
    width: 90%;
    font-size: 18px;
  }

  .participate-button {
    font-size: 2vw;
  }

  .iframe-wrapper iframe {
    width: 50vw;
    height: 60vh;
  }

  .terminal,
  .terminal-code {
    width: 50vw;
  }


  /* Glyphs - hide middle glyphs on mobile, only show top/bottom */
  .glyph {
    display: none !important;
  }

  /* Show only glyphs in top 15% and bottom 15% of page */
  .glyph[style*="top: 0%"],
  .glyph[style*="top: 1"],
  .glyph[style*="top: 2"],
  .glyph[style*="top: 3"],
  .glyph[style*="top: 4"],
  .glyph[style*="top: 5"],
  .glyph[style*="top: 6"],
  .glyph[style*="top: 7"],
  .glyph[style*="top: 8"],
  .glyph[style*="top: 9"],
  .glyph[style*="top: 10"],
  .glyph[style*="top: 11"],
  .glyph[style*="top: 12"],
  .glyph[style*="top: 13"],
  .glyph[style*="top: 14"],
  .glyph[style*="top: 15"] {
    display: block !important;
    opacity: 0.08 !important;
  }

  .glyph[style*="top: 85"],
  .glyph[style*="top: 86"],
  .glyph[style*="top: 87"],
  .glyph[style*="top: 88"],
  .glyph[style*="top: 89"],
  .glyph[style*="top: 9"] {
    display: block !important;
    opacity: 0.08 !important;
  }

  /* Indent on mobile too large */
  ul,
  ol {
    /* padding-inline-start: 20px; */
    padding-inline-start: 15px
  }

  /* Show mobile navigation and hide desktop menu */

  /* Simplify menu bar on mobile */
  .menu-bar {
    height: 60px;
    padding-bottom: 0;
    padding-left: 15px;
    padding-right: 15px;
    background: white !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  .menu-items {
    justify-content: space-between;
    gap: 0;
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  /* Hide all desktop menu items on mobile */
  .menu-left,
  .menu-right {
    display: none !important;
  }

  /* Show center logo in menu bar (except on index page where large logo animates) */
  .menu-logo {
    display: flex !important;
    margin-left: 42%;
    padding: 0;
    top: 0px;
  }

  /* Hide menu logo on index page (has .landing class) */
  body:has(.landing) .menu-logo {
    display: none !important;
  }

  /* On index page, hamburger should be on the right */
  body:has(.landing) .menu-items {
    justify-content: flex-end;
    padding-right: 5px;
  }

  .menu-logo-img {
    width: 50px;
    height: auto;
    position: relative;
  }

  /* Show hamburger menu button */
  .menu-item.menu-bars.mobile-br {
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    color: black;
    background: transparent;
    padding: 10px 12px;
    border-radius: 4px;
    transition: background 0.2s;
    margin: 0;
    width: 100%;
  }

  .menu-item.menu-bars.mobile-br:hover {
    background: rgba(0, 0, 0, 0.05);
  }

  .iframe-wrapper {
    display: none;
  }

  .canvas-container {
    width: 60;
    /* Match the mobile size */
    height: 40vh;
  }

  #meshCanvas {
    background-color: transparent !important;
    width: 100%;
    height: 100%;
    display: block;
    margin-top: 20px;
  }

  .spinner {
    width: 70px;
    height: 70px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
  }


  .mobile-br {
    display: block;
  }

  .title {
    margin-top: 160px !important;
  }

  /* Logo wrapper for index page */
  .logo-wrapper {
    position: absolute !important;
    top: 20vh !important;
    left: 50%;
    transform: translateX(-50%);
    transition: top 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
  }

  .logo-wrapper .logo {
    width: 250px !important;
    max-width: 80vw;
    transition: width 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
  }

  .logo-wrapper.scrolled {
    position: fixed !important;
    top: 7px !important;
    z-index: 102;
  }

  .logo-wrapper.scrolled .logo {
    width: 50px !important;
  }

  /* Landing section */
  .landing {
    margin-top: calc(15vh + 150px) !important;
    margin-bottom: 30vh;
  }

  /* Welcome section adjustments */
  .welcome {
    flex-direction: column;
    padding: 10px;
    margin-bottom: 10vh;
    height: auto;
  }

  .welcome h1 {
    font-size: 8vw;
    line-height: 10vw;
    width: 100%;
    margin: 20px auto;
    text-align: center;
  }

  .welcome p {
    width: 90%;
    margin: 0 auto;
    font-size: 16px;
    line-height: 24px;
    text-align: center;
  }

  .participate-button {
    font-size: 4vw;
    margin: 20px auto;
    display: block;
    width: 80%;
    text-align: center;
  }

  .welcome-text {
    align-items: center;
    margin: 0 auto;
  }

  .participate-box {
    margin: 20px auto;
    width: 90%;
    font-size: 4vw;
    text-align: center;
  }

  /* Splitbox adjustments for mobile */
  .splitbox-container {
    width: 95%;
  }

  .splitbox-left,
  .splitbox-right {
    display: block;
    width: 100%;
    padding: 0.5em;
  }

  /* Different handling based on class */
  .splitbox-hide-mobile.splitbox-right {
    display: none;
  }

  .splitbox-stack-mobile.splitbox-right {
    display: block;
    margin-top: 20px;
  }

  /* Process circle adjustments */
  .process-circle {
    width: 40vw;
    height: 40vw;
    font-size: 4em;
  }

  /* Terminal adjustments for mobile */
  .terminal,
  .terminal-code {
    width: 80vw;
    height: 70vh;
    min-height: 300px;
    padding: 1rem;
  }

  /* Submission form adjustment */
  .submission-form {
    width: 90%;
    padding: 20px;
  }

  .submission-form input[type='submit'] {
    width: 100%;
  }

  .content-wrapper.submission-form {
    color: hsl(0, 0%, 0%);
    border: 0px !important;
  }

  .submission-form .select-birth {
    width: 31.5%;
  }

  .submission-form p {
    margin-block-start: 1em;
  }

  /* Interface box adjustment */

  .content-wrapper.interface-box {
    color: hsl(0, 0%, 0%);
    border: 0px !important;
    font-size: 16px;
  }


  .interface-box {
    width: 90%;
    padding: 20px;
  }

  /* Adjust iframe for mobile */
  .iframe-wrapper iframe {
    width: 90vw;
    height: 50vh;
  }

  /* Hide non-mobile video and show mobile video */
  .rec-desktop {
    display: none;
  }

  .rec-mobile {
    display: block;
  }

  /* Footer adjustments */
  #footer-links .content-wrapper {
    gap: 20px;
  }

  .footer-column {
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
  }

  footer input[type='email'] {
    width: 80%;
    text-align: center;
  }

  footer input[type='submit'] {
    width: 80%;
  }

  /* Partner adjustments */
  .partner-row {
    display: block;
  }

  .partner-text,
  .partner-img {
    display: block;
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
  }


  .bottom_space {
    width: 100%;
    height: 40vw;
  }


  /* Mobile menu backdrop */
  .mobile-menu-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
  }

  .mobile-menu-backdrop.active {
    display: block;
    opacity: 1;
  }

  /* Adjust menu for mobile */
  .mobile-menu {
    display: block;
    position: fixed;
    top: 0;
    left: -102vw;
    height: 100vh;
    height: 100dvh; /* Use dynamic viewport height for better mobile support */
    width: 85vw;
    max-width: 400px;
    z-index: 1000;
    background: linear-gradient(135deg, #5a2f63, #1e0a28);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    transition: left 0.3s ease-in-out;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.3);
  }

  .mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .mobile-menu-logo {
    width: 80px;
    height: auto;
  }

  .mobile-menu-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
  }

  .mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.2);
  }

  .mobile-menu ul {
    padding: 20px;
    margin: 0;
  }

  .mobile-menu ul li {
    font-size: 18px;
    line-height: 1.5;
    color: white;
    margin-bottom: 5px;
  }

  .mobile-menu ul li a {
    color: white;
    text-decoration: none;
    display: block;
    padding: 12px 15px;
    border-radius: 4px;
    transition: background 0.2s;
  }

  .mobile-menu ul li a:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  /* CTA button in mobile menu */
  .mobile-menu-cta {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .mobile-menu-cta a {
    background: #fff;
    color: #5a2f63 !important;
    font-weight: 600;
    text-align: center;
  }

  .mobile-menu-cta a:hover {
    background: rgba(255, 255, 255, 0.9) !important;
  }

  .mobile-menu.active {
    left: 0;
  }


  /* Style for parent menu items */
  .mobile-menu .parent-menu-item {
    border-left: 4px solid #ffcc00;
    /* Add a colored border */
    margin-bottom: 15px;
    padding-left: 12px;
    /* Add padding between border and text */
  }

  /* Style for parent menu label */
  .mobile-menu .menu-parent {
    display: block;
    font-weight: bold;
    /* padding: 10px 0; */
    color: #ffcc00;
    /* Highlight color */
  }

  /* Style for submenu items */
  .mobile-menu .parent-menu-item ul {
    background-color: rgba(255, 255, 255, 0.1);
    /* Subtle background */
    /* margin-left: 10px; */
    border-radius: 5px;
    padding: 5px;
  }

  .mobile-menu .parent-menu-item ul li {
    padding-left: 0px;
    line-height: 1.2;
  }

  .mobile-menu .parent-menu-item ul li a {
    padding: 5px 0;
    display: block;
  }

  .mobile-menu .menu-parent {
    margin-bottom: 5px;
  }

  /* .language-selector {
    display: none;
  } */

  /* Add language selector to mobile menu */
  .menu .language-selector {
    height: 95%;
  }

  /* LANGUAGE  */

  .mobile-menu .language-dropdown {
    position: relative;
    width: 100%;
  }

  .menu .language-selector .language-dropdown li {
    display: inline;
  }

  .menu ul .special-button {
    display: inline !important;
    /* margin-top:13px!important; */
    margin-right: 0px !important;
    padding: 3px !important;
  }

  .menu #menu-selector {
    /* margin-top: 7px; */
    margin: 0;
    height: 100%;
    display: flex;
    /* position: relative; */
    /* display: inline-flex; */
    align-items: center;
  }


  /* FAQ section adjustments */
  .faq-answer {
    padding: 10px 0 10px 15px;
  }

  /* Organization section adjustments */
  .orgaimg {
    float: none;
    display: block;
    margin: 0 auto 15px auto;
  }

  .orgatext {
    width: 90%;
    margin: 0 auto;
    text-align: center;
  }

  .orgaamb_wrapper {
    width: 90%;
    margin: 0 auto;
    text-align: center;
  }

  /* Image wrapper adjustments */
  .image-wrapper {
    width: 100%;
    margin-bottom: 20px;
  }

  /* Smaller process circles for very small screens */
  .process-circle {
    width: 50vw;
    height: 50vw;
    font-size: 3em;
  }

  /* Adjust timeline for small screens */
  .timeline-circle {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }

  .timeline-item .splitbox-left,
  .timeline-item .splitbox-right {
    vertical-align: middle;
    width: 93%;
  }

  .timeline-line {
    left: 95%;
  }

  .timeline-circle {
    left: 95%;
  }
}

/* Media query for very small screens */
@media (max-width: 480px) {
  .welcome h1 {
    font-size: 10vw;
    line-height: 12vw;
  }

  .participate-button {
    font-size: 5vw;
  }

  section {
    padding: 0px 0;
  }

  h2 {
    font-size: 36px;
  }

  h3 {
    font-size: 24px;
  }


  /* Support layout responsive */
  .support-layout {
    flex-direction: column;
    gap: 20px;
  }

  .support-categories {
    flex: 0 0 auto;
    min-width: 100%;
    width: 100%;
  }

  .support-categories .content-wrapper {
    position: static;
  }

  .support-content-area {
    width: 100%;
  }

  /* Support buttons for small screens */
  .icsc-button.support-button {
    width: 83%;
  }

  .icsc-button {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: fit-content;
    display: block;
    margin-bottom: 10px;
  }

  #process #timetable {
    font-size: 18px;
    line-height: 27px;
    width: 60%;
  }

  .materials {
    width: 25vw;
    margin: 0 1vw;
  }


  /* LOGIN */

  .login-box {
    width: 250px;
    background: hsl(0, 0%, 100%);
    border: 0px solid hsl(0, 0%, 0%) !important;
    padding: 20px;
    font-size: 16px;
    text-align: center !important;
    margin: 5vh auto;
  }

  .login-box input[type="text"],
  .login-box input[type="email"],
  .login-box input[type="password"] {
    height: 50px;
    font-size: 16px;
    /* Prevents iOS zoom on focus */
    padding: 0 15px;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
    border-radius: 5px;
  }

  /* Style login button */
  .login-box input[type="submit"],
  .login-box button[type="submit"],
  .login-button {
    height: 50px;
    font-size: 18px;
    width: 100%;
    margin: 20px 0;
  }

  .logout-button-main {
    display: none;
  }

  /* Make forgot password link more tappable */
  a.forgot-password {
    display: block;
    padding: 10px 0;
    margin-bottom: 15px;
    font-size: 16px;
  }

  /* Ambassador page */

  .ambassador-participant-details {
    font-size: 3.5vw;
  }

  .ambassador-participant-details i {
    font-size: 3.5vw !important;
  }

  .ambassador-participant-points {
    font-size: 3.4vw;
  }

  .ambassador-participant-certificates {
    width: auto !important;
  }
}

@media only screen and (max-width: 1200px) {

  [dir="rtl"] .content-wrapper,
  html[lang="ar"] .content-wrapper {
    text-align: right !important;
  }

  [dir="rtl"] .menu ul .menu-bars,
  html[lang="ar"] .menu ul .menu-bars {
    float: left;
  }

  [dir="rtl"] .mobile-menu ul,
  html[lang="ar"] .mobile-menu ul {
    text-align: right;
  }
}