/* ===== GLOBAL ===== */
body {
    margin: 0;
    padding: 0;
    background: radial-gradient(
        circle at 50% 230px,   /* vị trí ánh sáng */
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.02) 30%,
        rgba(0, 0, 0, 0.85) 70%,
        #000 100%
    );
    background-color: #000;
    background-attachment: fixed;
    color: #fff;
    font-family: "Arial", sans-serif;
    text-align: center;
}


/* Container */
.container {
    width: 100%;
    max-width: 1100px;
    margin: auto;
    padding: 20px;
}

/* ===== PROFILE SECTION ===== */
.profile {
    margin-top: 40px;
}

/* Avatar — Style Nguyễn Thành Sơn */
.avatar {
    width: 150px;
    height: 150px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;

    /* Glass + border trắng nhẹ */
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(6px);
    border: 3px solid rgba(255,255,255,0.4);

    /* Bóng mềm bên ngoài + bóng nhẹ bên trong */
    box-shadow:
        0 6px 15px rgba(0,0,0,0.55),
        inset 0 0 8px rgba(255,255,255,0.18);

    display: flex;
    align-items: center;
    justify-content: center;

    transition: 0.25s ease;
}

/* Avatar image */
.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Hover rất nhẹ — đúng style Sơn */
.avatar:hover {
    transform: translateY(-4px);
    box-shadow:
        0 10px 22px rgba(0,0,0,0.65),
        inset 0 0 12px rgba(255,255,255,0.25);
}

.profile h1 {
    margin-top: 18px;
    font-size: 32px;
}

.bio {
    margin-top: -5px;
    opacity: 0.8;
    font-size: 15px;
}


/* ===== THEME BUTTON ===== */
.theme-toggle {
    margin-top: 15px;
    padding: 8px 22px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.22);
    color: #fff;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    backdrop-filter: blur(5px);
    transition: 0.25s ease;
}

.theme-toggle:hover {
    background: rgba(255,255,255,0.22);
    transform: translateY(-2px);
}

/* =========================
     4 CARD NGANG GIỐNG CŨ
========================= */
.links {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    flex-wrap: nowrap; /* ép 4 thằng nằm ngang */
}

/* CARD – giữ style cũ */
.card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.15);
    padding: 25px;
    border-radius: 20px;
    width: 250px;
    text-align: center;

    transition: 0.25s ease;
    box-shadow: 0 0 15px rgba(0,0,0,0.4);
}

/* =========================
    CARD 3D GLOW HOVER
========================= */
.card:hover {
    background: rgba(255,255,255,0.08);
    transform: translateY(-6px) scale(1.04) rotateX(6deg) rotateY(6deg);
    box-shadow:
        0 0 15px rgba(0,153,255,0.4),
        0 0 25px rgba(0,153,255,0.25),
        0 0 40px rgba(0,153,255,0.20);
}

/* LINK */
.card-link {
    color: #3399ff;
    font-weight: bold;
    text-decoration: none;
}
.card-link:hover {
    text-decoration: underline;
}

/* =========================
      RESPONSIVE
========================= */
@media (max-width: 1100px) {
    .links {
        flex-wrap: wrap;   /* cho mobile tự xuống hàng */
    }
}


/* ============================
   UID TOOL WRAPPER (CARD)
============================ */

#uid-tool {
    width: 95%;
    max-width: 750px;
    margin: 30px auto;
    padding: 26px 24px;

    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;

    backdrop-filter: blur(10px);
    box-shadow: 0 6px 22px rgba(0,0,0,0.35);

    display: none;
}

/* Tiêu đề nằm giữa, đậm và sáng */
#uid-tool h3 {
    text-align: center;
    font-size: 20px;
    margin-bottom: 18px;
    color: #fff;
    letter-spacing: .5px;
}

/* Input + Button */
#uid-tool .tool-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Input giữ style đẹp */
#uid-tool #fbInput {
    flex: 1;
    padding: 12px 14px;

    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.06);
    color: #fff;
    font-size: 14px;

    transition: 0.25s;
}

#uid-tool #fbInput:focus {
    background: rgba(255,255,255,0.12);
    border-color: #3aa0ff;
    box-shadow: 0 0 10px rgba(0,132,255,0.45);
}

/* Button */
#uid-tool #checkBtn {
    padding: 12px 18px;
    border-radius: 10px;
    border: none;

    background: linear-gradient(135deg,#2c89ff,#43a8ff);
    color: #fff;

    font-size: 15px;
    font-weight: 600;
    cursor: pointer;

    transition: 0.25s;
}

