/* ========= RESET ========= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  html, body {
    height: 100%;
    width: 100%;
    font-family: 'Red Hat Display', sans-serif;
    display: flex;
    flex-direction: column;
  }

  body {
    background: url(../assets/login.jpg) no-repeat center center fixed;
    background-size: cover;
    text-align: center;
    font-family: 'Red Hat Display', sans-serif;
    font-size: 20px;
    margin: 0;
    padding: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    user-select: none;
  }

  #log-container {
    z-index: 20;
    cursor: pointer;
    color: #c0c0c7;
    text-align: center;
    margin: 0 auto;
  }

  #log-container > * {
    border-radius: 4px;
  }

  #showThisWindow {
    background-color: rgba(0, 0, 30, 0.5);
    position: fixed;
    text-align: center;
    bottom: 5%;
    left: 5%;
    right: 5%;
    width: 90%;
    z-index: 10;
    padding: 1px 10px;
    font-size: 1.5rem;
  }

  #alertNoConnection {
    background-color: red;
    bottom: 0%;
    position: fixed;
    width: 100%;
    z-index: 10;
    margin: auto;
    max-height: 5%;
  }

  #nowPlaying {
    background-color: rgba(0, 0, 30, 0.5);
    position: fixed;
    text-align: center;
    top: 50%;
    left: 5%;
    width: 90%;
    z-index: 10;
    padding: 10px;
  }

  #nowPlaying h1 {
    margin: 0;
  }

  #logger {
    font-size: 1rem;
    text-align: left;
    overflow: auto;
    position: fixed;
    width: 90%;
    height: 20%;
    top: 65%;
    left: 5%;
    right: 5%;
    bottom: 20%;
    background-color: rgba(0, 0, 30, 0.5);
    white-space: normal;
    z-index: 10;
    padding: 10px;
  }

  #header h1 {
    margin-bottom: 0;
  }

  #header span {
    font-size: 4rem;
  }

  #login {
    display: none;
    position: absolute;
    height: 100%;
    width: 100%;
    color: #00001e;
  }

  #loader {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-30%, -50%);
    background-image: url('../assets/loader.gif');
    background-repeat: no-repeat;
  }

  
  /* ========= QR FULL PAGE LAYOUT ========= */
  #qrSection {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center; /* Center all items horizontally */
    padding: 2vh 8vw calc(2vh + 80px) 40vw; /* More left padding to push right */
    text-align: center;
    min-height: calc(100vh - 80px);
    gap: 1vh; /* Reduced gap to give more space for text */
  }
  
  /* Header - top section with fixed height */
  #qrHeader {
    font-size: clamp(28px, 8vh, 65px);
    font-weight: 700;
    color: #0d1a46;
    line-height: 1.1;
    flex: 0 0 18vh; /* Reduced height allocation */
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Prevent text overflow */
    text-overflow: ellipsis;
    width: auto; /* Allow natural text width */
    max-width: 80vw; /* Prevent text from going too wide */
  }
  
  /* QR code - center section with fixed height */
  #qrcode {
    flex: 0 0 45vh; /* Reduced height allocation for QR section */
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(45vmin, 350px); /* Fixed width for consistent alignment */
    height: min(45vmin, 350px);
    margin: 0;
    padding: 12px;            /* <-- add padding so QR has white border */
    background: #fff;        /* <-- white background to ensure contrast */
    border-radius: 10px;     /* <-- rounded corners */
    box-shadow: 0 8px 24px rgba(13,26,70,0.15); /* <-- subtle elevation */
    z-index: 20;             /* <-- keep QR above background elements */
    overflow: visible;
  }
  /* ensure the generated canvas/img fills the white card */
  #qrcode canvas,
  #qrcode img {
    width: 100% !important;
    height: 100% !important;
    display: block;
  }
  
  /* Footer - bottom section with fixed height */
  #qrFooter {
    font-size: clamp(20px, 6vh, 50px);
    color: #0d1a46;
    font-weight: 600;
    line-height: 1.3; /* Increased line height for better text spacing */
    flex: 0 0 25vh; /* Increased height allocation to prevent text cutoff */
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    overflow: visible; /* Allow text to show fully */
    width: auto; /* Allow natural text width */
    max-width: 80vw; /* Prevent text from going too wide */
  }
  
  /* ========= RESPONSIVE DESIGN ========= */
  
  /* Mobile Portrait */
  @media (max-width: 768px) and (orientation: portrait) {
    #qrSection {
      padding: 2vh 4vw calc(2vh + 80px) 20vw; /* Push right on mobile too */
      gap: 1vh;
      align-items: center; /* Center on mobile for better usability */
    }
    
    #qrHeader {
      font-size: clamp(24px, 7vh, 55px);
      flex: 0 0 16vh; /* Reduced height */
      width: auto; /* Allow natural text width */
      max-width: 90vw; /* Prevent text from going too wide on mobile */
    }
    
    #qrcode {
      flex: 0 0 40vh; /* Reduced height for QR section */
      width: min(60vmin, 300px);
      height: min(60vmin, 300px);
      margin: 0;
    }
    
    #qrFooter {
      font-size: clamp(18px, 5vh, 40px);
      flex: 0 0 22vh; /* Increased height to prevent text cutoff */
      overflow: visible;
      width: auto; /* Allow natural text width */
      max-width: 90vw; /* Prevent text from going too wide on mobile */
    }
  }
  
  /* Mobile Landscape */
  @media (max-width: 768px) and (orientation: landscape) {
    #qrSection {
      padding: 1vh 3vw calc(1vh + 80px) 25vw; /* Push right on landscape */
      gap: 1vh;
      align-items: center; /* Center on mobile landscape */
    }
    
    #qrHeader {
      font-size: clamp(20px, 6vh, 40px);
      flex: 0 0 12vh; /* Reduced height */
      width: auto; /* Allow natural text width */
      max-width: 85vw; /* Prevent text from going too wide on landscape */
    }
    
    #qrcode {
      flex: 0 0 35vh; /* Reduced height for QR section */
      width: min(40vmin, 250px);
      height: min(40vmin, 250px);
      margin: 0;
    }
    
    #qrFooter {
      font-size: clamp(16px, 4vh, 30px);
      flex: 0 0 18vh; /* Increased height to prevent text cutoff */
      overflow: visible;
      width: auto; /* Allow natural text width */
      max-width: 85vw; /* Prevent text from going too wide on landscape */
    }
  }
  
  /* Very small screens */
  @media (max-width: 480px) {
    #qrSection {
      padding: 2vh 3vw calc(2vh + 80px) 3vw;
    }
    
    .install-banner .banner-content {
      gap: 16px;
    }
    
    .install-banner .banner-title {
      font-size: 14px;
    }
    
    .install-banner .download-btn {
      padding: 6px 10px;
      font-size: 12px;
    }
  }

.fill {
  object-fit: fill;
}

.contain {
  object-fit: contain;
}

  /* ========= INSTALL BANNER ========= */
  .install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(90deg, #0d1a46, #1b2a5a, #22314f);
    color: #fff;
    padding: 12px 24px;
    font-family: 'Red Hat Display', sans-serif;
    box-shadow: 0 -2px 6px rgba(0,0,0,0.3);
    z-index: 1000;
  }
  
  .install-banner .banner-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
  }
  
  .install-banner .banner-title {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
  }
  
  .install-banner .download-buttons {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
  }
  
  .install-banner .download-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
    color: #fff;
    white-space: nowrap;
  }
  
  .install-banner .download-btn i {
    font-size: 16px;
    margin-right: 4px;
  }
  
  .install-banner .download-btn:hover {
    transform: translateY(-2px);
  }
  
  .windows-btn { background: #0078d7; }
  .windows-btn:hover { background: #005ea3; }
  
  .playstore-btn { background: #34a853; }
  .playstore-btn:hover { background: #2a8643; }
  
  .linux-btn { background: #ffb400; color: #000; }
  .linux-btn:hover { background: #e09e00; }