/* ===== YHW Anti-Cheat Monitor v1.1 ===== */

/* Overlay che toàn trang - content vẫn render bình thường phía sau
   Shortcode YHW Quiz hoạt động bình thường, chỉ bị che về mặt thị giác */
#yhw-ac-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Arial, sans-serif;
}

#yhw-ac-overlay.hidden { display: none !important; }

#yhw-ac-gate-box {
    background: #fff;
    border-radius: 16px;
    padding: 40px 36px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    text-align: center;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

#yhw-ac-gate-box .yhw-lock-icon { font-size: 48px; margin-bottom: 12px; }

#yhw-ac-gate-box h2 {
    margin: 0 0 8px;
    font-size: 20px;
    color: #1a1a2e;
    line-height: 1.4;
}

#yhw-ac-gate-box p {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.6;
}

#yhw-ac-gate-box input[type="email"],
#yhw-ac-gate-box input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    margin-bottom: 10px;
    box-sizing: border-box;
    transition: border-color 0.2s;
    outline: none;
}

#yhw-ac-gate-box input:focus { border-color: #0f3460; }

#yhw-ac-gate-box button {
    width: 100%;
    padding: 13px;
    background: linear-gradient(90deg, #0f3460, #533483);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    margin-top: 4px;
}

#yhw-ac-gate-box button:hover { opacity: 0.9; }
#yhw-ac-gate-box button:active { transform: scale(0.98); }

#yhw-ac-gate-error {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 10px;
    display: none;
}

/* ===== TOPBAR fixed trên cùng sau khi start ===== */
#yhw-ac-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 99998;
    background: linear-gradient(90deg, #1a1a2e, #0f3460);
    color: #fff;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
    font-family: 'Segoe UI', Arial, sans-serif;
}

body.yhw-ac-active { padding-top: 52px !important; }

#yhw-ac-topbar .yhw-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

#yhw-ac-topbar .yhw-session-info { font-size: 14px; opacity: 0.9; }

#yhw-ac-topbar .yhw-user-badge {
    background: rgba(255,255,255,0.15);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 13px;
}

#yhw-ac-violation-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.12);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
}

#yhw-ac-violation-counter.danger {
    background: #e74c3c;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.65; }
}

#yhw-ac-vcount { font-size: 18px; font-weight: 700; }
#yhw-ac-timer { font-size: 14px; opacity: 0.85; }

/* ===== WARNING MODAL ===== */
#yhw-ac-warning-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999999;
    background: rgba(0,0,0,0.75);
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Arial, sans-serif;
}

#yhw-ac-warning-modal.show {
    display: flex;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

#yhw-ac-warning-box {
    background: #fff;
    border-radius: 14px;
    padding: 36px 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from { transform: scale(0.7); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

#yhw-ac-warning-box .warn-icon { font-size: 52px; margin-bottom: 12px; }

#yhw-ac-warning-box h3 { margin: 0 0 10px; font-size: 20px; color: #e74c3c; }

#yhw-ac-warning-box p {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

#yhw-ac-warning-box .warn-count-badge {
    display: inline-block;
    background: #e74c3c;
    color: #fff;
    border-radius: 20px;
    padding: 4px 16px;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 16px;
}

#yhw-ac-warning-box button {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

#yhw-ac-warning-box button:hover { opacity: 0.85; }

/* ===== SUBMIT SECTION ===== */
#yhw-ac-submit-section {
    text-align: center;
    padding: 20px 16px;
    margin-top: 16px;
    margin-bottom: 16px;
    border-top: 2px solid #eee;
    background: #f9f9f9;
    border-radius: 12px;
}

#yhw-ac-submit-btn {
    background: linear-gradient(90deg, #27ae60, #2ecc71);
    color: #fff;
    border: none;
    padding: 14px 40px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

#yhw-ac-submit-btn:hover { opacity: 0.9; }
#yhw-ac-submit-btn:active { transform: scale(0.98); }
#yhw-ac-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

#yhw-ac-submit-status {
    margin-top: 12px;
    font-size: 14px;
    display: none;
    font-family: 'Segoe UI', Arial, sans-serif;
}

/* ===== REMAINING WARNING ===== */
#yhw-ac-warn-remaining {
    display: inline-block;
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
}

/* ===== SCHEDULE LOCK SCREEN ===== */
#yhw-ac-schedule-box {
    background: #fff;
    border-radius: 16px;
    padding: 40px 36px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    text-align: center;
    animation: slideUp 0.4s ease;
}

#yhw-ac-schedule-box h2 {
    margin: 0 0 8px;
    font-size: 20px;
    color: #1a1a2e;
    line-height: 1.4;
}

#yhw-ac-schedule-box p {
    color: #555;
    font-size: 14px;
    margin: 8px 0;
    line-height: 1.6;
}

#yhw-ac-countdown {
    background: #1565c0;
    color: #ffffff;
    border-radius: 10px;
    padding: 10px 24px;
    display: inline-block;
    margin: 12px 0;
    font-size: 30px;
    font-weight: 900;
    letter-spacing: 3px;
    font-family: 'Courier New', monospace;
    box-shadow: 0 4px 15px rgba(21,101,192,0.35);
    text-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