#uid-tool #checkBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,132,255,0.45);
}

/* KẾT QUẢ */
#uid-tool #result {
    margin-top: 16px;
    padding: 12px 12px;

    width: 100%;
    border-radius: 10px;

    color: #f0f0f0;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);

    text-align: center;
    font-size: 15px;
}

/* Ẩn hoàn toàn khi rỗng */
#uid-tool #result:empty {
    display: none;
}


/* ===== FOOTER ===== */
footer {
    margin-top: 40px;
    padding: 20px 0;
    text-align: center;
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    border-top: 1px solid rgba(255,255,255,0.12);
}

/* ===== LIGHT MODE ===== */
body.light {
    background: #f1f1f1;
    color: #000;
}

body.light .card {
    background: #fff;
    border-color: #ddd;
    color: #000;
}

body.light .tool {
    background: #fff;
    border-color: #ddd;
    color: #000;
}

body.light footer {
    color: #555;
}

body.light .theme-toggle {
    background: #ddd;
    border-color: #bbb;
    color: #000;
}

body.light .card-link {
    color: #0066cc;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .avatar {
        width: 120px;
        height: 120px;
    }
    .card {
        width: 90%;
    }
}

@media (max-width: 480px) {
    .avatar {
        width: 110px;
        height: 110px;
    }
    .card {
        width: 100%;
    }
}

/* ==== AVATAR WITH CUSTOM FRAME ==== */

.avatar-frame {
    position: relative;
    width: 230px;              /* khung */
    height: 230px;
    margin: 0 auto;
}

.frame-img {
    width: 230px;
    height: 230px;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    animation: frameFloat 4s ease-in-out infinite;
}

/* hiệu ứng khung nhấp nhô nhẹ */
@keyframes frameFloat {
    0% { transform: scale(1) translateY(0px); }
    50% { transform: scale(1.02) translateY(-4px); }
    100% { transform: scale(1) translateY(0px); }
}


/* =============================
   AVATAR + FRAME (PERFECT MATCH)
============================= */

.avatar-forest-wrap {
    position: relative;
    width: 260px;        /* khung to */
    height: 260px;
    margin: 0 auto;
}

/* Avatar nhỏ hơn khung */
.avatar-base {
    position: absolute;
    top: 50%;
    left: 50%;

    width: 170px;        /* chỉnh nhỏ avatar */
    height: 170px;

    transform: translate(-50%, -50%);
    border-radius: 50%;
    object-fit: cover;

    z-index: 3;
    transition: filter .25s ease;
}

/* Khung rễ */
.avatar-frame {
    position: absolute;
    width: 300px;     /* to hơn 1 chút (từ 240 → 260px) */
    height: 300px;
    top: -15px;        /* đẩy khung lên */
    left: -19px;      /* đẩy khung qua phải */
    object-fit: contain;
    pointer-events: none;
    z-index: 5;
    transition: filter .25s ease;
}


/* Hover: sáng nhẹ */
.avatar-forest-wrap:hover .avatar-base,
.avatar-forest-wrap:hover .avatar-frame {
    filter: brightness(1.12);
}



/* =======================================================
      AURA — Glow mềm, mịn, hòa nền (không thô)
======================================================= */
.aura {
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    /* Glow mờ hơn, loang nhẹ */
    background: radial-gradient(
        rgba(0, 255, 200, 0.12),
        rgba(0, 255, 200, 0.06) 40%,
        rgba(0, 0, 0, 0) 80%
    );

    filter: blur(35px);
    opacity: 0.45;

    animation: auraPulse 6s ease-in-out infinite;
    z-index: 1;
}

@keyframes auraPulse {
    0%   { transform: translate(-50%, -50%) scale(1);    opacity: .35; }
    50%  { transform: translate(-50%, -50%) scale(1.18); opacity: .55; }
    100% { transform: translate(-50%, -50%) scale(1);    opacity: .35; }
}



/* =======================================================
      SPARK — Hạt năng lượng bay trong avatar
======================================================= */
@keyframes sparkFloat {
    0%   { transform: translate(0, 0) scale(.3); opacity: 0; }
    20%  { opacity: .8; }
    60%  { transform: translate(-12px, -40px) scale(1); opacity: 1; }
    100% { transform: translate(10px, -65px) scale(.4); opacity: 0; }
}

.spark {
    position: absolute;
    width: 7px;
    height: 7px;
    background: rgba(0, 255, 200, 0.95);
    border-radius: 50%;
    filter: blur(2px);
    z-index: 5;
    opacity: 0;
    animation: sparkFloat 3.6s linear infinite;
}

