/* ---------- Shared Background for Login & Register ---------- */
body.page-login,
body.page-register {
  background: url('login_background.mp4') center center / cover no-repeat fixed;
  transition: background 0.3s ease;
}

/* Regular */
@font-face {
    font-family: 'Atami';
    src: url('Components/fonts/Atami-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}
/* ---------- Video Background Overlay ---------- */

.video-background {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  z-index: -1;
}

.video-background video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}

.video-background::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: background 0.3s ease;
}

body.light-mode .video-background::after {
  background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.04));
}

body.dark-mode .video-background::after {
  background: linear-gradient(180deg, rgba(0,0,0,0.52), rgba(0,0,0,0.28));
}


/* ---------- Card Styling ---------- */
.card {
  border-radius: 4rem;
  opacity: 0;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}


body.light-mode .card {
  background-color: rgba(255, 255, 255, 0.5);
  color: #222;
  border: 1px solid rgba(0,0,0,0.06);
  opacity: 1
}

body.dark-mode .card {
  background-color: rgba(12, 12, 12, 0.5);
  color: #f1f1f1;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 0 20px rgba(138, 43, 226, 0.15);
  opacity: 1
}

/* ---------- Form Controls ---------- */
body.light-mode .form-control {
  background: rgba(255,255,255,0.98);
  color: #222;
  border: 1px solid #ced4da;
}

body.dark-mode .form-control {
  background: rgba(255,255,255,0.08);
  color: #f1f1f1;
  border: 1px solid rgba(255,255,255,0.12);
}

.form-control:focus {
  box-shadow: 0 0 0 0.2rem rgba(138, 43, 226, 0.25);
  border-color: #8a2be2;
}

/* Feedback colors */
body.dark-mode .invalid-feedback { color: #f8d7da; }
body.light-mode .invalid-feedback { color: #dc3545; }

/* ==================== LOGIN HEADER ==================== */

/* Login logo (now theme toggle) */
.login-logo {
  height: 90px;
  width: 90px;
  object-fit: contain;
  display: inline-block;
  cursor: pointer;
  transition: transform 0.3s ease;
  margin-right: 12px;
  vertical-align: middle;
}

.login-logo:hover {
  transform: scale(1.05);
}

/* Default: show light logo, hide dark */
.logo-light {
  display: inline-block;
}
.logo-dark {
  display: none;
}

/* Flip visibility in dark mode */
body.dark-mode .logo-light,
html.dark-mode .logo-light {
  display: none;
}
body.dark-mode .logo-dark,
html.dark-mode .logo-dark {
  display: inline-block;
}

/* Login Title */
.login-title {
  font-family: 'Atami', sans-serif;
  font-size: 2rem;
  letter-spacing: 1px;
  line-height: 1.1;
  text-align: center;
  color: #1c1c1c;
  display: inline-block;
  vertical-align: middle;
  margin: 0;
}

/* Dark mode title color */
body.dark-mode .login-title,
html.dark-mode .login-title {
  color: #ffffff;
}

/* Logo + Title wrapper */
.login-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* ===================== REGISTER PAGE ENHANCEMENTS ===================== */

/* page-register-card slightly narrower than a generic .card to avoid white borders on small screens */
.page-register-card {
  width: 80%;
  max-width: 520px;
  border-radius: 2.5rem;
  padding: 2rem;
  box-sizing: border-box;
  background-clip: padding-box;
  max-height: 90vh;              /* NEW: keep card inside viewport */
  overflow-y: auto;              /* NEW: scroll inside card if content taller */
  margin: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(138,43,226,0.4) transparent;
  transition: all 0.3s ease;
}

/* ensure the page containers sit above the video overlay */
.page-register-card,
.page-login-card {
  position: relative;
  z-index: 1000;
}

/* make sure the body fills and no bright flash appears */
body.light-mode,
body.dark-mode {
  background-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* label + input tuning */
#registerForm label {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

#registerForm input.form-control {
  font-size: 0.9rem;
  padding: 0.55rem 0.75rem;
}

#registerForm .input-group .btn {
  border-color: rgba(255, 255, 255, 0.1);
}

#registerForm .form-control.is-invalid {
  border-color: #dc3545;
}

body.dark-mode #registerForm .form-control.is-invalid {
  border-color: #f0626a;
}

#registerForm .invalid-feedback {
  font-size: 0.8rem;
}

