@media(max-width:900px){

    .auth-page{

        grid-template-columns:1fr;

    }

    .auth-left{

        padding:40px;

        text-align:center;

    }

}

@media(max-width:900px){

    .chat-sidebar{

        display:none;

    }

}



/*==================================================
    BUBBLES
==================================================*/
@media (max-width:768px){
.bubble{

    max-width:100%;

    padding:10px 15px;

    border-radius:18px;

    line-height:1.7;

    word-break:break-word;

    box-shadow:0 3px 12px rgba(0,0,0,.05);

}


}

/*==================================================
    HOME PAGE RESPONSIVE
==================================================*/

@media (max-width:768px){

.hero{

    min-height:auto;

    padding:70px 20px;

}

.hero h1{

    font-size:38px;

}

.hero-text{

    font-size:17px;

}

.hero-buttons{

    flex-direction:column;

    align-items:center;

}

.hero-buttons a{

    width:100%;

    max-width:320px;

}


.chat-page{
    height:100vh;
    overflow:hidden;
}


.chat-main{

    display:flex;

    flex-direction:column;

    height:100vh;

    overflow:hidden;

}

/* Chat message font size */
.chat-messages .bubble{
    font-size:14px;
    line-height:1.6;
}

/* Paragraphs inside AI responses */
.chat-messages .bubble p{
    font-size:14px;
    line-height:1.6;
    margin-bottom:10px;
}

/* Lists */
.chat-messages .bubble li{
    font-size:14px;
    line-height:1.6;
}

/* Headings inside AI response */
.chat-messages .bubble h1,
.chat-messages .bubble h2,
.chat-messages .bubble h3{
    font-size:16px;
}


.header-icon svg{

    width:12px;
    height:12px;

}

}


@media (max-width:768px){

    .admin-page{
        display:flex;
        flex-direction:column;
        width:100%;
        min-height:100vh;
        overflow-x:hidden;
    }

    .admin-main{
        width:100%;
        padding:15px;
        overflow-x:hidden;
    }

}

@media (max-width:768px){

.admin-sidebar{
    width:100%;
    height:auto;
    padding:15px;
    border-right:none;
    border-bottom:1px solid #ddd;
}

.admin-menu{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}

.admin-menu a{
    flex:1 1 calc(50% - 8px);
    justify-content:center;
    text-align:center;
}

.table-responsive{
    width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
}

table{
    min-width:700px;
}

}


@media (max-width:768px){

.stats-grid{
    grid-template-columns:1fr;
}

}

@media (max-width:768px){

.admin-header{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:10px;
}

}

/*=========================================
    PENDING ACTIVATION MOBILE
=========================================*/

@media (max-width:768px){

.pending-page{
    padding:20px 15px;
    min-height:100vh;
    align-items:flex-start;
}

.pending-card{
    width:100%;
    max-width:100%;
    padding:25px 20px;
    border-radius:18px;
}

.pending-icon{
    width:80px;
    height:80px;
    font-size:40px;
    margin-bottom:20px;
}

.pending-card h1{
    font-size:26px;
    line-height:1.3;
    margin-bottom:15px;
}

.pending-card p{
    font-size:15px;
    line-height:1.7;
}

.settings-card{
    padding:18px;
    margin-top:20px;
}

.settings-card h3{
    font-size:18px;
    margin-bottom:15px;
    text-align:center;
}

.detail-row{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:6px;
    padding:12px 0;
}

.detail-row strong{
    font-size:14px;
}

.detail-row span{
    font-size:15px;
    color:#555;
    word-break:break-word;
}

.alert{
    font-size:14px;
    line-height:1.7;
    padding:16px;
}

.btn-primary{
    width:100%;
    justify-content:center;
    padding:16px;
    font-size:16px;
    margin-top:20px;
}

}

/*=========================================
    SETTINGS - MOBILE
=========================================*/
@media (max-width:768px){
.settings-card{
    padding:20px;
    border-radius:16px;
    margin-bottom:20px;
}

.settings-card h2,
.settings-card h3{
    font-size:20px;
    margin-bottom:18px;
}

.settings-grid{
    display:grid;
    grid-template-columns:1fr;
    gap:18px;
}

.settings-card textarea{
    min-height:160px;
}

.save-settings{
    width:100%;
}

}
/*=========================================
    USER PROFILE - MOBILE
=========================================*/
@media (max-width:768px){
.user-profile{
    display:flex;
    flex-direction:column;
    gap:20px;
}

.profile-summary{
    width:100%;
    padding:22px;
    border-radius:16px;
}

.profile-summary .avatar{
    width:80px;
    height:80px;
    margin:0 auto 15px;
}

.profile-summary h2{
    font-size:22px;
}

.profile-details{
    width:100%;
    padding:20px;
    border-radius:16px;
}

.detail-row{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:6px;
    padding:14px 0;
}

.detail-row strong{
    font-size:14px;
}

.detail-row span{
    font-size:15px;
    word-break:break-word;
}
}

