/* ================= BASE ================= */
body{
    margin:0;
    padding:0;
    height:100%;
    background:#f5eee4;
    font-family:system-ui, -apple-system, Segoe UI, Roboto, Arial;
    overflow-x:hidden;
}


/* ================= ANIMATION ================= */

@keyframes wipeIn{
from{
transform:translateX(-25px);
opacity:0;
}
to{
transform:translateX(0);
opacity:1;
}
}

@keyframes wipeUp{
from{
transform:translateY(25px);
opacity:0;
}
to{
transform:translateY(0);
opacity:1;
}
}

@keyframes pulse{
0%{
opacity:.4;
}
50%{
opacity:1;
}
100%{
opacity:.4;
}
}


/* ================= SIDEBAR ================= */
.sidebar{
    width:80px;
    height:100vh;
    position:fixed;
    top:0;
    left:-80px;
    background:#f5eee4;
    transition:0.15s ease;
    z-index:1001;

    display:flex;
    flex-direction:column;
    align-items:stretch;
}

.sidebar.active{
    left:0;
}

/* ================= PROFILE ================= */

.profile-default-icon{
    font-size:38px;
}

.sidebar-profile{
    height:90px;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
}

.sidebar-profile .material-symbols-rounded{
    font-size:38px;
}


#profileIcon{
    width:45px;
    height:45px;
    border-radius:50%;
    overflow:hidden;
    display:flex;
    align-items:center;
    justify-content:center;
}


#profileIcon img{
    width:100%;
    height:100%;
    object-fit:cover;
    border-radius:50%;
}


#profileIcon .profile-initial{
    width:45px;
    height:45px;
    border-radius:50%;
    
    display:flex;
    align-items:center;
    justify-content:center;
    
    font-size:16px;
    font-weight:600;

    background:#7a1230;
    color:white;
}

    .overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    display: none;
    z-index: 1000;
}
.overlay.active {
    display: block;
}


/* ================= MENU ITEM ================= */
.menu-item{
    height:75px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:3px;

    cursor:pointer;
    transition:0.2s ease;
}

.menu-item .material-symbols-rounded{
    font-size:26px;
    color:#111;
}

.label{
    font-size:11px;
    color:#333;
}

/* ================= HOVER ================= */
.menu-item:hover{
    background:#f0dde4;
}

/* ================= ACTIVE ================= */
.menu-item.active{
    background:#f0dde4;
    color:#850a37;
}

/* ================= HEADER ================= */
.header{
    background:#f5eee3;
    padding:16px 18px;
    display:flex;
    align-items:center;
    gap:12px;
    border-bottom:1px solid #ddd;
    
}

.logo{
    font-weight:600;
    color:#7a1230;
    font-size:20px;
    animation:wipeIn 1.5s ease;
}

.hamburger{
    cursor:pointer;
    font-size:22px;
    color:#7a1230;
    animation:wipeIn 1.5s ease;
}


/* ================= CONTAINER ================= */

/* CONTAINER */

.container{
width:100%;
padding:0 18px;
box-sizing:border-box;
overflow-y:auto;
}

.page-title{
font-size:18px;
font-weight:600;
color:#7a1230;
margin:20px 0 15px;
animation:wipeIn 1s ease;
}


/* UPLOAD BOX */

.upload-box{
background: #ffffff;;
padding:10px 25px 10px 25px;
border-radius:22px;
box-shadow:0 10px 30px rgba(122,18,48,.08);
border:1px solid rgba(122,18,48,.08);
animation:wipeUp 1s ease;
}

.upload-box p{
font-size:14px;
line-height:1.7;
color:#555;
margin:8px 0;
}

.upload-box i{
font-size:13px;
color:#777;
}

.upload-box .material-symbols-rounded{
width:70px;
height:70px;
display:flex;
align-items:center;
justify-content:center;
margin:auto;
background:#f0dde4;
border-radius:22px;
font-size:38px;
color:#7a1230;
}


