



/* Genel Stil */
body {
    
    background-color: #222;
    color:#cccccc;
    font-family: Ginto, ui-sans-serif, system-ui, sans-serif ;
    font-size: 17px;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: hidden; /* Sayfanın kendi scrollbar'ı olacak */
    height: 100vh;
    /*background-image: url('{{ url_for("static", filename="kanunlarai_logo2.png") }}');*/
    background-repeat: no-repeat;
    background-position: center;
    
    
}




/*header {
    position: fixed;
    top: 0;
    left: 0;
    width: 80%;
    height: 64px;
    justify-content: center;
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0px 24px;
    border-bottom: 0px solid #4eaaff;
    margin-left: 117px;
    font-size: 15px;
    font-weight: bold;
    gap: 2px;
    
    
}*/ 



header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    font-size: 17px;
    top: 0;
    left: 0;
    width: 100%;
    height: 64px;
    padding: 0px 24px;
    z-index: 1000;
    
    border-bottom: 0px solid #4eaaff;
    margin-left: 0px;
}


.reference.popup::-webkit-scrollbar-track {
    background: #4b4a4a; /* Arka plan rengi */
}


.header-left,
.header-center,
.header-right {
    flex: 1;
    display: flex;
    align-items: center;
}

.header-center {
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    margin-left: -169px;
}

.header-left {
    justify-content: flex-start;
}

.header-right {
    justify-content: flex-end;
}

#agent-info {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 15px;
    color: #dddddd;
    padding: 4px 10px;
    
    margin-right: 14px;
    
    
    
    cursor: default;
}

#agent-info img {
    width: 30px;
    height: 30px;
    border-radius: 4px;
}












header img.logo {
    height: 48px;
    width: auto;
    margin-right: 15px;
    border-radius: 50%;
}
.main-layout {
    margin-top: 80px;  /* header yüksekliğine göre */
}



/* Genel Layout */
.main-layout {
    display: flex;
    width: 90%;
    max-width: 1000px;
    min-height: calc(100vh - 60px); /* Sayfa boyutuna göre ayarla */
}



/* Agent Seçimi Başlık */
#agent-selection h2 {
    font-size: 14px;
    text-align: center;
}

/* Agent Seçenekleri */
.agent {
    cursor: pointer;
    padding: 0px;
    border-radius: 10px;
    text-align: center;
    width: 92%;
    
    margin-bottom: 5px;
    font-size: 15px;
}

.agent img {
    width: 32px;
    height: 32px;
    border-radius: 0%;
    padding-top: 8px;
}

/* Seçili Olan Agent */


/* Sağ Taraf: Chat Alanı */
.container {
    display: flex;
    width: 90%;
    max-width: 800px;
    overflow-y: auto;
    /*height: 500px;*/
   
    border-radius: 5px;
    overflow: hidden;
    flex-direction: column;
    margin-bottom: 90px; /* input-area çarpmamak için */
    margin-left: 220px;
}


/* Kullanıcı ve Bot Mesajları */
.user-message, .chatbot-message {
    padding: 10px;
    border-radius: 5px;
    
    margin-top: 10px;
}

.user-message {
    background-color: #616266;
    align-self: flex-end;
    text-align: right;
    padding-bottom: 13px;
    padding-left: 24px;
    padding-right: 24px;
    border-radius: 24px;
    margin-top: 10px;
    margin-bottom: 10px;
    margin-right: 10px;
    margin-left: 14px;

}

.chatbot-message {
    /*background-color: #282933;*/
    align-self: flex-start;
    text-align: justify;
    
    position: relative;
    border: 1px solid #333338;   /* Gri ince kenarlık */
    border-radius: 10px;        /* Hafif yumuşak köşeler */
    padding: 14px;              /* Kenar boşluğu artır */
    margin-bottom: 1px;
    margin-top: 10px;
    width: calc(100% - 55px); 
    
}



/* Chat Kutusu */
.chat-box {
    flex-grow: 1;
    
   
    display: flex;
    flex-direction: column;
    /* max-height: max-content; /* ✅ Input-area'ya kadar uzasın */
    
    align-items: stretch;
    /*background-color: blue;*/
   
    overflow-y: visible !important;  /* 🔥 Scroll kapalı */
    max-height: none !important;

    flex-shrink: 0;
    flex-grow: 0;
      
  
    padding: 20px;
   
}



#chat-container {
    flex-grow: 1;
    /*width: calc(100% - 420px);*/
    align-self: center;
    margin-top: 10px;
    overflow-y: visible;
    display: flex;
    flex-direction: column;
    padding: 0 20px;
    background-color: #222;
    color: white;
   
    padding-right: 20px;
    padding-left: 20px;
    max-width: 900px;
    /*background-color: brown;*/
}