/* ensure the video overlay fully covers behind elements and no white edges show */
#videoBackground,
.video-background {
  background-color: transparent;
  will-change: transform;
}

/* logo + title wrapper: horizontal, centered, clickable (theme toggle) */
.page-register-logo-wrapper,
.page-login-logo-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
  user-select: none;
  cursor: pointer;
}

/* login-logo sizing & behavior */
.login-logo {
  height: 80px;
  width: 80px;
  object-fit: contain;
  display: inline-block;
  transition: transform 0.3s ease, opacity 0.3s ease;
  margin-right: 10px;
  vertical-align: middle;
}

.login-logo:hover { transform: scale(1.04); }
.login-logo:active { transform: scale(0.98); }

/* manage light/dark logo visibility */
.logo-light { display: inline-block; opacity: 1; }
.logo-dark { display: none; opacity: 0; transition: opacity 0.3s ease; }

body.dark-mode .logo-light { display: none; opacity: 0; }
body.dark-mode .logo-dark { display: inline-block; opacity: 1; }

/* title next to logo */
.login-title {
  font-family: 'Atami', sans-serif;
  font-size: 2rem;
  margin: 0;
  letter-spacing: 1px;
  color: #111;
  vertical-align: middle;
}
body.dark-mode .login-title { color: #fff; }

/* animation for main form entrance (no white flash) */



/* focus styling for accessibility */
.form-control:focus {
  outline: none;
  box-shadow: 0 0 0 0.22rem rgba(138,43,226,0.14);
  border-color: #8a2be2;
}

/* keep register button rounded and consistent */
#registerBtn {
  border-radius: 999px;
  padding: 0.6rem 1rem;
}

/* spinner alignment */
#registerBtn .spinner-border {
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* alert box default style overrides to match theme */
#registerAlert.alert {
  font-weight: 500;
}

/* responsive: reduce card size & padding on smaller or landscape screens */
@media (max-width: 900px), (orientation: landscape) {
  .page-register-card {
    border-radius: 1.6rem;
    padding: 1.3rem 1rem;
    max-height: 85vh;
  }

  .login-logo {
    height: 60px;
    width: 60px;
    margin-right: 8px;
  }

  .login-title {
    font-size: 1.4rem;
  }
}

/* ensure the card never goes transparent-white on weird browsers */
.page-register-card,
.page-login-card {
  background-clip: padding-box;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* Prevent accidental white border by forcing smooth transitions on background overlays */
.video-background::after {
  transition: background 0.3s ease, opacity 0.3s ease;
}
/* =========================================================
   TABLET FIX – 10.1" (1280×800) LOGIN & REGISTER PAGES
   ========================================================= */
@media only screen
  and (min-width: 1180px)
  and (max-width: 1340px)
  and (min-height: 760px)
  and (max-height: 900px) {

    /* Force video background to always fill tablet screen */
    .video-background,
    #videoBackground {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        overflow: hidden !important;
        z-index: -1 !important;
        background-color: black !important; /* Prevent white flash */
    }

    .video-background video {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        width: 100vw !important;
        height: 100vh !important;
        transform: translate(-50%, -50%) !important;

        object-fit: cover !important;
        object-position: center center !important;

        /* Tablet-specific fix for Android WebView playback scaling */
        -webkit-transform: translate(-50%, -50%) !important;
        -webkit-object-fit: cover !important;
    }

    /* Fix overlay coverage on tablet */
    .video-background::after {
        inset: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
    }

    /* Card sizing for 10.1" screens */
    .page-register-card,
    .page-login-card {
        width: 70% !important;
        max-width: 600px !important;
        padding: 2.2rem !important;
        border-radius: 3rem !important;
        max-height: 88vh !important;
    }

    /* Logo adjustments */
    .login-logo {
        height: 95px !important;
        width: 95px !important;
    }

    /* Title adjustments */
    .login-title {
        font-size: 2.3rem !important;
    }

    /* Form control scaling */
    .form-control {
        font-size: 1rem !important;
        padding: 0.75rem 1rem !important;
    }

    /* Buttons */
    button,
    .btn {
        font-size: 1rem !important;
        padding: 0.8rem 1.2rem !important;
        border-radius: 1.5rem !important;
    }

    /* Make entire layout slightly larger for readability */
    html, body {
        font-size: 18px !important;
    }

    /* Center container better on tablet */
    body.page-login,
    body.page-register {
        background-size: cover !important;
        background-attachment: fixed !important;
        background-position: center center !important;
    }
}
/* =========================================================
   ACTIVATION LINK CARD STYLES
   ========================================================= */
