
:root{
    --bg:#121212;
    --panel:#1e1e1e;
    --accent:#00dc82;
    --text:#e0e0e0;
}

[data-theme="light"]{
    --bg:#f8f9fa;
    --panel:#fff;
    --accent:#00b36b;
    --text:#222;
}

*{box-sizing:border-box}

body{
    margin:0;
    height:100vh;
    overflow:hidden;
    display:flex;
    background:var(--bg);
    color:var(--text);
    font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;
    touch-action:manipulation;
}

.sidebar{
    width:380px;
    padding:20px;
    overflow-y:auto;
    flex-shrink:0;
    background:var(--panel);
    border-right:1px solid #333;
    transition:.3s;
}

.sidebar.collapsed{
    width:160px;
}

.main-content{
    flex:1;
    padding:15px;
    overflow-y:auto;
    overflow-x:hidden;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    background:#0f0f0f;
    position:relative;
}

.section{
    margin-bottom:22px;
    padding-bottom:18px;
    border-bottom:1px solid #333;
}

h2{
    margin:0 0 20px;
    color:#fff;
    font-size:19px;
    letter-spacing:1px;
}

h3{
    margin:0 0 12px;
    color:var(--accent);
    font-size:13px;
    text-transform:uppercase;
    letter-spacing:1px;
}

label{
    display:block;
    margin-bottom:6px;
    color:#888;
    font-size:11px;
    text-transform:uppercase;
}

input,
textarea,
select{
    width:100%;
    padding:10px;
    margin-bottom:10px;
    border-radius:6px;
    border:1px solid #444;
    background:#2a2a2a;
    color:#fff;
    font-size:14px;
}

input:focus,
textarea:focus,
select:focus{
    outline:none;
    border-color:var(--accent);
}

.grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
}

.tab-container{
    display:flex;
    gap:5px;
    margin-bottom:15px;
    padding:3px;
    background:#000;
    border-radius:8px;
}

.tab{
    flex:1;
    padding:10px;
    border-radius:6px;
    text-align:center;
    cursor:pointer;
    color:#666;
    font-size:11px;
    font-weight:bold;
    transition:.3s;
}

.tab.active{
    background:var(--accent);
    color:#000;
}

button{
    width:100%;
    padding:14px;
    margin-bottom:8px;
    border:none;
    border-radius:6px;
    cursor:pointer;
    font-size:15px;
    font-weight:bold;
    transition:.3s;
}

.btn-generate{
    color:#000;
    background:var(--accent);
    font-size:16px;
    box-shadow:0 4px 15px rgba(0,220,130,.3);
}

.btn-generate:hover:not(:disabled),
.btn-cancel:hover:not(:disabled){
    filter:brightness(1.15);
}

.btn-generate:hover:not(:disabled){
    transform:translateY(-2px);
}

.btn-cancel:hover:not(:disabled){
    transform:translateY(-1px);
}

.btn-generate:disabled{
    background:#555;
    color:#aaa;
    cursor:not-allowed;
    box-shadow:none;
    transform:none;
}

.btn-cancel{
    width:40%;
    margin:0 30% 12px;
    background:#c42b2b;
    color:#fff;
}

.btn-small{
    width:auto;
    display:inline-block;
    padding:9px 12px;
    margin:4px 2px;
    font-size:12.5px;
}

.size-btn{
    width:auto;
    padding:1px;
    border:1px solid #444;
    border-radius:4px;
    background:#2a2a2a;
    color:#ccc;
    font-size:10px;
    transition:.2s;
}

.size-btn:hover{
    background:var(--accent);
    color:#fff;
    border-color:var(--accent);
}

.drop-zone{
    width:100%;
    min-height:110px;
    overflow:hidden;
    display:flex;
    align-items:center;
    justify-content:center;
    text-align:center;
    cursor:pointer;
    border:2px dashed #555;
    border-radius:8px;
    background:#1a1a1a;
    color:#888;
    font-size:13px;
    transition:.3s;
}

.drop-zone.dragover{
    transform:scale(1.02);
    border-color:var(--accent);
    background:#2a2a2a;
    color:var(--accent);
}

.drop-zone img{
    max-width:100%;
    max-height:95px;
    border-radius:6px;
    object-fit:contain;
}

#image-viewer{
    display:none;
    max-width:100%;
    max-height:75vh;
    border-radius:14px;
    background:#222;
    border:1px solid #444;
    box-shadow:0 15px 40px rgba(0,0,0,.6);
    cursor:zoom-in;
}