/* ===== 10 SPARK POSITIONS — phủ đều khu vực avatar ===== */
.spark.s1  { left: 42%; top: 55%; animation-delay: 0.0s; }
.spark.s2  { left: 50%; top: 48%; animation-delay: 0.3s; }
.spark.s3  { left: 58%; top: 60%; animation-delay: 0.6s; }
.spark.s4  { left: 35%; top: 50%; animation-delay: 0.9s; }

.spark.s5  { left: 45%; top: 65%; animation-delay: 1.2s; }
.spark.s6  { left: 55%; top: 70%; animation-delay: 1.5s; }
.spark.s7  { left: 52%; top: 40%; animation-delay: 1.8s; }

.spark.s8  { left: 62%; top: 53%; animation-delay: 2.1s; }
.spark.s9  { left: 38%; top: 58%; animation-delay: 2.4s; }
.spark.s10 { left: 47%; top: 44%; animation-delay: 2.7s; }

/* =============================
   TEXT (Glow nhẹ)
============================= */
.profile h1 {
    margin-top: 10px;
    font-size: 32px;
    color: #ffffff;
    text-shadow:
        0 0 4px rgba(255,255,255,0.5),
        0 0 10px rgba(255,255,255,0.65),
        0 0 18px rgba(255,255,255,0.2);
}

.bio {
    margin-top: -6px;
    font-size: 15px;
    color: #dcdcdc;
    opacity: 0.9;

    text-shadow:
        0 0 3px rgba(255,255,255,0.35),
        0 0 6px rgba(255,255,255,0.2);
}

/* Nút Dark mode */
.theme-toggle {
    margin-top: 12px;
}

/* ==============================
   FIX: CREATE-WEB FORM (vertical)
=================================*/

/* Giữ nguyên khung tool */
#create-web {
    max-width: 620px;
    margin: 28px auto;
    padding: 22px;
    box-sizing: border-box;
}

/* Xếp dọc, căn trái label, full-width input */
#create-web .tool-row.vertical {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
}

/* Label */
#create-web .tool-row.vertical label {
    display: block;
    width: 100%;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    color: #e8e8e8;
    margin-bottom: 4px;
    padding-left: 2px;
}

/* Input */
#create-web .tool-row.vertical input {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 12px;

    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.04);

    color: #fff;
    font-size: 14px;

    transition: 0.22s ease;
}

/* Focus */
#create-web .tool-row.vertical input:focus {
    background: rgba(255,255,255,0.12);
    border-color: #3aa0ff;
    box-shadow: 0 0 10px rgba(0,132,255,0.40);
}

/* Nút submit */
#create-web #cw_submit {
    display: block;
    width: 180px;

    padding: 10px 20px;
    margin: 6px auto 0;

    border: none;
    border-radius: 12px;

    background: linear-gradient(135deg,#2c89ff,#43a8ff);
    color: #fff;

    font-size: 15px;
    font-weight: 600;

    cursor: pointer;
    transition: 0.22s ease;
}

#create-web #cw_submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(67,168,255,0.25);
}

/* Hộp kết quả */
#create-web #cw_result {
    margin-top: 16px;
    padding: 12px 18px;

    width: 100%;
    box-sizing: border-box;

    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);

    text-align: center;
    font-size: 14px;
    color: #f0f0f0;

    display: none;
}

/* ============================
   🟥 ERROR / SUCCESS MESSAGE
============================ */

.result {
    padding: 12px 18px;
    width: 100%;
    border-radius: 12px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    backdrop-filter: blur(6px);
    box-sizing: border-box;
}

/* Lỗi */
.result.error {
    background: rgba(255,50,50,0.15);
    border: 1px solid rgba(255,80,80,0.25);
    color: #ff7a7a;
}

/* Thành công */
.result.success {
    background: rgba(0,255,180,0.12);
    border: 1px solid rgba(0,255,200,0.25);
    color: #76ffe2;
}

/* Icon */
.result i {
    font-style: normal;
    font-size: 18px;
    font-weight: bold;
}

/* ============================
   LIGHT MODE SUPPORT
============================ */

body.light #create-web .tool-row.vertical input {
    background: #fff;
    color: #000;
    border-color: #ccc;
}

body.light #cw_result {
    background: #fff;
    color: #000;
    border-color: #ddd;
}

body.light #cw_submit {
    background: linear-gradient(135deg,#3385ff,#66a3ff);
    color: #fff;
}

/* ============================
   MOBILE
============================ */

