/* ====================================================================
 * 🎨 สไตล์ส่วนกลาง แบรนด์ "การละคร AI" (lakonai.com)
 * ==================================================================== */

/* คุมธีมพื้นหลังดาร์กโหมดสากล */
body {
    background-color: #121214;
    color: #e1e1e6;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
}

/* แถบหัวเว็บส่วนกลาง (Global Navbar) */
.global-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #29292e;
    padding-bottom: 15px;
    margin-bottom: 30px;
    background: #121214;
}

/* กล่องครอบโลโก้ตัวใหม่ของน้า */
.logo-zone {
    display: flex;
    align-items: center;
}

.site-logo {
    height: 50px; /* ปรับความสูงโลโก้ให้พอดีกับแถบเมนู */
    width: auto;
    object-fit: contain;
}

/* ส่วนแสดงโปรไฟล์ผู้ใช้ด้านขวา */
.user-corner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #04d361;
}

/* ปุ่มกดสไตล์ส่วนกลาง */
.btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    border: none;
}

.btn-primary { background-color: #04d361; color: #000; }
.btn-primary:hover { background-color: #00b34d; }
.btn-secondary { background-color: #29292e; color: #e1e1e6; border: 1px solid #323238; }
.btn-secondary:hover { background-color: #323238; }
.btn-danger { background-color: #f75a68; color: #fff; }
.btn-danger:hover { background-color: #da3746; }

/* ====================================================================
 * 🎭 Character Wizard sizing normalization
 * ปรับหน้า create_character.php ให้ขนาดใกล้เคียง user_dashboard.php มากขึ้น
 * ==================================================================== */
.page-wrap:has(.step-track) {
    max-width: 1080px !important;
    font-size: 14px !important;
}

.page-wrap:has(.step-track) .hero {
    padding: 18px !important;
    border-radius: 18px !important;
    margin-bottom: 14px !important;
}

.page-wrap:has(.step-track) .hero h2 {
    font-size: 1.45rem !important;
    line-height: 1.25 !important;
}

.page-wrap:has(.step-track) .panel {
    padding: 18px !important;
    border-radius: 16px !important;
    margin-bottom: 14px !important;
}

.page-wrap:has(.step-track) .mini-card {
    padding: 10px 12px !important;
    border-radius: 12px !important;
}

.page-wrap:has(.step-track) .step-track {
    gap: 8px !important;
    margin: 14px 0 !important;
}

.page-wrap:has(.step-track) .step-pill {
    padding: 10px 12px !important;
    font-size: 14px !important;
    border-radius: 12px !important;
}

.page-wrap:has(.step-track) .section-title {
    margin: 18px 0 10px !important;
}

.page-wrap:has(.step-track) .section-title h4,
.page-wrap:has(.step-track) .panel h4,
.page-wrap:has(.step-track) .panel h5 {
    font-size: 1.08rem !important;
    line-height: 1.35 !important;
}

.page-wrap:has(.step-track) .section-title .num {
    width: 28px !important;
    height: 28px !important;
    font-size: 13px !important;
}

.page-wrap:has(.step-track) .form-label {
    font-size: 13.5px !important;
    margin-bottom: 6px !important;
}

.page-wrap:has(.step-track) .form-control,
.page-wrap:has(.step-track) .form-select {
    font-size: 14px !important;
    padding: 8px 11px !important;
    min-height: auto !important;
}

.page-wrap:has(.step-track) .form-control-lg,
.page-wrap:has(.step-track) .form-select-lg {
    font-size: 15px !important;
    padding: 9px 12px !important;
    border-radius: 8px !important;
}

.page-wrap:has(.step-track) textarea.form-control {
    line-height: 1.55 !important;
}

.page-wrap:has(.step-track) .btn-lg {
    font-size: 15px !important;
    padding: 9px 16px !important;
    border-radius: 8px !important;
}

.page-wrap:has(.step-track) .choice-card,
.page-wrap:has(.step-track) .upload-box {
    padding: 12px !important;
    border-radius: 13px !important;
}

.page-wrap:has(.step-track) .helper,
.page-wrap:has(.step-track) .muted,
.page-wrap:has(.step-track) small {
    font-size: 13px !important;
}

/* ====================================================================
 * 🎭 Character Wizard Step 3 generated image gallery
 * แสดงรูปจาก Kie.ai เป็น gallery: สูงเท่ากัน กว้างตามสัดส่วนจริง ไม่ crop
 * ==================================================================== */
#confirmForm > .row.g-3 {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 16px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

#confirmForm > .row.g-3 > [class*="col-"] {
    width: auto !important;
    max-width: 100% !important;
    flex: 0 0 auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

#confirmForm .choice-card {
    display: inline-block !important;
    width: auto !important;
    height: auto !important;
    padding: 12px !important;
    text-align: center !important;
    vertical-align: top !important;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease !important;
}

#confirmForm .choice-card.selected-character-image {
    border-color: #04d361 !important;
    box-shadow: 0 0 0 2px rgba(4, 211, 97, .22), 0 14px 34px rgba(4, 211, 97, .12) !important;
    transform: translateY(-2px) !important;
}

.history-img {
    height: 220px !important;
    width: auto !important;
    max-width: calc(100vw - 80px) !important;
    object-fit: contain !important;
    object-position: center center !important;
    display: block !important;
    margin: 0 auto 10px auto !important;
    background: #0f1015 !important;
}

@media (max-width: 768px) {
    #confirmForm > .row.g-3 {
        justify-content: center !important;
    }

    .history-img {
        height: 200px !important;
        max-width: calc(100vw - 64px) !important;
    }
}

/* ====================================================================
 * 👣 สไตล์แถบท้ายเว็บส่วนกลาง (Global Footer Style)
 * ==================================================================== */
.global-footer {
    margin-top: 60px;
    padding: 20px 0;
    border-top: 1px solid #29292e;
    text-align: center;
    font-size: 13px;
    color: #a8a8b3;
    background: #121214;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #737380;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #04d361; /* เวลาเอาเมาส์ชี้ จะเรืองแสงเป็นสีเขียวนีออนแบรนด์เรา */
}

.copyright-text {
    font-size: 12px;
    color: #737380;
}

/* ====================================================================
 * 👣 Footer alignment + public system version badge
 * แก้ display:flex inline เดิมที่ทำให้บรรทัด copyright เอียงซ้าย
 * และซ่อน label เก่า System/Core เพื่อแสดงเป็น v0.1 Beta สำหรับผู้ใช้
 * ==================================================================== */
.global-footer .copyright-text {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    width: 100% !important;
    text-align: center !important;
    color: #a8a8b3 !important;
    font-size: 12px !important;
    margin-top: 15px !important;
}

.global-footer .copyright-text > div {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.global-footer .copyright-text > div:last-child {
    font-size: 0 !important;
    background: rgba(4, 211, 97, .1) !important;
    color: #04d361 !important;
    border: 1px solid rgba(4, 211, 97, .2) !important;
    padding: 2px 8px !important;
    border-radius: 4px !important;
    font-weight: bold !important;
    font-family: monospace !important;
}

.global-footer .copyright-text > div:last-child::after {
    content: "System: v0.1 Beta";
    font-size: 11px !important;
}
