/* ===== POINTS PAGE ===== */

.profile-award-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
}

.profile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.profile-picture {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin-right: 10px;
}

.profile-name {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-primary);
}

.award-icon-wrapper {
    position: relative;
    display: inline-block;
}

.award-icon {
    width: 70px;
    height: 70px;
}

.award-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.award-text {
    position: absolute;
    top: 15px;
    left: 20px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: bold;
    border-radius: 50%;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.award-label {
    text-align: center;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: bold;
}


.floating-button {
    position: fixed;
    /* ทำให้ปุ่มลอยอยู่บนสุดและไม่เลื่อนตามหน้า */
    bottom: 90px;
    /* ระยะห่างจากขอบล่าง */
    right: 25px;
    /* ระยะห่างจากขอบขวา */
    z-index: 1000;
    /* ทำให้ปุ่มอยู่บนสุด */
}

.floating-button button {
    touch-action: manipulation;
    width: 55px;
    /* ความกว้างของปุ่ม */
    height: 55px;
    /* ความสูงของปุ่ม */
    border-radius: 50%;
    /* ทำให้ปุ่มเป็นวงกลม */
    background-color: var(--theme-color);
    /* ใช้สีเน้น */
    color: white;
    /* สีข้อความ */
    border: none;
    /* ไม่มีขอบ */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    /* เพิ่มเงาให้ปุ่ม */
    font-size: 24px;
    /* ขนาดข้อความ */
    cursor: pointer;
    /* เปลี่ยนเคอร์เซอร์เมื่อชี้ที่ปุ่ม */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.floating-button button.pressed {
    background-color: var(--theme-color-hover);
    /* สีเมื่อกดปุ่ม */
}

/* ฉากหลังเต็มจอ */
.qr-reader {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;

    display: none;
    /* เปิดตอนเริ่มสแกน */
}

/* ปุ่มปิด */
.close-btn {
    position: absolute;
    top: 12px;
    right: 12px;

    width: 36px;
    height: 36px;
    padding: 0;

    border-radius: 50%;
    border: none;
    background: red;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
}

.close-btn img {
    width: 70%;
    height: 70%;
    object-fit: contain;
    pointer-events: none;
    /* กันเผลอกดโดนรูป */
}


/* จัดทุกอย่างให้อยู่กลางจอ */
.camera-wrapper {
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;
}

/* กล่องสี่เหลี่ยมจตุรัส */
.camera-square {
    position: relative;
    width: 80vw;
    max-width: 360px;
    height: 80vw;
    max-height: 360px;
}


/* video ต้องเต็มกรอบ */
#qr-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* overlay ซ้อนบน video */
.scan-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;

    display: flex;
    align-items: center;
    justify-content: center;
}

/* กรอบสแกน = เท่ากับ video */
.scan-box {
    position: relative;
    width: 100%;
    height: 100%;
}

/* มุมกรอบ */
.corner {
    position: absolute;
    width: 28px;
    height: 28px;
    border: 4px solid #00ff88;
}

.corner.tl {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
}

.corner.tr {
    top: 0;
    right: 0;
    border-left: none;
    border-bottom: none;
}

.corner.bl {
    bottom: 0;
    left: 0;
    border-right: none;
    border-top: none;
}

.corner.br {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
}

/* เส้นสแกน */
.scan-line {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 2px;
    background: #ff0000;
    animation: scan-move 1s ease-in-out infinite alternate;
}

@keyframes scan-move {
    from {
        top: 0;
    }

    to {
        top: calc(100% - 2px);
    }
}