﻿body {
    font-family: "Orbitron", serif;
    background-color: #070710;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80' width='80' height='80'%3E%3Cpath fill='%23f5f4f7' fill-opacity='0.2' d='M14 16H9v-2h5V9.87a4 4 0 1 1 2 0V14h5v2h-5v15.95A10 12 0 0 0 23.66 27l-3.46-2 8.2-2.2-2.9 5a12 12 0 0 1-21 0l-2.89-5 8.2 2.2-3.47 2A10 14 0 0 0 14 31.95V16zm40 40h-5v-2h5v-4.13a4 4 0 1 1 2 0V54h5v2h-5v15.95A10 10 0 0 0 63.66 67l-3.47-2 8.2-2.2-2.88 5a12 12 0 0 1-21.02 0l-2.88-5 8.2 2.2-3.47 2A10 10 0 0 0 54 71.95V56zm-39 6a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm40-40a2 2 0 1 1 0-4 2 2 0 0 1 0 4zM15 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm40 40a2 2 0 1 0 0-4 2 2 0 0 0 0 4z'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 100px;
    animation: moveBackground 233s linear infinite;
}

@keyframes moveBackground {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 0px 10000px;
    }
}

header {
    font-family: "Orbitron", serif;
    color: white;
    font-size: xx-large;
}
.btn-secondary {
    color: #ffffff;
    background: linear-gradient(45deg, #2067dd, #ff00a5);
    border: 1px solid #000000;
    position: absolute;
    top: 3%;
    right: 3%;
    width: 100px;
    text-align: center;
    padding: 10px;
    cursor: pointer;
    z-index:5;
    transition: background 0.9s ease, text-shadow 0.5s ease, color 0.5s ease;
}

    .btn-secondary:hover {
        background: linear-gradient(25deg, #2067dd, #ff00a5);
        text-shadow: 0px 0px 5px white;
    }

.connected {
    color: #fff;
    background-color: #ffa2f8;
    border: 1px solid #ffffff;
    position: absolute;
    top: 3%;
    right: 3%;
    width: 100px;
    text-align: center;
    padding: 10px;
    cursor: pointer;
}

.chat-container {
    width: 70%;
    height: 100%;
    position: absolute;
    top: 0;
    bottom: 0;
    background-color: #00000000;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 1;
}
    .chat-container:focus-within {
        background: linear-gradient(0deg, rgba(199,93,255,0.3) 0%, rgba(255,255,255,0) 50%, rgba(255,255,255,0) 100%);
    }
.chat-box {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.message {
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 8px;
    max-width: 70%;
}

.user-message {
    font-family: "Roboto", serif;
    background-color: #007bffa6;
    color: #fff;
    width: fit-content;
    border-radius: 9px 0px 9px 0px;
    margin-left: auto;
    min-width: 40px;
 }
.connectwet {
    background-color: aqua;
    position: absolute;
    top: 80%;
    right: 90%;
    cursor: pointer;
    z-index: 9999;
}


.bot-message {
    font-family: "Orbitron", serif;
    background-color: #052341;
    color: white;
    border-radius: 0px 9px 0px 9px;
    margin-right: auto;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    user-select: none;
}

    .bot-message.show {
        opacity: 1;
    }

.input-container {
    display: flex;
    padding: 10px;
    color: #00abff;
}

#user-input {
    flex: 1;
    padding: 10px;
    background-color: #3c3c3c;
    border: 1px solid #ff000000;
    color: #ffffff;
    border-radius: 20px;
    margin-right: 10px;
}
  .input:focus-visible {
        border-image: linear-gradient(45deg, #2067dd, #ff00a5) 1;
    }
    #send-btn {
    background: linear-gradient(45deg, #2067dd, #ff00a5);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    margin: 5px;
    border-radius: 100%;
    cursor: pointer;
}

    #send-btn:disabled {
        background-color: #ccc;
        cursor: not-allowed;
    }

    #send-btn:hover {
        background: linear-gradient(0deg, #2067dd, #ff00a5);
    }
.loading {
    visibility: hidden;
    position: relative;
    background: linear-gradient(45deg, #2067dd, #ff00a5);
    text-align: center;
    padding: 2px;
    color: white;
    opacity: 0;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}
    .loading.show {
        opacity: 1;
        visibility: visible;
    }
.custom-file-container {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column; /* ترتيب العناصر عمودياً */
    gap: 10px; /* مسافة بين الأيقونات */
    z-index: 50;
}

.custom-file-label {
    background-color: rgb(0 0 0 / 21%);
    color: white;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
}
    .custom-file-label:hover {
       filter:brightness(1.6)
    }

    .bot-message h1, .bot-message h2, .bot-message h3 {
        margin: 10px 0;
    }

.bot-message strong {
    font-weight: bold;
}

.bot-message em {
    font-style: italic;
}

.bot-message code {
    background-color: #272727;
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
    user-select: all;
}

.bot-message pre {
    background-color: #272727;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
}

::-webkit-scrollbar {
    width: 3px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: #4c4c4c;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
background: linear-gradient(45deg, #2067dd, #ff00a5);
    border-radius: 10px;
}

.erbox {
    display: none;
    position: fixed;
    top: 80%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 0, 0, 0.9);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    max-width: 90%;
    width: auto;
    z-index: 10000;
    animation: fadeIn 0.3s ease-in-out;
}


#open-modal-btn {
    background: linear-gradient(45deg, #2067dd, #ff00a5);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    margin: 5px;
    border-radius: 100%;
    cursor: pointer;
    transition: background 0.9s ease, text-shadow 0.5s ease, color 0.5s ease;
}

    #open-modal-btn:hover {
        background: linear-gradient(0deg, #2067dd, #ff00a5);
        text-shadow: 0px 0px 10px white;
    }

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* خلفية مظللة */
    padding-top: 60px;
}

.modal-content {
    background-color: #161616cc;
    display: grid;
    text-align: center;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* تصغير الأعمدة */
    color: white;
    margin: 5% auto;
    padding: 15px; /* تقليل التباعد الداخلي */
    border: 1px solid #888;
    max-width: 30%; /* تصغير عرض الصندوق */
    font-family: 'Cairo';
    font-size: 14px; /* تصغير النص داخل النافذة */
    border-radius: 10px;
}

/* زر إغلاق النافذة */
.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 25px;
    transition: 0.3s;
}

    .close:hover,
    .close:focus {
        color: black;
        text-decoration: none;
        cursor: pointer;
    }

.model-btn {
    background: linear-gradient(3deg, #2067dd, #ff00a500, #ff00a500);
    color: white;
    border: none;
    font-family: "Orbitron", serif;
    border-radius: 6px;
    margin: 4px;
    cursor: pointer;
    padding: 10px; /* ضبط التباعد الداخلي */
    width: 120px; /* تصغير العرض */
    height: 50px; /* تصغير الارتفاع */
    display: grid; /* تحسين التوزيع */
    align-items: center; /* توسيط العناصر عموديًا */
    justify-content: center; /* توسيط العناصر أفقيًا */
    font-size: 14px; /* تصغير النص داخل الأزرار */
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
    .model-btn:hover {
        background-color: #ff00a5;
    }
.modal-content h3 {
    text-align: center;
    margin-top: auto;
    font-size: small;
    color: thistle;
    font-family: "Orbitron", serif;

}

    #add-to-home-screen {
        display: none;
    }


@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -55%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}
.menu-toggle {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.own-model-btn {
    background: linear-gradient(0deg, #000000, #b4b4b4);
    color: white;
    border: none;
    font-family: 'Orbitron';
    border-radius: 20px;
    margin: 4px;
    padding: 10px;
    position: relative;
    height: 50px;
    left: 100%;
    border-top: 1px solid gray;
    top: 10px;
    display: block;
    align-items: center;
    width: auto;
    justify-content: center;
    text-transform: lowercase;
    font-size: 10px;
    text-align: center;
}
.fa {
    margin-right: 5px; /* يضيف مسافة على اليمين */
}


@media (max-width: 767px) {
    .chat-container {
        width: 100%;
        border: none;
        max-width: none;
        margin: 0;
        height: 100%;
    }
    .own-model-btn {
        left:0%;
        width: max-content;

    }

    .input-container {
        display: flex;
        height: 60px;
        padding: 10px;
        color: #00abff;
    }

    #user-input {
        flex: 1;
        padding: 20px;
        background-color: #3c3c3c;
        color: #ffffff;
        border-radius: 20px;
        margin-left: 1px;
        text-align: left;
        height: 10px;
    }

    .custom-file-container {
        position: fixed;
        top: 10%;
        left: 20px;
        background-color: #3939398a;
        border: 1px solid #ffffff6b;
        padding: 7px;
        border-radius: 9px;
        display: none;
        flex-direction: column;
        gap: 10px;
        z-index: 50;
    }

    .custom-file-label:hover {
        filter: brightness(1.6)
    }

    .custom-file-label {
        background-color: rgb(0 0 0 / 71%);
        color: white;
        cursor: pointer;
        border-radius: 50%;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
        display: table;
        justify-content: center;
        align-items: center;
        width: 30px;
        height: 30px;
    }
        .custom-file-label img {
            width: 33px !important;
            height: 33px !important;
        }
    /* زر القائمة (☰) */
    .menu-toggle {
        visibility: visible;
        opacity: 1;
        display: block;
        position: fixed;
        top: 20px;
        left: 20px;
        background-color: #ffffff26;
        color: white;
        cursor: pointer;
        border-radius: 5px;
        padding: 10px;
        font-size: 20px;
        width:50px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
        border: none;
        z-index: 999;
    }

    /* عند تفعيل القائمة */
    .show-menu {
        display: flex !important;
    }

    .btn-secondary {
        display: none;
    }

    .modal-content {
        background-color: #161616cc;
        font-family: "Orbitron", serif;
        color: white;
        margin: 5% auto;
        font-size: 10px;
        padding: 15px;
        padding-bottom: 5%;
        border: 1px solid #888;
        width: 90%;
        max-width: 300px;
        border-radius: 10px;
        display: grid;
        gap: 6px;
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        justify-content: center;
    }

    .model-btn {
        width: 100px;
        height: 40px;
        font-size: 10px;
        padding: 5px;
        border-radius: 5px;
        background: linear-gradient(3deg, #2067dd, #ff00a500, #ff00a500);
    }

    #add-to-home-screen {
        display: block !important; 
    }
    .modal-content h3 {
        text-align: center;
        margin-top: auto;
        font-size: small;
        font-family: "Orbitron", serif;
    }
}
}
