/* ===================== GENERAL ===================== */
body, html {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    min-height: 100vh;
    width: 100vw;
    background: url('/static/background.png') center center fixed no-repeat;
    background-size: cover;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* ===================== HEADER ===================== */
.header-box {
    background-color: purple;
    color: white;
    width: 100vw;
    text-align: center;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
    box-sizing: border-box;
    padding: 18px 0 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 110px;
}

.header-box h1 {
    margin: 0 0 10px 0;
    font-size: 22px;
    color: #fff;
    letter-spacing: 1px;
}

/* ===================== ADMIN MENU ===================== */
.admin-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 8px;
    width: 100vw;
    box-sizing: border-box;
}

.admin-btn {
    background: #fff;
    color: purple;
    border-radius: 6px;
    padding: 8px 18px;
    text-decoration: none;
    font-weight: bold;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: background 0.2s, color 0.2s;
    font-size: 16px;
    min-width: 100px;
    max-width: 180px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-btn.green { background: #4caf50; color: #fff; }
.admin-btn.red { background: #f44336; color: #fff; }
.admin-btn.orange { background: orange; color: #fff; }
.admin-btn:hover {
    background: purple;
    color: #fff;
}

/* ===================== CONTAINERS ===================== */
.admin-container, .konfirmasi-container, .form-container, .login-container {
    width: 98vw;
    max-width: 1200px;
    min-width: 320px;
    margin: 0 auto 40px auto;
    padding: 140px 16px 40px 16px; /* padding-top cukup besar agar tidak tertimpa header */
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    text-align: center;
    position: relative;
    box-sizing: border-box;
    overflow-x: auto;
    min-height: 400px;
}

/* ===================== TABLES ===================== */
table {
    width: 100%;
    overflow-x: auto;
    display: block;
    font-size: 16px;
}
.admin-container th, .admin-container td {
    border: 1px solid #e0e0e0;
    padding: 14px 10px;
    text-align: center;
}
.admin-container th {
    background: #f2e9fa;
    color: #4b006e;
    font-weight: bold;
}
.admin-container tr:nth-child(even) {
    background: #faf6ff;
}
.admin-container tr:hover {
    background: #f5e3ff;
}

/* ===================== ACTION BUTTONS ===================== */
.admin-actions, .action-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 18px 0 0 0;
    align-items: center;
}
.action-btn {
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    background-color: purple;
    color: #fff;
    border: none;
    margin: 6px 8px;
    min-width: 100px;
    text-align: center;
    transition: background 0.2s;
    text-decoration: none;
    display: inline-block;
}
.action-btn.green { background: #4caf50; }
.action-btn.red { background: #f44336; }
.action-btn.orange { background: orange; }
.action-btn:hover {
    background: #4b006e;
    color: #fff;
}

/* ===================== FORMS ===================== */
.admin-container form, .form-container form, .konfirmasi-container form {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 30px auto;
    text-align: left;
}
.admin-container label, .form-group label, .form-group h2 {
    display: block;
    font-size: 18px;
    margin: 18px 0 6px 0;
    color: #4b006e;
    font-weight: bold;
}
.admin-container input,
.admin-container select,
.form-group input,
.form-group select,
.input-field {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border-radius: 6px;
    border: 1px solid #ccc;
    margin-bottom: 14px;
    box-sizing: border-box;
}
.admin-container input[type="file"], .input-file {
    padding: 8px;
    background: #f8f8f8;
}
.form-group {
    margin-bottom: 24px;
    text-align: left;
}
.hidden {
    display: none;
}

/* ===================== SELFIE PREVIEW ===================== */
.selfie-preview {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}
.selfie-container {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto;
    background: #eee;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
#video, #canvas, #selfie-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===================== FILE PREVIEW ===================== */
.file-preview {
    display: block;
    margin: 10px auto 0 auto;
    max-width: 120px;
    max-height: 120px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #ccc;
}

/* ===================== SWITCH ===================== */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}
.switch input {display:none;}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: #2196F3;
}
input:checked + .slider:before {
    transform: translateX(26px);
}

/* ===================== POPUP ===================== */
#popup-flash {
  position: fixed;
  top: 30px;
  right: 30px;
  z-index: 9999;
}
.popup-message {
  display: flex;
  align-items: center;
  background: #fffbe6;
  color: #333;
  border: 1px solid #ffe58f;
  border-radius: 6px;
  padding: 16px 24px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  font-size: 16px;
  min-width: 220px;
  max-width: 350px;
  animation: fadeIn 0.5s;
  position: relative;
}
.popup-message.success { border-color: #b7eb8f; background: #f6ffed; }
.popup-message.error { border-color: #ffa39e; background: #fff1f0; }
.popup-message.warning { border-color: #faad14; background: #fffbe6; }
.popup-close {
  margin-left: 16px;
  font-size: 22px;
  font-weight: bold;
  color: #888;
  cursor: pointer;
  background: none;
  border: none;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.alert-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.3);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.alert-modal-content {
  background: #fff;
  padding: 32px 24px;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  text-align: center;
  min-width: 260px;
  max-width: 90vw;
}
#alert-modal-ok {
  margin-top: 18px;
  padding: 8px 24px;
  font-size: 16px;
  border-radius: 6px;
  background: #1890ff;
  color: #fff;
  border: none;
  cursor: pointer;
}
/* ===================== STATUS BOX ===================== */
.status-box {
    margin-top: 18px;
    font-size: 18px;
    font-weight: bold;
}
.status-belum {
    color: #f44336;
    font-weight: bold;
}
.status-sudah {
    color: #4caf50;
    font-weight: bold;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
    .header-box { min-height: 90px; padding: 12px 0 0 0; }
    .header-box h1 { font-size: 22px; }
    .admin-menu { gap: 8px; }
    .admin-btn { font-size: 14px; padding: 7px 10px; min-width: 80px; max-width: 120px; }
    .admin-container, .konfirmasi-container, .form-container, .login-container {
        padding-top: 120px;
        padding-bottom: 18px;
        margin-top: 0;
        max-width: 98vw;
    }
    table { font-size: 13px; }
    .admin-container form { max-width: 98vw; }
    .form-group label, .form-group h2 { font-size: 15px; }
}

@media (max-width: 600px) {
    .header-box { min-height: 70px; padding: 8px 0 0 0; }
    .header-box h1 { font-size: 29px; }
    .admin-menu { gap: 6px; }
    .admin-btn, .action-btn {
        min-width: 60px;
        max-width: 90px;
        font-size: 11px;
        padding: 5px 6px;
    }
    .admin-container, .konfirmasi-container, .form-container, .login-container {
        padding-top: 90px;
        padding-bottom: 12px;
        margin-top: 0;
        max-width: 98vw;
    }
    .form-group input, .form-group select {
        width: 90%;
        font-size: 13px;
    }
    .file-preview {
        max-width: 60px;
        max-height: 60px;
    }
    .status-box { font-size: 13px; }
    .selfie-container {
        width: 90vw;
        height: 90vw;
        max-width: 180px;
        max-height: 180px;
    }
    h1 { font-size: 22px; }
}