.loading-area{
    width:100%;
    max-width:460px;
    height:340px;
    padding:30px;
    margin:0 auto;
    display:none;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    border:1px solid #333;
    border-radius:20px;
    background:linear-gradient(145deg,#1a1a1a,#222);
}

.progress-container{
    width:85%;
    height:7px;
    margin:25px 0;
    overflow:hidden;
    border-radius:10px;
    background:#111;
}

.progress-bar{
    width:0;
    height:100%;
    background:var(--accent);
    box-shadow:0 0 20px var(--accent);
    transition:width .3s;
}

.toast{
    position:fixed;
    bottom:20px;
    left:50%;
    transform:translateX(-50%);
    z-index:1000;
    display:none;
    max-width:90%;
    padding:12px 20px;
    border-radius:8px;
    background:#1e1e1e;
    color:var(--accent);
}

.history-panel{
    margin-top:15px;
    max-height:250px;
    overflow-y:auto;
    border-top:1px solid #444;
    padding-top:10px;
}

.history-item{
    position:relative;
    display:flex;
    align-items:center;
    gap:10px;
    margin-bottom:12px;
    padding:6px;
    border-radius:6px;
    background:#2a2a2a;
    cursor:pointer;
    transition:.2s;
}

.history-item:hover{
    background:#333;
}

.history-item img{
    width:50px;
    height:50px;
    object-fit:cover;
    border-radius:4px;
    flex-shrink:0;
}

.delete-btn{
    position:absolute;
    top:8px;
    right:8px;
    z-index:10;
    width:24px;
    height:24px;
    display:none;
    align-items:center;
    justify-content:center;
    border:none;
    border-radius:50%;
    background:rgba(0,0,0,.7);
    color:#fff;
    font-size:14px;
    cursor:pointer;
}

.history-item:hover .delete-btn{
    display:flex;
}

.delete-btn:hover{
    background:#ff4444;
}

.load-more-btn{
    width:100%;
    padding:12px 0;
    margin:15px 0 10px;
    border:none;
    border-radius:6px;
    background:#444;
    color:#fff;
    font-size:14px;
    cursor:pointer;
}

.load-more-btn:hover{
    background:#666;
}

@media (max-width:900px){
    body{
        flex-direction:column;
    }

    .sidebar{
        width:100%;
        height:50vh;
        max-height:50vh;
        border-right:none;
        border-bottom:1px solid #333;
    }

    .sidebar.collapsed{
        height:100px;
    }

    .main-content{
        justify-content:flex-start;
        background:#000;
        -webkit-overflow-scrolling:touch;
    }

    #image-viewer{
        max-height:70vh;
        width:auto;
        object-fit:contain;
    }

    #resultActions{
        width:100%;
        padding:5px 0 30px;
        justify-content:center;
        flex-shrink:0;
    }

    .loading-area{
        max-width:95%;
        height:auto;
        padding:20px;
    }
    /* new for dropdown */

}
/* Container chính */
        .prompt-wrapper {
            position: relative;
            max-width: 650px;
            margin: 20px auto;
        }

        /* Ô nhập liệu tinh tế hơn */
        .prompt-input {
            width: 100%;
            padding: 14px 16px;
            font-size: 16px;
            border: 2px solid var(--border-color);
            border-radius: 12px;
            box-sizing: border-box;
            outline: none;
            transition: all 0.2s ease;
            background: #ffffff;
            color: #334155;
        }

        .prompt-input:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
        }

        /* Khung danh sách gợi ý dạng nổi */
        .prompt-dropdown {
            position: absolute;
            top: calc(100% + 8px);
            left: 0;
            right: 0;
            background: #ffffff;
            border-radius: 16px;
            max-height: 380px;
            overflow-y: auto;
            z-index: 1000;
            display: none;
            /* Đổ bóng hiện đại giúp phân tách với nền */
            box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
            padding: 8px;
            box-sizing: border-box;
        }

        /* Thiết kế từng Prompt thành 1 Card riêng biệt */
        .prompt-card {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
            padding: 14px;
            margin-bottom: 8px;
            border-radius: 10px;
            background-color: #f1f5f9; /* Màu nền card nhẹ */
            cursor: pointer;
            transition: all 0.2s ease;
            border: 1px solid transparent;
        }

        .prompt-card:last-child {
            margin-bottom: 0;
        }

        /* Hiệu ứng khi hover hoặc active trên mobile */
        .prompt-card:hover {
            background-color: #eef2ff;
            border-color: #c7d2fe;
        }

        /* Phần text hiển thị của prompt */
        .prompt-text {
            font-size: 14px;
            line-height: 1.5;
            color: #334155;
            word-break: break-word;
            flex: 1;
        }

        .prompt-card:hover .select-badge {
            background: var(--primary-color);
            color: #ffffff;
        }

        /* Tối ưu thanh cuộn (Scrollbar) cho đẹp mắt */
        .prompt-dropdown::-webkit-scrollbar {
            width: 6px;
        }
        .prompt-dropdown::-webkit-scrollbar-thumb {
            background: #cbd5e1;
            border-radius: 3px;
        }