/* INPUT */

#questionTitle{
width:100%;
padding:14px 16px;
margin-top:10px;
background:white;
border:1px solid #ddd;
border-radius:14px;
box-sizing:border-box;
font-size:14px;
}

#questionTitle:focus{
outline:none;
box-shadow:0 0 0 2px rgba(122,18,48,.15);
}

input[type="file"]{
width:100%;
box-sizing:border-box;
padding:12px;
margin-top:12px;

background:white;
border:1px dashed #ddd;
border-radius:14px;

font-size:13px;
color:#555;

cursor:pointer;
}


/* bila hover */
input[type="file"]:hover{
background:#fdf0f5;
border-color:#7a1230;
}


/* focus */
input[type="file"]:focus{
outline:none;
border-color:#7a1230;
}


/* BUTTON */

button{
background:#7a1230;
color:white;
border:none;
padding:10px 18px;
border-radius:999px;
cursor:pointer;
font-size:14px;
transition:.2s ease;
}

button:hover{
transform:translateY(-2px);
opacity:.9;
}

.upload-box button{
width:100%;
margin-top:18px;
padding:13px;
font-weight:600;
}


/* SEARCH */

#searchQuestion{
order:3;
width:100%;
padding:13px 16px;
margin:4px 0 0;

background:#ffffff;

border:1px solid #ddd;
border-radius:14px;

font-size:14px;
color:#333;

box-sizing:border-box;
}


#searchQuestion::placeholder{
color:#999;
}


#searchQuestion:focus{
outline:none;
background:#ffffff;
box-shadow:0 0 0 2px rgba(122,18,48,.15);
}




/* CONTROL BAR MASUK */

.tab-container{
animation:wipeUp .5s ease;
}


/* ================= QUESTION GRID ================= */

#questionList{
display:grid;
grid-template-columns:repeat(auto-fill,minmax(140px,180px));
gap:15px;
justify-content:start;
padding-bottom:20px;
}


/* ================= QUESTION CARD ================= */

.qna-card{
background:white;
padding:14px;
height:90px;
border-radius:16px;
display:flex;
align-items:center;
gap:12px;
cursor:pointer;
box-sizing:border-box;
box-shadow:0 3px 10px rgba(0,0,0,.07);
animation:wipeUp .7s ease;
transition:.2s ease;
}   

.qna-card:hover{
transform:translateY(-3px);
box-shadow:0 7px 18px rgba(0,0,0,.12);
}

.qna-icon{
width:45px;
height:45px;
flex-shrink:0;
border-radius:14px;
background:#f0dde4;
display:flex;
align-items:center;
justify-content:center;
}



.qna-info{
display:flex;
flex-direction:column;
gap:5px;
}

.qna-title{
font-size:14px;
font-weight:600;
color:#222;

display:-webkit-box;
-webkit-box-orient:vertical;
-webkit-line-clamp:2;

line-clamp:2;

overflow:hidden;
text-overflow:ellipsis;
}


/* ================= STATUS ================= */

.status{
font-size:11px;
padding:6px 14px;
border-radius:999px;
width:fit-content;
display:inline-block;
font-weight:600;
}

.status.not-answered{
background:#ffe5e5;
border:1.5px solid #ff4d4d;
color:#d93636;
}

.status.answered{
background:#e5f8e8;
border:1.5px solid #34a853;
color:#218739;
}


/* ================= PREVIEW MODAL ================= */

#previewModal{
position:fixed;
inset:0;
background:rgba(0,0,0,.6);
display:none;
align-items:center;
justify-content:center;
z-index:5000;
padding:20px;
box-sizing:border-box;
overflow-y:auto;
}

.preview-box{
background:white;
width:100%;
max-width:1800px;
max-height:85vh;
overflow-y:auto;
border-radius:18px;
padding:20px;
box-sizing:border-box;
animation:wipeUp .3s ease;
position:relative;
}

