/* --------------------------------------------------
   GLOBAL BASE STYLES
-------------------------------------------------- */
body {
    font-family: "Poppins", sans-serif;
    background: linear-gradient(135deg, #f2f2f2, #e0e0e0);
    margin: 0;
}

input {
    box-sizing: border-box;
}

/* Unified heading style */
h2 {
    color: #fa8072;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    padding-left: 10px;
    text-align: left;
    padding-bottom: 15px;
}

/* Unified heading style */
h3 {
    color: #fa8072;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-left: 10px;
    text-align: left;
    padding-bottom: 15px;
}

.successText {
    color: #1758cf;
    font-size: 1.2rem;
    text-align: left;
    padding-left: 15px;
}

/* --------------------------------------------------
   HEADER
-------------------------------------------------- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
}

.site-title {
    margin: 0;
    font-size: 1.8rem;
    font-weight: bold;
}

.site-title a {
    text-decoration: none;
    color: inherit;
}

.site-title a:hover {
    opacity: 0.8;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.hamburger {
    font-size: 1.8rem;
    cursor: pointer;
    user-select: none;
}

/* Dropdown */
.dropdown-menu {
    position: absolute;
    top: 60px;
    right: 20px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 0;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    color: #333;
}

.dropdown-menu a:hover {
    background: #f5f5f5;

}

/* Server status box */
.server-status {
  padding: 5px 12px;
  border-radius: 4px;
  font-weight: bold;
  text-align: center;
  min-width: 120px; /* keeps box consistent */
}

/* Connected state */
.server-status.ok {
  background-color: green;
  color: white;
}

/* Disconnected state */
.server-status.disconnected {
  background-color: red;
  color: white;
}


/* --------------------------------------------------
   LOGIN PAGE
-------------------------------------------------- */
.login-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-box {
    width: 350px;
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.login-link {
    display: inline-block;
    background: #fff;
    border-radius: 12px;
    padding: 3px 12px;
    margin: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    width: 320px;
    text-align: center;
}

/* Login inputs */
input[type="text"],
input[type="password"],
input[type="email"] {
    width: 100%;
    padding: 0.7rem;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    background-color: #fafafa;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
    border-color: #fa8072;
    background-color: #fff;
    outline: none;
}

/* Submit button */
input[type="submit"].login {
    width: 100%;
    background-color: #fa8072;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.8rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

/* Register link */
a.register {
    display: inline-block;
    margin-top: 1rem;
    margin-bottom: 1rem;
    color: #666;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

a.register:hover {
    color: #fa8072;
}

/* Responsive */
@media (max-width: 400px) {
    form {
        width: 85%;
        padding: 1.5rem;
    }
}

/* --------------------------------------------------
   VIDEO PLAYER + DYNAMIC ELEMENTS
-------------------------------------------------- */
.dynamic-container video {
    width: 75vw;
    height: auto;
}

.dynamic-container button {
    width: 100px;
    background-color: #3621f3;
    color: white;
}

#videoContainer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
}

/* Debug text box */
.dynamic-text {
    width: 95%;
    height: 50px;
    margin: 0 auto;
    overflow: auto;
    border: 2px solid #333;
    border-radius: 5px;
    background-color: #f0f0f0;
    box-sizing: border-box;
}

.dynamic-text ul {
    list-style-type: none;
    padding: 5px;
    margin: 0;
    text-align: left;
}

/* --------------------------------------------------
   TEXT BOX GROUPS (Refactored for simplified JS)
-------------------------------------------------- */

.groupContainer {
  display: flex;
  flex-direction: column;   /* stack groups vertically */
  gap: 18px;
}

/* Each compound group row */
.wrapperDiv {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;

  padding: 15px 18px;
  border-radius: 6px;
  border: 3px solid #ccc;
  background-color: #fafafa;

  /* No spinner → no relative positioning needed */
}

/* Inner wrapper holds: [button] [textBoxes] */
.innerWrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
}

/* Container for the two text boxes */
.textBoxes {
  display: flex;
  flex-direction: row;
  gap: 10px;
  flex: 1;                  /* expand to fill remaining space */
}

/* Individual text boxes */
.textBoxGroup {
  flex: 1;
  padding: 12px 16px;       /* scaled up */
  border: 2px solid #333;
  border-radius: 6px;

  background-color: #f0f0f0;
  text-align: center;

  font-size: 1.05rem;       /* slightly larger text */
  font-weight: 500;
}


/* Play button: fixed 25% width */
.triggerButton {
  width: 25%;                /* ← requested width */
  min-width: 120px;          /* prevents collapsing on small screens */
  height: 100%;              /* matches scaled row height */

  padding: 12px 16px;
  border-radius: 6px;
  border: 1px solid #333;

  background-color: #fa8072;
  color: rgba(255,255,255,0.9);

  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 600;
}



.triggerButton:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --------------------------------------------------
   VIDEO UPLOAD FORM
-------------------------------------------------- */
.form-container {
    width: 50%;
    margin: 0 auto;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #f9f9f9;
}

.form-container form div {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-container label {
    margin: 0;
    font-weight: bold;
}

/* Base input style for upload form */
.form-container input {
    padding: 6px;
    font-size: 1rem;
    height: 36px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

/* Special-case inputs */
.form-container input[type="file"],
.form-container input[type="date"],
.form-container input[type="time"] {
    padding: 4px 6px;
    border: 1px solid #ccc;
    /* box-shadow: 0 0 0 1px #4a90e2; */
    height: 36px;
    border-radius: 6px;
}

.form-container button {
    padding: 8px 14px;
    font-size: 1rem;
    cursor: pointer;
}

.form-container input:focus {
    border: 2px solid #fa8072;
    box-shadow: none;
    outline: none;
}

/* Normal upload button */
.upload-button {
    padding: 10px 20px;
    background-color: #2a7ae2;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 4px;
}

/* Hover state */
.upload-button:hover:not(.upload-disabled) {
    background-color: #1f5fb8;
}

/* Disabled state */
.upload-disabled {
    background-color: #9bbce3;
    cursor: not-allowed;
    opacity: 0.6;
}


/* Progress bar container */
.progress-container {
    width: 100%;
    background-color: #ddd;
    height: 20px;
    margin-top: 20px;
    border-radius: 4px;
    overflow: hidden;
}

/* Actual progress bar */
.progress-bar {
    width: 0%;
    height: 100%;
    background-color: #28a745;
    transition: width 0.2s ease;
}

.wrapperDiv {
    position: relative; /* spinner anchors here */
}

/* Ensures the video stays inside the compound group */
.videoPlayer {
    width: 100%;          /* fill the innerWrapper width */
    max-width: 100%;      /* prevent overflow */
    height: auto;         /* maintain aspect ratio */
    display: block;       /* avoid inline spacing issues */
    border-radius: 6px;   /* optional, matches your group styling */
}

.errorMessage {
    color: #1e4dd8;          /* blue */
    font-weight: bold;       /* bold text */
    text-align: center;      /* centered */
    padding: 10px 15px;
    margin: 10px auto;
    background-color: #e8f0ff; /* soft blue background */
    border: 1px solid #b5c8ff;
    border-radius: 6px;
    width: fit-content;
    max-width: 80%;
}

.successMessage {
    color: #1e4dd8;          /* blue */
    font-weight: bold;       /* bold text */
    text-align: center;      /* centered */
    padding: 10px 15px;
    margin: 10px auto;
    background-color: #e8f0ff; /* soft blue background */
    border: 1px solid #b5c8ff;
    border-radius: 6px;
    width: fit-content;
    max-width: 80%;
}

.standard-link {

    color: black; 
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-left: 10px;
    text-align: left;
    padding-bottom: 15px;

}

#convertProgressContainer {
    width: 100%;
    height: 20px;
    background: #ddd;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 10px;
}

#convertProgressBar {
    height: 100%;
    width: 0%;
    background: #fa8072;
    transition: width 0.2s ease;
}

/* Wrapper that enables horizontal scrolling */
.admin-table-wrapper {
    width: 100%;
    overflow-x: auto;      /* enables horizontal scroll */
    overflow-y: hidden;
    margin-left: 10px;     /* keep your indent */
    padding-bottom: 12px; 
}

/* Admin user table styling */
.admin-user-table {
    border-collapse: collapse;
    margin-left: 10px;
    min-width: 800px;  
    width: auto;
}

.admin-user-table th,
.admin-user-table td {
    border: 1px solid #ccc;
    padding: 8px 12px;
    text-align: left;
}

.admin-user-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.admin-user-table tr:nth-child(even) {
    background-color: #fafafa;
}

.admin-user-table select {
    padding: 4px;
}

.save-user-btn {
    padding: 4px 10px;
    cursor: pointer;
}

.delete-user-btn {
    padding: 4px 10px;
    background-color: #d9534f;
    color: white;
    border: none;
    cursor: pointer;
}

.delete-user-btn:hover {
    background-color: #c9302c;
}


