.mobile-tabs {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom);
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: none;
    font-size: 1rem;
    color: #666;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.tab-btn i {
    font-size: 1.2rem;
}

.tab-btn.active {
    color: var(--primary-color);
    background: #f5f5f5;
    font-weight: 600;
}

@media (max-width: 768px) {
    .mobile-tabs {
        display: flex;
    }

    #mainContainer {
        display: block;
        margin: 16px;
        box-sizing: border-box;
    }

    * {
        box-sizing: border-box;
    }

    .mobile-hidden {
        display: none !important;
    }

    #chatContainer, #rightSidebar {
        width: 100% !important;
        margin: 0 !important;
        min-width: 100% !important;
    }

    #rightSidebar {
        height: auto;
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    #rightSidebar .container {
        padding: 24px 20px;
        margin-bottom: 0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    }

    #filesSidebar {
        min-height: 200px;
    }

    #chatBox {
        height: calc(100vh - 400px);
        min-height: 200px;
        max-height: none;
    }

    .container {
        padding: 20px 16px;
        border-radius: 16px;
    }

    .title {
        font-size: 1.8rem;
    }

    .button, #sendBtn {
        padding: 10px;
        width: 50% !important;
    }

    #sendBtn {
        color: transparent;
        -webkit-text-fill-color: transparent;
        position: relative;
    }

    #sendBtn::after {
        content: "↑";
        font-weight: bold;
        display: block;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        color: #FFFFFF;
        font-size: 18px;
        -webkit-text-fill-color: initial;
    }

    #chatContainer .has-text-right {
        text-align: center;
        bottom: 26px;
        right: 20px;
    }

    #sendBtn {
        width: 100%;
        margin-top: 8px;
    }

    textarea, #userInput {
        font-size: 16px;
    }

    #typeModal > div {
        min-width: auto;
        width: 90vw;
        padding: 24px 20px;
    }

    #customModal > div {
        min-width: auto;
        width: 90vw;
        padding: 24px 20px;
    }

    .file-bubble-small {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    /* --- RTL (Arabic) Mobile Support --- */
    .rtl #inputWrapper {
        left: 50%;
        transform: translateX(-50%);
    }

    .rtl #inputWrapper .has-text-right {
        right: auto;
        left: 26px;
    }

    .rtl .tab-btn {
        flex-direction: column;
    }

    #expirationNotice {
        margin-bottom: 100px;
    }
}