.preview-box button{
float:right;
width:38px;
height:38px;
padding:0;
border-radius:50%;
}

.preview-box h3{
clear:both;
font-size:16px;
color:#7a1230;
margin-top:20px;
}

.preview-box img{
width:100%;
max-height:70vh;
object-fit:contain;
border-radius:12px;
margin-top:10px;
}

#answerButton{
width:100%;
padding:12px 24px;
margin:20px 0 0;
display:block;
border-radius:12px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
}


/* ================= LOADING ================= */

.loading{
grid-column:1 / -1;

height:200px;

display:flex;
align-items:center;
justify-content:center;

color:#777;
font-size:14px;

animation:pulse 2s infinite;
}


.qna-icon img{
width:100%;
height:100%;
object-fit:cover;
}

/* ================= QNA CONTROL ================= */

.tab-container{

display:flex;
flex-wrap:wrap;

gap:10px;

background:white;

padding:10px;

border-radius:24px;

margin:20px 0;

box-shadow:0 3px 10px rgba(0,0,0,.07);



animation:wipeUp .5s ease;

}


/* TAB BUTTON */

.tab{

flex:1;

height:42px;

background:#ffffff;

color:#7a1230;

border:none;

border-radius:14px;

font-size:13px;

font-weight:600;

cursor:pointer;

transition:.25s ease;

}


.tab:hover{

background:#f0dde4;

transform:none;

}


.tab.active{

background:#7a1230;

color:white;

box-shadow:0 3px 10px rgba(0,0,0,.07);

animation:tabPop .25s ease;

}






/* TAB SWITCH ANIMATION */

@keyframes tabPop{

from{

transform:scale(.95);

opacity:.6;

}

to{

transform:scale(1);

opacity:1;

}

}



/* TAB ANIMATION */

.tab{
transition:
background .25s ease,
color .25s ease,
transform .2s ease,
box-shadow .25s ease;
}


.tab.active{
animation:tabPop .25s ease;
}


@keyframes tabPop{

0%{
transform:scale(.95);
opacity:.7;
}

100%{
transform:scale(1);
opacity:1;
}

}




/* ================= MOBILE ================= */

@media(max-width:600px){

#questionList{
grid-template-columns:repeat(2,1fr);
gap:10px;
}

.qna-card{
height:75px;
padding:10px;
}

.qna-icon{
width:50px;
height:50px;
flex-shrink:0;
border-radius:14px;
overflow:hidden;
background:#f0dde4;
display:flex;
align-items:center;
justify-content:center;
}

.qna-icon img{
width:100%;
height:100%;
object-fit:cover;
}

.qna-title{
font-size:12px;
}

}

body.modal-open{
    overflow:hidden;
    height:100vh;
}


#loadingOverlay{

position:fixed;
top:0;
left:0;
width:100%;
height:100%;

background:rgba(0,0,0,0.45);

display:none;

align-items:center;
justify-content:center;

flex-direction:column;

z-index:9999;

backdrop-filter:blur(5px);

}


.spinner{

width:45px;
height:45px;

border:5px solid #ffffff55;
border-top:5px solid white;

border-radius:50%;

animation:spin 0.8s linear infinite;

}


#loadingText{

color:white;
font-size:16px;
margin-top:15px;

}


@keyframes spin{

from{
transform:rotate(0deg);
}

to{
transform:rotate(360deg);
}

}


.close-preview-btn{

position:absolute;

top:15px;
right:15px;
font-size: 14px;

background:transparent !important;
border:none !important;

color:#7a1230;

cursor:pointer;

padding:5px;

display:flex;
align-items:center;
justify-content:center;

transition:none !important;

}


.close-preview-btn .material-symbols-rounded{

font-size:28px;

}


.close-preview-btn:hover{

background:transparent !important;

transform:none !important;

opacity:1 !important;

box-shadow:none !important;

}

input,
textarea,
select{
    font-size:16px;
    -webkit-text-size-adjust:100%;
}
