﻿/* site.css — 重構版 (light theme)，支援 [data-theme="dark"] 覆寫
   Sections: Variables / Base / Layout / Components / Modals / Utilities / Responsive
*/

/* ----------------------------- Variables ----------------------------- */
:root {
    --bg-color: gainsboro;
    --sticky-top-bg:white;
    --text-color: black;
    --link-color: #0366d6;
    --accent: #1b6ec2;
    --accent-dark: #1861ac;
    --container-bg-1: gainsboro;
    --container-bg-2: white;
    --header-bg-color: aliceblue;
    --modal-bg: rgba(255,255,255,0.95);
    --danger: #ff6b6b;
    --badge-bg: red;
    --max-width: 1280px;
    --footer-height: 55px;
    --profile-bg: white;

}

/* Dark theme overrides (apply by setting data-theme="dark" on document element) */
[data-theme="dark"] {
    --bg-color: #000;
    --sticky-top-bg: #212529;
    --text-color: #fff;
    --link-color: #ffffff;
    --accent: #1b6ec2;
    --accent-dark: #1861ac;
    --container-bg-1: #232323;
    --container-bg-2: #292929;
    --header-bg-color: #161c21;
    --modal-bg: rgba(30,30,46,0.95);
    --profile-bg: #fff;
    --filter: invert(1);
    
}

/* ----------------------------- Base ----------------------------- */
html{
    position: relative;
    min-height: 100%;
    font-size: 14px;
}
@media (min-width: 768px){
    html{ font-size: 16px; }
}