/* Chat Input Alanı */
.input-area {
    position: fixed;
    bottom: 28px;
    align-self: center;
    
    max-width: 750px;
    min-width: 411px;
    background-color: #1e1e1e;
    border-radius: 25px;
    padding: 10px;
    border: 1px solid #333;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    width: 70%;
    margin-left: 1px;
    /*transform: translateX(-50%);
    left: 50%;
    margin-left: 48px;
    width: calc(100% - 121px);*/
    bottom: 30px;
    
    background-color: #1e1e1e;
    /*padding: 10px;*/
    z-index: 1000;
}

/* Chat Input */
.input-area input {
    flex-grow: 1;
    padding: 12px;
    border: none;
    border-radius: 20px;
    background-color: #292929;
    color: #fff;
    outline: none;
    font-size: 16px;
    height: 26px;
}

/* Send Button */
.input-area button {
    width: 45px;
    height: 45px;
    border: none;
    background-color: #444;
    color: white;
    cursor: pointer;
    border-radius: 23px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    margin-left: 5px;

   
}

.input-area button:hover {
    background-color: #555;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .main-layout {
        flex-direction: column;
    }

   

    .container {
        margin-left: 0;
    }

    .input-area {
        width: 95%;
    }
}


/* Hidden Agent Toggle Button */
#agent-toggle {
    position: fixed;
    top: 50%;
    left: -40px; /* Start hidden */
    transform: translateY(-50%);
    background-color: #333;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    transition: left 0.3s ease-in-out;
    z-index: 1001;
}

/* When hovered, button appears */
#agent-toggle:hover {
    left: 0px; /* Moves into view */
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('/static/kanunlarai_logo2.png') no-repeat center center;
    background-size: cover;
    opacity: 0.00;  /* 🔥 Şeffaflık ayarı */
    z-index: 0;
    pointer-events: none; /* ✅ Tıklamalara engel olmasın */
}



.chatbot-message h2 {
    font-weight: bold;
    color: #dde0e6;  /* Mavi (Tailwind blue-500 tonu) */
    margin-bottom: 10px;
}

.chatbot-message h3 {
    font-weight: bold;
    color: #aab6c5;  /* Açık mavi (Tailwind blue-400 tonu) */
    margin-bottom: 8px;
}

.chatbot-message h4 {
    font-weight: bold;
    color: #d3e0ee;  /* Daha soft mavi */
    margin-bottom: 6px;
}



.chatbot-message ol {
    list-style: decimal;
    padding-left: 30px;
    color: #ddd;
}

.chatbot-message ul {
    list-style: disc;
    padding-left: 30px;
    color: #ddd;
}

.chatbot-message li {
    margin-bottom: 8px;
}

.disclaimer {
    text-align: center;
    color: #575656;  /* Açık gri */
    font-size: 12px;
    margin-top: 15px;
    padding: 10px 20px;

    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
     width: 90%;
    /*max-width: 750px; */
    flex-direction: column;
  
    padding: 10px;
   
    display: flex;
    align-items: center;
    margin-left: 48px;
}



#sources-area {
    position: relative;
}

#sources-area {
    font-size: 16px;
    color: #fff;
    font-weight: bold;
    margin-top: 20px;
}

.reference {
    position: relative;
    cursor: pointer;
    color: #4eaaff;
    text-decoration: none;
    display: inline-block;
    margin: 0;
    padding: 0;
}

.reference .ref-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: #fff;
    color: #111;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}

.reference .popup {
    display: none;
    position: absolute;
    bottom: 100%;          /* 🔥 boşluk yok */
    margin-top: -1px;      /* 🔥 üst üste gelsin */
    left: 50%;
    transform: translateX(-25%);
    background-color: #2a2a2a;
    color: #fff;
    padding: 14px 18px;
    border-radius: 8px;
    z-index: 9999;
    font-size: 15px;           /* 🔽 Daha küçük font */
    font-weight: 400;        
    line-height: 1.7;
    min-width: 360px; 
    max-width: 600px;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
    text-align: left;
    pointer-events: auto;
    font-family: 'Segoe UI', Roboto, sans-serif;

}   

.reference .popup::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #2a2a2a transparent transparent transparent;
}

.reference:hover .popup,
.reference .popup:hover {
    display: block;
}




.popup {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-25%);
    background-color: #2a2a2a;
    color: #fff;
    padding: 14px 18px 20px 18px; /* üst-sağ-alt-sol padding */
    border-radius: 8px;
    z-index: 9999;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.7;
    min-width: 360px;
    max-width: 600px;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
    text-align: left;
    pointer-events: auto;
    font-family: 'Segoe UI', Roboto, sans-serif;
}

