/* --- General layout --- */
body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    background-color: #1e1e1e;
    color: #ddd;
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* --- Sidebar --- */
.sidebar {
    width: 250px;
    background-color: #2b2b2b;
    padding: 20px;
    box-sizing: border-box;
}

.sidebar-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #fff;
}

.service-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.service-item {
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.service-item:hover {
    background-color: #444;
}

.chat-main {
    width: 800px;        /* lățime mai mică decât full-width */
    margin: 50px auto;   /* centrare pe orizontală și puțin spațiu de sus */
    flex: none;          /* să nu se întindă automat */
}

/* Containerul intern să ocupe tot spațiul păstrat */
.chat-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}

.chat-header h2 {
    margin: 0;
    color: #fff;
}

.close-chat {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #fff;
    cursor: pointer;
}

/* --- Chat messages --- */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 0;
    background-color: transparent;
	overflow-y: auto;
    scroll-behavior: smooth; /* scroll lin */
    font-size: 17px;
}

/* Bot message */
.message.bot-message {
    align-self: flex-start;
    background-color: #3a3a3a;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 70%;
    word-wrap: break-word;
    color: #fff;
}

.message.bot-message p {
    margin: 2px 0 !important;
    line-height: 1.2;
}

.message.bot-message br {
    line-height: 1;
    margin: 0;
    padding: 0;
}


/* User message */
.message.user-message {
    align-self: flex-end;
    background-color: #555;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 70%;
    word-wrap: break-word;
    color: #fff;
}

/* --- Chat input --- */
.chat-input-container {
    display: flex;
    padding-top: 10px;
}

.chat-input {
    flex: 1;
    padding: 10px 14px; /* mai mic */
    border-radius: 12px;
    border: none;
    background-color: #333;
    color: #fff;
    font-size: 0.95rem; /* mai mic */
    outline: none;
    resize: none;
}

.send-btn {
    background-color: #555;
    border: none;
    margin-left: 10px;
    padding: 0 16px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn svg {
    stroke: #fff;
}

/* --- Scrollbar custom --- */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: #555;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-track {
    background-color: transparent;
}

.menu-toggle {
    display: none;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 10px;
    background-color: #2b2b2b;
    color: #888;
    font-size: 0.9rem;
}


/* --- Mobile Responsive --- */
@media screen and (max-width: 768px) {
    
    /* App container */
    .app-container {
        flex-direction: column;
        height: 100vh;
    }

    /* Sidebar ascuns implicit */
    .sidebar {
        position: fixed;
        top: 60px; /* sub header */
        left: -250px; /* ascuns initial */
        width: 250px;
        height: calc(100% - 60px);
        z-index: 1000;
        transition: left 0.3s ease;
        background-color: #2a2a2a;
        padding: 20px;
        overflow-y: auto;
    }

    /* Sidebar activ */
    .sidebar.active {
        left: 0;
    }

    /* Toggle menu în header */
    .chat-header {
        position: relative;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 16px;
        background-color: #222;
        z-index: 1100;
    }

    .menu-toggle {
        display: block;
        font-size: 1.5rem;
        color: #fff;
        cursor: pointer;
        margin-left: 10px;
    }

    /* Ascunde toggle pe desktop */
    .menu-toggle {
        display: block;
    }

    /* Chat principal full-width */
    .chat-main {
        width: 100%;
        margin: 0;
        flex: 1;
    }

    .chat-container {
        height: calc(100vh - 60px); /* full height minus header */
        border-radius: 0;
    }

    .chat-messages {
        padding: 10px;
        font-size: 16px;
    }

    .chat-input-container {
        padding: 10px;
    }

    /* Ajustează mesajele bot și user pentru mobil */
    .message.bot-message,
    .message.user-message {
        max-width: 90%;
        padding: 10px 14px;
        font-size: 16px;
    }

    /* Scroll chat */
    .chat-messages {
        overflow-y: auto;
        scroll-behavior: smooth;
    }

    /* Footer ascuns pe mobil dacă nu vrei */
   .footer {
    text-align: center;
    padding: 10px;
    background-color: #2b2b2b;
    color: #888;
    font-size: 0.9rem;
}
}