@media (max-width: 720px) {
    #create-web {
        padding: 16px;
    }
    #create-web #cw_submit {
        width: 70%;
    }
}

/* ============================
   UID SUCCESS LAYOUT
============================ */

.uid-success-box {
    display: flex;
    align-items: center;
    gap: 12px;

    width: 100%;
    margin-top: 12px;
}

.uid-msg {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.uid-msg.success {
    background: rgba(0, 255, 140, 0.20);
    color: #00ff9c;
    border: 1px solid rgba(0, 255, 140, 0.4);
}

.uid-value {
    flex: 1;
    padding: 10px 14px;
    border-radius: 10px;

    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);

    text-align: center;
    font-size: 15px;
    color: #fff;
}

.uid-copy-btn {
    padding: 10px 18px;
    border-radius: 10px;
    border: none;

    background: #3278ff;
    color: #fff;

    font-size: 14px;
    font-weight: 600;
    cursor: pointer;

    transition: 0.25s ease;
    white-space: nowrap;
}

.uid-copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(51,120,255,0.45);
}

/* ================================
   UID RESULT — SUCCESS BOX (đẹp)
================================ */

.uid-success-box {
    width: 100%;
    padding: 16px;
    border-radius: 14px;

    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(6px);

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;

    box-sizing: border-box;
    margin-top: 15px;
}

/* Dòng thông báo thành công */
.uid-msg {
    padding: 10px 14px;
    border-radius: 10px;

    background: rgba(16,185,129,0.18);
    border: 1px solid rgba(16,185,129,0.35);
    color: #5affd8;

    font-size: 15px;
    font-weight: 600;
    text-align: center;

    width: 100%;
    box-sizing: border-box;
}

/* UID hiển thị */
.uid-value {
    width: 100%;
    padding: 12px;

    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;

    text-align: center;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #fff;
    box-sizing: border-box;
}

/* Nút Copy đẹp */
.uid-copy-btn {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: none;

    background: linear-gradient(135deg,#2c89ff,#43a8ff);
    color: #fff;

    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.25s ease;
}

.uid-copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,132,255,0.35);
}

/* Light Mode */
body.light .uid-success-box {
    background: rgba(255,255,255,0.9);
    border-color: #ccc;
}

body.light .uid-msg {
    background: rgba(0,200,145,0.15);
    border-color: rgba(0,200,145,0.35);
    color: #008f6d;
}

body.light .uid-value {
    background: #fff;
    color: #000;
    border-color: #ccc;
}
/* ================================
   FIX: UID RESULT ALWAYS FIT INSIDE TOOL BOX
================================ */

#uid-tool #result {
    width: 100% !important;
    padding: 0 !important;
    margin-top: 15px !important;

    box-sizing: border-box !important;
    display: block !important;
}

/* khung UID chuẩn, đảm bảo nằm trong #result */
#uid-tool #result .uid-success-box {
    width: 100% !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;

    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    padding: 18px;
    border: 1px solid rgba(255,255,255,0.08);

    display: flex;
    flex-direction: column;
    gap: 15px;
}
/* ===========================
   ERROR MESSAGE — TALL + CLEAN
=========================== */
.result.error {
    width: 100%;
    padding: 18px 20px; /* tăng chiều cao */
    
    background: rgba(255, 60, 60, 0.14);
    border: 1px solid rgba(255, 90, 90, 0.32);

    border-radius: 14px;

    display: flex;
    align-items: center;      /* căn giữa chiều dọc */
    justify-content: center; /* căn giữa ngang */
    gap: 10px;

    color: #ff9b9b;
    font-weight: 600;
    font-size: 16px;          /* chữ to hơn 1 chút */
    line-height: 1.6;

    text-shadow: 0 0 6px rgba(255,120,120,0.35);
    backdrop-filter: blur(6px);

    box-shadow: 0 6px 22px rgba(255, 0, 0, 0.08);

    transition: 0.25s ease;
}

/* Icon */
.result.error i {
    font-style: normal;
    font-size: 20px; /* icon to hơn */
    color: #ffc4c4;
}
/* ===========================
   LOADING — CENTER & WIDE
=========================== */

.result.loading {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 12px;
    padding: 14px;

    display: flex;
    justify-content: center;
    align-items: center;

    width: 100%;          /* full width */
    box-sizing: border-box;
}

/* Bọc loading căn giữa */
.loading-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    width: 100%;
    text-align: center;
    font-size: 16px;
    color: #ddd;
    font-weight: 500;
}

/* Spinner lớn hơn và đẹp hơn */
.loading-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: #4da6ff;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

/* Spin animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}