.activation-link-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(147, 51, 234, 0.1) 100%);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  padding: 16px;
  margin-top: 12px;
  text-align: center;
  transition: all 0.3s ease;
}

.activation-link-card:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(147, 51, 234, 0.15) 100%);
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.activation-icon {
  font-size: 24px;
  margin-bottom: 8px;
  display: block;
}

.activation-link-card .btn {
  font-size: 14px;
  padding: 8px 16px;
}

/* Divider between login and activation */
.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 2px 0;
  color: rgba(255, 255, 255, 0.6);
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.divider span {
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
}

/* Dark mode adjustments for divider */
body.dark-mode .divider {
  color: rgba(255, 255, 255, 0.5);
}

body.dark-mode .divider::before,
body.dark-mode .divider::after {
  border-bottom-color: rgba(255, 255, 255, 0.15);
}
/* ==================== FORGOT PASSWORD MODAL FIX ==================== */

/* ✅ Ensure modal is above ALL other content including video overlay */
.modal {
    z-index: 10000 !important;
}

/* ✅ Modal backdrop should be below modal content but above page */
.modal-backdrop {
    z-index: 9999 !important;
}

/* ✅ Modal content must be clickable */
.modal-content {
    z-index: 10001 !important;
    position: relative;
    pointer-events: auto !important;
}

/* ✅ Ensure all form inputs inside modal are clickable */
.modal input,
.modal select,
.modal textarea,
.modal button,
.modal .form-control {
    pointer-events: auto !important;
    position: relative;
    z-index: 10002 !important;
}

/* ✅ Fix Bootstrap modal dialog */
.modal-dialog {
    pointer-events: none;
}

.modal-dialog .modal-content {
    pointer-events: auto;
}

/* ✅ Prevent video overlay from interfering with modal */
body.modal-open .video-background,
body.modal-open .video-background::after {
    pointer-events: none !important;
    z-index: -1 !important;
}

/* ✅ Ensure modal header/footer are clickable */
.modal-header,
.modal-footer,
.modal-body {
    pointer-events: auto !important;
    z-index: 10003 !important;
}

/* ✅ Dark mode modal styling */
body.dark-mode .modal-content {
    background: rgba(44, 44, 44, 0.98) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .modal-header,
body.dark-mode .modal-footer {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .modal input,
body.dark-mode .modal select,
body.dark-mode .modal .form-control {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

body.dark-mode .modal input::placeholder,
body.dark-mode .modal .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* ✅ Fix modal close button */
.modal .btn-close {
    pointer-events: auto !important;
    z-index: 10004 !important;
}

/* ================= LANGUAGE SELECTOR (CARD INTEGRATED) ================= */
#lang-selector-wrapper {
  position: left !important; /* Resets old fixed/absolute positioning */
  display: flex !important;
  max-width: 260px;
}



/* Globe icon */
.lang-icon {
  font-size: 15px;
  opacity: 0.85;
  user-select: none;
  transition: opacity 0.2s ease;
}
#lang-selector-wrapper:hover .lang-icon { opacity: 1; }

/* Select element reset & styling */
.lang-select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  outline: none;
  font-size: 8px;
  font-weight: 500;
  color: inherit;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s ease;
  background-repeat: no-repeat;
  background-position: right 4px center;
  background-size: 14px;
}

body.light-mode .lang-select { color: #222;   background: transparent;}
body.dark-mode .lang-select {
  color: #f1f1f1;
  background-image: url("image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23b19cd9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.lang-select:hover,
.lang-select:focus {
  background: transparent;
}

/* Dropdown options */
.lang-select option {
  background: #fff;
  color: #222;
  padding: 8px 10px;
}
body.dark-mode .lang-select option {
  background: transparent;
  color: #f1f1f1;
}

/* Responsive: shrink on mobile */
@media (max-width: 480px) {
  #lang-selector-wrapper {
    max-width: 220px;
    padding: 8px 12px;
    gap: 8px;
  }
  .lang-select {
    font-size: 12px;
    padding: 4px 20px 4px 6px;
    background: transparent;
  }
}

/* Hide selector post-login (reinforces JS logic) */
body:not(.page-login) #lang-selector-wrapper {
  display: none !important;
}