/*=========================================
    ADMIN USERS MOBILE
=========================================*/

@media (max-width:768px){

.admin-main{
    padding:15px;
}

.admin-header{
    display:block;
    margin-bottom:20px;
}

.admin-header h1{
    font-size:24px;
}

.admin-subtitle{
    font-size:14px;
}

.table-responsive{
    width:100%;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
}

.admin-table{
    min-width:900px;
    border-collapse:collapse;
}

.admin-table th,
.admin-table td{
    white-space:nowrap;
}

}

/*==================================================
    CHAT RESPONSIVE
==================================================*/

@media(max-width:900px){

    .chat-page{

        grid-template-columns:1fr;

    }

    .bubble{

        max-width:92%;

    }

}


/*==================================================
    MOBILE
==================================================*/

@media(max-width:768px){

    h1{

        font-size:32px;

    }

    h2{

        font-size:26px;

    }

    .stats-grid{

        grid-template-columns:1fr;

    }

    .settings-grid{

        grid-template-columns:1fr;

    }

    .user-profile{

        grid-template-columns:1fr;

    }

    .detail-row{

        flex-direction:column;

        gap:6px;

    }

    .pending-card{

        padding:35px;

    }

}



/*==================================================
    MOBILE CHAT - CONTENT OVERFLOW FIX
==================================================*/

@media (max-width:768px){

    /* Prevent flex children from creating horizontal overflow */
    .chat-messages,
    .user,
    .hope,
    .bubble,
    .message-text{
        min-width:0;
        max-width:100%;
    }


    /* AI and user bubbles must contain their content */
    .bubble{

        box-sizing:border-box;

        overflow:hidden;

        overflow-wrap:anywhere;

        word-wrap:break-word;

        word-break:break-word;

    }


    /* Message content */
    .message-text{

        width:100%;

        max-width:100%;

        min-width:0;

        overflow-wrap:anywhere;

        word-wrap:break-word;

        word-break:break-word;

    }


    /* Paragraphs */
    .message-text p{

        max-width:100%;

        overflow-wrap:anywhere;

        word-break:break-word;

    }


    /* Lists */
    .message-text ul,
    .message-text ol{

        max-width:100%;

        overflow-wrap:anywhere;

        word-break:break-word;

        padding-left:20px;

    }


    .message-text li{

        max-width:100%;

        overflow-wrap:anywhere;

        word-break:break-word;

    }


    /*==================================================
        RESPONSIVE MARKDOWN TABLES
    ==================================================*/

    .message-text table{

        display:block;

        width:100% !important;

        max-width:100%;

        overflow-x:auto;

        overflow-y:hidden;

        border-collapse:collapse;

        -webkit-overflow-scrolling:touch;

        margin:15px 0;

    }


    .message-text table th,
    .message-text table td{

        white-space:normal;

        word-break:break-word;

        overflow-wrap:anywhere;

        min-width:100px;

        padding:8px 10px;

        vertical-align:top;

    }


    /* Keep the table itself from forcing the chat wider */
    .message-text table tr{

        max-width:100%;

    }


    /*==================================================
        CODE
    ==================================================*/

    .message-text pre{

        display:block;

        width:100%;

        max-width:100%;

        box-sizing:border-box;

        overflow-x:auto;

        overflow-y:hidden;

        white-space:pre-wrap;

        word-break:break-word;

        overflow-wrap:anywhere;

        -webkit-overflow-scrolling:touch;

    }


    .message-text code{

        max-width:100%;

        overflow-wrap:anywhere;

        word-break:break-word;

    }


    /*==================================================
        LONG LINKS / URLs
    ==================================================*/

    .message-text a{

        max-width:100%;

        overflow-wrap:anywhere;

        word-break:break-word;

    }


    /*==================================================
        IMAGES
    ==================================================*/

    .message-text img{

        max-width:100%;

        height:auto;

        display:block;

    }


    /*==================================================
        HEADINGS
    ==================================================*/

    .message-text h1,
    .message-text h2,
    .message-text h3,
    .message-text h4{

        max-width:100%;

        overflow-wrap:anywhere;

        word-break:break-word;

    }


    /*==================================================
        HORIZONTAL RULE
    ==================================================*/

    .message-text hr{

        max-width:100%;

        border:0;

        border-top:1px solid var(--border);

    }

}