body{
    background-color: var(--bg-color) !important;
    color: var(--text-color);
    margin-bottom: var(--footer-height);
    -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4 { color: var(--text-color); }

a{
    text-decoration:unset;
}
th,td{
    color:var(--text-color);
}
/* helpers */
.text-color, .text-color2 { color: var(--text-color) !important; }
.container-fluid { padding-left: 0 !important; padding-right: 0 !important; }

/* ----------------------------- Layout / Containers ----------------------------- */
.header-area,
.container-area,
.lobby-message-contain {
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
}

.container-area{
    position: relative;
    background-color: var(--container-bg-1);
    margin-bottom: 5px;
}

.container-area2{
    background-color: var(--container-bg-2);
    padding-left: var(--bs-gutter-x, 0.75rem);
    padding-right: var(--bs-gutter-x, 0.75rem);
    margin-bottom: 5px;
}

.sticky-top{
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    background-color: var(--sticky-top-bg);
    width: 100%;
}

/* header wrapper */
.header-wrapper{
    margin: auto;
    text-align: center;
    background-color: var(--header-bg-color);
    height: 40px;
    display: flex;
    overflow-x: hidden;
    white-space: nowrap;
    justify-content: space-around;
}
.header-div { align-items: center; margin: auto; }
.header-div.active { text-decoration: underline; color: crimson; font-weight: bold; }

/* ----------------------------- Navbar / Buttons ----------------------------- */
.navbar { padding: 0; }
.navbar-brand.abs{
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    width: auto;
}
.navbar-toggler-icon{
    filter: var(--filter);
}

a.navbar-brand { white-space: normal; text-align: center; width: 110px; }

.btn-primary{
    color: #fff;
    background-color: var(--accent);
    border-color: var(--accent-dark);
}

.nav-pills .nav-link.active, .nav-pills .show > .nav-link{
    color: #fff;
    background-color: var(--accent);
    border-color: var(--accent-dark);
    word-break: keep-all;
}
.nav-link {
    padding-right: 0.5rem !important;
    padding-left: 0.5rem !important;
}
/* ----------------------------- CKEditor / Content ----------------------------- */
.ck-media__wrapper {
    max-width: 350px;
}
.ck-editor__editable{
    min-height: 150px !important;
    /* 如需可再加入 background-color 與 color，建議以變數控制 */
}
.ck-content .image { max-width: 350px; }

/* ----------------------------- Utilities / Borders / Shadows ----------------------------- */
.border-top { border-top: 1px solid #e5e5e5; }
.border-bottom { border-bottom: 1px solid #e5e5e5; }
.box-shadow { box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); }
button.accept-policy { font-size: 1rem; line-height: inherit; }

/* ----------------------------- Footer / Misc ----------------------------- */
.footer{
    height: 200px;
    bottom: 0;
    width: 100%;
    white-space: initial;
}

.container p { word-wrap: break-word; word-break: normal; }

/* ----------------------------- Responsive Helpers ----------------------------- */
@media screen and (max-width: 900px){
    .deviceDisplay { display: none; }
}
@media screen and (min-width: 575px){
    .search_btn, .gift_btn, .bell-area, .search-bar1 { display: none; }
}
@media screen and (max-width: 575px){
    .search_btn2, .gift_btn2, .bell-area2, .search-bar2 { display: none; }
}

/* ----------------------------- Small UI / Icons ----------------------------- */
.ui-menu { z-index: 1030 !important; }

.logo { width: 100px; height: 22.5px; }
.logo_icon { width: 25px; height: 25px; }
p.logo { display: flex; margin: 0 0 0 10px; }

.search_icon{
    width: 25px !important;
    height: 25px !important;
    max-width: 25px !important;
    filter:var(--filter);
}

.search_btn, .search_btn2, .gift_btn, .gift_btn2 {
    background-color: transparent;
    border: aliceblue;
}
    .gift_btn,.gift_btn2{
        position:relative
    }
    .gift_icon {
        width: 25px !important;
        height: 25px !important;
        max-width: 25px !important;
    }

.d-flex { margin-top: 5px; }
a.close { margin-left: 30px; margin-right: 10px; margin-top: 5px; }
.line-img { margin-left: 5px; }

.flex-row { flex-direction: row !important; overflow-x: auto; }
.form-group { margin-top: 5px; }

/* bell / profile */
.bell-img-area { position: relative; bottom: -2px; }
.bell-img { width: 25px; height: 25px;filter:var(--filter); }

.profile-img{
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background-size: cover;
    padding: 2px;
    border: outset 1px;
    background-color: var(--profile-bg);
}

/* ----------------------------- Badges (consolidated) ----------------------------- */
.badge, .badge-circle {
    padding: 2px 5px;
    line-height: 15px;
    text-align: center;
    background-color: var(--badge-bg);
    color: white;
    font-size: 8px;
    border-radius: 50%;
    position: absolute;
    min-width: 10px;
    min-height: 10px;
}
.badge { left: 20px; }
.badge-circle { left: 5px; }

.gift-badge {
    padding: 2px 5px;
    line-height: 15px;
    text-align: center;
    background-color: red;
    color: white;
    font-size: 8px;
    border-radius: 50%;

    left: 10px;
    position: absolute;
}
/* badge2: different presentation (not circular) */
.badge2{
    padding: 2px 5px;
    line-height: 15px;
    text-align: center;
    background-color: var(--badge-bg);
    color: white;
    font-size: 8px;
    position: relative;
}

/* ----------------------------- Bottom tool / labels ----------------------------- */
.bottom-tool{
    background: var(--container-bg-2);
    bottom: 0;
    position: fixed;
    width: 100%;
    z-index: 1020;
    text-align: center;
    height: 50px;
    display: flex;
    justify-content: space-around;
    left: 0;
    right: 0;
}
.tool-text{ color: black; font-weight: bold; font-size: small; padding-top: 5px; }

/* level / coin labels */
.level-progress-area{ bottom: 40px; position: fixed; width: 100%; }
.level-text, .level-text2, .exp-text, .exp-text2 { color: var(--text-color); }
.basecoin-text, .basecoin-text2 { color: #009790; font-weight: bold; }
.stockcoin-text, .stockcoin-text2 { color: #9d0000; font-weight: bold; }

/* cookie / alerts */
.cookie-area { bottom: 60px; position: fixed; width: 100%; z-index: 1200; }
.alert-info { background-color: rgba(133,233,247,0.5); }

/* lobby / chat containers */
.lobby-message-area{ position: fixed; z-index: 9999; bottom: 80px; }
.lobby-message-img{ width: 25px; height: 25px; }
.chat-container{ position: fixed; right: 0; top: 60px; width: 200px; }

.lobby-message-contain{ position: relative; max-width: var(--max-width); margin: 0 auto; background-color: white; }

/* ----------------------------- Chat small UI ----------------------------- */
.chat-header { background-color: var(--container-bg-2); padding: 10px; border-bottom: 1px solid #ccc; }
.chat-title { margin: 0; }
.close-chat-btn { float: right; border: none; background: transparent; cursor: pointer; }
.close-chat-btn:hover { color: var(--danger); }

/* search inputs */
.search-bar1, .search-bar2 { position: relative; display: inline-block; }
.search-icon{ position: absolute; top: 50%; left: 5px; transform: translateY(-50%); cursor: pointer; }

.search-input, .search-input2{
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    display: none;
    width: 0;
    transition: width 0.3s ease-in-out;
}
.search-input.show{
    display: inline-block;
    width: 100%;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 9999;
}
.search-input2.show{ display: inline-block; width: 200px; z-index: 9999; }

/* smaller icons */
.good-img, .good-img2 { width: 15px; height: 15px; margin-bottom: 5px; filter:var(--filter) }
.bottomImg { width: 20px; height: 20px; display: inline-flex; filter:var(--filter);}
.bottomLabel { display: block; margin: 0; }

/* daily task background (fixed selector) */
.daily-task-background{
    background-image: url('/Home/GetAIImageFile?sn=281&rotate=0');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* ----------------------------- Dropdown / Submenu ----------------------------- */
.dropdown-submenu{ position: relative; }
.dropdown-submenu > .dropdown-menu{ top: 0; left: 100%; margin-top: -1px; display: none; position: absolute; }
.dropdown-submenu:hover > .dropdown-menu{ display: block; }
.dropdown-menu{ min-width: 180px; }

/* ----------------------------- Modal / Reward UI ----------------------------- */
.modal-container{
    background: var(--modal-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 0;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    max-width: 400px;
    width: 100%;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
    transition: all 0.3s ease;
}
.modal-header{
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    color: white;
    padding: 20px 25px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}
.modal-title{ font-size: 1.4rem; font-weight: 600; margin: 0; color: white; }
.modal-body{ background-color: #f8f9fa; }
.modal-footer{ padding: 20px 25px; background: #f8f9fa; text-align: center; display: block; }

.reward-container{ display: flex; flex-direction: column; gap: 20px; }
.reward-item{
    background: linear-gradient(135deg, #f8f9ff, #e8f4fd);
    border: 2px solid #e1e8ed;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.reward-item::before{
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s ease;
}
.reward-item:hover{ transform: translateY(-3px); box-shadow: 0 10px 25px rgba(0,0,0,0.1); border-color: var(--danger); }
.reward-item:hover::before{ left: 100%; }

.reward-icon{ font-size: 2.5rem; margin-bottom: 10px; display: block; }
.coin-reward .reward-icon{ color: #f39c12; }
.exp-reward .reward-icon{ color: #3498db; }
.reward-text{ font-size: 1.1rem; font-weight: 500; color: #2c3e50; margin: 0; }
.reward-description{ font-size: 0.9rem; color: #7f8c8d; margin-top: 5px; }

.confirm-btn{
    background: linear-gradient(135deg, #56ccf2, #2f80ed);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.confirm-btn:hover{
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    background: linear-gradient(135deg, #2f80ed, #56ccf2);
}
.confirm-btn:active{ transform: translateY(0); }

.daily-badge{
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* ----------------------------- Final Responsive tweaks ----------------------------- */
@media (max-width: 480px){
    .modal-container{ margin: 10px; max-width: none; }
    .modal-header{ padding: 15px 20px; }
    .modal-title{ font-size: 1.2rem; }
    .modal-body{ padding: 20px; }
    .reward-item{ padding: 15px; }
}