.popup::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #2a2a2a transparent transparent transparent;
}

.reference:hover .popup,
.reference .popup:hover {
    display: block;
}

.popup .copy-btn {
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 10001;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.popup .copy-btn:hover {
    opacity: 1;
}

.popup .popup-header {
    font-weight: bold;
    margin-bottom: 10px;
    padding-top: 0; /* 🔥 üst boşluğu kaldır */
    padding-right: 30px; /* sağ üstte ikonla çakışmaması için boşluk bırak */
    margin-top: -70px; /* 🔥 üst boşluğu kaldır */
}

.popup .popup-content {
    margin-top: -35px; /* 🔥 üst boşluğu kaldır */
    padding-top: 0;
}


.popup .copy-btn {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 10001;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    padding-top: 12px;
}

.popup .copy-btn:hover {
    opacity: 1;
}

.copy-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    pointer-events: none; /* tıklamayı engellemesin */
}





.chatbot-message {
    position: relative;
}

.chatbot-content {
    padding-right: 35px;
}


.chat-copy-btn:hover {
    opacity: 1;
}




.chat-copy-btn {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    padding-bottom: 12px;
}

.chat-copy-btn:hover {
    opacity: 1;
}

.copy-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    pointer-events: none;
}



/* Responsive Ayar (İsteğe Bağlı) */
@media (max-width: 768px) {
   

    #chat-container {
        margin-left: 0;
        padding-top: 1px;
    }
}






/* Sol Taraf: Agent Seçimi */


/* Sağ içerik (header + chat) */
.main-content {
    
    width: calc(100% - 121px);
    height: calc(100vh - 100px); /* header + input height */
    overflow-y: auto;
    display: flex;
    flex-direction: column;

    /*height: 100vh;*/
    overflow-y: auto;
    margin-top: 72px;
    /*background-color: yellow;*/
    margin-bottom: 117px;
}

/* Chat Container */

/* (Diğer stillerin hepsi aynı kalacak şekilde devam...) */






@media screen and (max-width: 768px) {
    header, .main-content, .input-area {
        padding: 10px;
    }

    header img.logo {
        height: 40px;
        
    }


    .chatbot-message, .user-message {
        max-width: 100%;
        min-width: unset;
    }

    .agent {
        min-width: 80px;
        font-size: 13px;
    }

    .input-area {
        flex-direction: column;
    }

    .input-area button {
        
       
        margin-right: 14px
    }
}








#agent-toggle-btn {
    background-color: #333;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 8px;
  }
  
  .agent-dropdown {
    position: absolute;
    top: 70px;
    left: 20px;
    background-color: #1e1e1e;
    border: 1px solid #444;
    border-radius: 10px;
    z-index: 1002;
    width: 200px;
    padding: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  }
  
  .agent-dropdown .agent {
    padding: 8px;
    margin-bottom: 5px;
    cursor: pointer;
   
    display: flex;
    align-items: center;
    gap: 10px;
    height: 28px;
  }
  
  .agent-dropdown .agent:hover {
    background-color: #111010;
  }
  
  .agent-dropdown img {
    width: 28px;
    height: 28px;
  }
  
  .hidden {
    display: none;
  }


  @media screen and (max-width: 768px) {

    body {
        overflow-x: hidden;
    }


    .header-center {
        justify-content: right;
        gap: 0px;
        font-size: 11px;
        margin-left: 0px;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 2px;
        box-sizing: border-box;
        margin-bottom: 80px;
    }

    #chat-container {
        padding: 3px !important;
        /*width: 92% !important;*/
        max-width: 100% !important;
    }

    .chat-box {
        padding: 0px !important;
        overflow-y: auto !important;
        max-height: 70vh;
    }

    .input-area {
        width: 100% !important;
        min-width: unset;
        max-width: unset;
        left: 0 !important;
        transform: none !important;
        margin-left: 0 !important;
        border-radius: 0;
        flex-direction: row;
        bottom: 0;
        padding: 10px;
        position: fixed;
    }

    .input-area input {
        font-size: 16px;
        padding: 10px;
    }

    .chatbot-message {
        width: 100% !important;
        box-sizing: border-box;
        
    }
    .chatbot-content {
        
        padding-right: 10px;
        padding-left: 10px;
    }
    .disclaimer {
        font-size: 10px;
        padding: 5px;
        width: 100%;
        margin-left: 0;
        bottom: 35px;
        position: fixed;
    }
}
