:root {
    --primary-color: #5c6bc0;
    --secondary-color: #e0e0e0;
    --tertiary-color: #f4f7f6;
    --gradient-color: linear-gradient(to right, #385bd0, #354987);
    --upload-button-color: #f0eeff;

    --blue-violet: #913dff;
    --next-button-color: rgb(232, 107, 134);

    --builder-header: #3e4b6d;
    --font: #3e4b6d;
    --use-this-template: linear-gradient(to bottom, var(--builder-header), var(--font));
    ;
}

.sum-main {
    font-family: Poppins;
    background-color: transparent !important;
    display: flex;
    justify-content: center;
    align-items: center;
    /* height: 100vh; */
    margin: 0;
    flex-direction: column;
    padding: 20px;

}

/* -------------------------------- lang legend div ---------------------------- */
.lang-legend-div {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    width: 100%;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

/* -------------------------------- language dropdown ---------------------------- */
.dk-translation-box {
    display: flex;
    align-items: center;
    gap: 10px;

}

.dk-language-select {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 7px;
    padding: 9.5px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 151px;
}

.dk-language-select:hover {
    border-color: #e78799;
    box-shadow: 0 2px 8px rgba(231, 135, 153, 0.1);
}


.dk-language-icon {
    display: flex;
    align-items: center;
    justify-content: center;


}

.dk-language-text {
    font-size: 14px;
    color: #606060;

}

.dk-arrow {
    margin-left: auto;

    transition: transform 0.2s ease;
}

.dk-language-select.dk-active .dk-arrow {
    transform: rotate(180deg);
}

.dk-dropdown {
    display: none;
    position: absolute;
    top: 120%;
    left: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    width: 100%;
    /* padding: 5px 0; */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.dk-dropdown.dk-show {
    display: block;
    animation: dkFadeIn 0.2s ease;
}

.dk-dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #606060;
}

.dk-dropdown-item:hover {
    background-color: rgba(231, 135, 153, 0.1);
}

@keyframes dkFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dk-dropdown-item.dk-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f0f0f0;
}

.dk-custom-language {
    padding: 8px;
    border-top: 1px solid #eee;
}

.dk-custom-input {
    width: 100%;
    padding: 6px;
    border: .5px solid #ddd !important;
    border-radius: 4px;
    font-size: 14px;
}

.dk-custom-input:focus {
    outline: none;
    border-color: #E24668;
}

.upload-container {
    background-color: #FDFDFD;
    border-radius: 4px;
    width: 500px;
    padding: 20px;
    text-align: center;
    border: 1px solid #D1D1D1 !important;
}

.upload-container h2 {
    margin-bottom: 20px;
    font-size: 20px;
}

.upload-box {
    border: 2px dashed #D9D9D9;
    padding: 20px;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    background-color: #F8F9FA;
}

.upload-box label {
    display: block;
    cursor: pointer;
}

.upload-box input[type="file"] {
    display: none;
}


.upload-text {
    margin-top: 8px;
    color: #333;
    font-size: 14px;
}

.supported-formats {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    margin-bottom: 19px;

}

.text-area-container {
    margin-top: -10px;
}

.text-area-container-unlimit {
    margin-top: 17px;
}

.text-area-container label {
    font-size: 14px;
    color: #333;
    display: block;
    margin: 0 10px;
}

.eller-div {
    margin-bottom: 17px;
    display: flex;
    align-items: center;
}

.eller-div hr {

    flex: 1;
    border: none;
    border-top: 1px solid #ccc;

}

.text-area-container #inputText {
    width: 100%;
    height: 100px;
    padding: 10px;
    border-radius: 8px;
    resize: none;
    font-size: 14px;
    border: 1px solid #ccc !important;
    height: auto;
    min-height: 162px;
    max-height: 162px;
    /* overflow-y: scroll; */
}

.text-area-container #inputText:focus {
    outline: none;
    border-color: #aaa;
}

.upload-title {
    font-size: 18px;
    font-weight: 500;
    color: #4A4A4A;
}

.upload-instructions {
    font-size: 14px;
    color: #B3B3B3;
}

/* ++++++++++++++++++++++++++++++++++++++ input feild styling +++++++++++++++++++++++++++++++++ */
#inputText {
    color: #414141 !important;
    background-color: #FFF !important;
    font-family: Poppins !important;
    height: auto;
    overflow: hidden;
    position: relative;
    font-size: 16px;
    outline: none;
    margin-bottom: 0 !important;
    text-align: left;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    width: 100%;
    padding: 16px;
    /* word-break: break-all !important; */
}

#inputText * {
    color: #414141 !important;
    background-color: #FFF !important;
    font-family: Poppins !important;
    font-size: 16px !important;
    text-align: left !important;
    /* border: none !important; */
    line-height: 25px;
}

#inputText blockquote {
    border-left: 3px solid !important;
}

/* Placeholder styling */
#inputText.is-empty::before {
    content: attr(placeholder);
    position: absolute;
    top: 0;
    left: 0;
    padding: inherit;
    color: #888 !important;
    pointer-events: none;
}

/* Force empty elements to minimum height */
#inputText.is-empty {
    height: auto !important;

}


.text-area ul,
.text-area .editor-list {
    list-style-type: disc !important;
    margin-left: 20px !important;
    padding-left: 20px !important;
}

.text-area ol {
    list-style-type: decimal !important;
    margin-left: 20px !important;
    padding-left: 20px !important;
}

.text-area li,
.text-area .editor-list-item {
    display: list-item !important;
    list-style-position: outside !important;
}

.text-area p {
    /* margin: 0 !important; */
}

.bot-message:first-of-type .markdown-body-chat p:first-of-type {
    margin: 0;
}

.markdown-body-chat li>p {
    margin-top: 16px;
}

.markdown-body-chat table,
.markdown-body table {
    width: 100% !important;
}

#inputText .markdown-body table tr {
    background-color: #FFFFFF !important;
}

.markdown-body-chat h1,
.markdown-body-chat h2,
.markdown-body-chat h3,
.markdown-body-chat h4,
.markdown-body-chat h5,
.markdown-body-chat h6,
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {

    border-bottom: none !important;
}



.markdown-body {
    padding: 0;
    max-width: 100%;
    font-family: Poppins;
    background-color: #FFFFFF;
    color: #414141;
}

.markdown-body-chat *,
.markdown-body * {
    font-size: 16px !important;
}

.markdown-body-chat {
    padding: 0;
    max-width: 100%;
    font-family: Poppins;
    background-color: #f8f9fa;
    color: #2c3e50;
}



.output-container {
    margin-top: 20px;
    width: 400px;
    text-align: left;
}

.output-container h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

#file-name {
    display: inline-block;
    margin-bottom: 4px;
    color: #434343;
    font-size: 14px;
}

.remove-file-button {
    background: transparent;
    border: none;
    color: #E24668;
    font-size: 16px;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.remove-file-button:hover {
    color: #f83962;
}



/*========================================= summary =========================================*/
.summary-container {
    background-color: #fff;
    border-radius: 4px;
    border: 1px solid #d1d1d1;
    overflow: hidden;
    width: 85%;
    height: 60%;
    text-align: center;
    padding-bottom: 0 !important;
}


.tab-container {
    display: flex;
    border-bottom: 1px solid #d1d1d1;

}

.tab-hr {
    border: none;
    border-left: 3px solid #E24668;
    height: 40px;
    width: 1px;
    margin: 0;
    padding: 0;
}

.tab-button {
    flex: 1;
    padding: 18px 20px;
    background-color: #F9F9F9;
    border: none;
    cursor: pointer;
    text-align: center;
    font-size: 16px;
    transition: background-color 0.3s, color 0.3s;
    color: #666;
    position: relative;
    margin-bottom: 0 !important;
}

.tab-button:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

.tab-button:not(:last-child)::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1.2px;
    height: 30px;
    background-color: #eee;
    margin: 0;
    padding: 0;
}

.tab-button.active {
    background-color: #fff;
    color: #111111;

}


.tab-content {
    display: none;
    padding: 30px;
    background-color: #FFFFFF;
    border-top: 1px solid #d1d1d1;
    text-align: left;
    position: relative;
}



.tab-content p {
    font-size: 16px;
    line-height: 24px;
    color: #414141;

}

.summarize-button {
    background-color: #E24668;
    color: #fff;
    border: none;
    padding: 10px 20px;
    margin-top: 20px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 16px;
    transition: background-color 0.3s;
}

.summarize-button:hover {
    background-color: #0056b3;
}






#custom-summary {
    padding: 0;
}

/* ------------------- loader---------------------------- */
.loader {
    border: 4px solid #f3f3f3;

    margin: 40px auto;
    display: none;
}

/* ------------------------- action buttons styling  ------------------------ */
.action-buttons {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.icons {
    padding-bottom: 0;
    margin-bottom: 0;
}


/* ---------------------- new summary text ----------------------- */
#new-summary-text:hover {
    text-decoration: underline;
}


.custom-prompt-container {
    display: flex;
    margin-bottom: 15px;
}

#custom-prompt {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px 0 0 4px;
}

#generate-custom-summary {
    padding: 10px 15px;
    background-color: #e24668;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

#generate-custom-summary:hover {
    /* background-color: #c02d51; */
    background-color: hsl(347, 73%, 48%);
}


.write-applicationDiv {
    /* background-color: white;
    border: 1px solid #ccc; */
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    background-image: var(--next-button-color);
    background-color: white;
    color: white;
    border: 1px solid rgba(128, 128, 128, 0.7) !important;
}

.next-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    background-image: var(--next-button-color);
    padding: 12px 40px;
    color: white;
    border-radius: 5px;
    margin-top: 20px;
    transition: transform 0.1s ease, box-shadow 0.3s ease, filter 0.3s ease;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
}

.charCount {
    display: none;
    width: 100%;
    justify-content: flex-end;
    padding-right: 10px;
    margin-top: 7px;
    color: #606060;
    font-size: 14px;
}

.uploadMax {
    display: none;
    width: 100%;
    justify-content: flex-end;
    padding-right: 10px;
    margin-top: 5px;
    color: #606060;
    font-size: 14px;
    margin-bottom: 12px;
}




/*--------------------------------------- responsive --------------------------- */


@media (max-width: 600px) {
    .sum-main {
        padding: 20px;
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }

    .upload-container,
    .summary-container {
        width: 100%;
        max-width: 500px;
        padding: 20px;
        box-sizing: border-box;
    }

    .upload-box {
        padding: 15px;
    }

    .text-area-container textarea {
        width: 100%;
        box-sizing: border-box;
    }

    .tab-container {
        flex-wrap: wrap;
    }

    .tab-button {
        flex: 1 0 calc(50% - 5px);
        margin: 2.5px;
        font-size: 12px;
    }

    .action-buttons {
        /* flex-wrap: wrap; */
    }

    .copy-button,
    .download-button {
        /* flex: 1 0 calc(50% - 5px); */
        /* margin: 2.5px; */
    }

    .custom-prompt-container {
        flex-direction: column;
    }

    #custom-prompt,
    #generate-custom-summary {
        width: 100%;
        box-sizing: border-box;
        border-radius: 4px;
        margin-bottom: 10px;
    }

    .upload-container,
    .summary-container {
        width: 100%;
    }

    .tab-button {
        flex: 1 0 100%;
        margin: 2.5px 0;
    }

    .copy-button,
    .download-button {
        /* flex: 1 0 100%; */
        /* margin: 5px 0; */
    }
}

@media (max-width: 400px) {
    .sum-main {
        padding: 20px;
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }

    .upload-container,
    .summary-container {
        width: 100%;
        max-width: 500px;
        padding: 20px;
        box-sizing: border-box;
    }

    .upload-box {
        padding: 15px;
    }

    .text-area-container textarea {
        width: 100%;
        box-sizing: border-box;
    }

    .tab-container {
        flex-wrap: wrap;
        flex-direction: column;
    }

    .tab-button {
        flex: 1 0 calc(50% - 5px);
        margin: 2.5px;
        font-size: 12px;
    }

    .action-buttons {
        /* flex-wrap: wrap; */
    }

    .copy-button,
    .download-button {
        /* flex: 1 0 calc(50% - 5px); */
        /* margin: 2.5px; */
    }

    .custom-prompt-container {
        flex-direction: column;
    }

    #custom-prompt,
    #generate-custom-summary {
        width: 100%;
        box-sizing: border-box;
        border-radius: 4px;
        margin-bottom: 10px;
    }

    .sum-main {
        padding: 10px;
    }

    .upload-container,
    .summary-container {
        padding: 15px;
    }

    h2 {
        font-size: 18px;
    }

    .upload-text,
    .supported-formats {
        font-size: 12px;
    }
}

/* ------------------------------------- lower controls --------------------------- */

/* ------------------------------- Correction options ----------------------------- */


.option-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 13px;
    font-size: 14px;
    color: #414141;
    border: none;
    background: #F6F6F6;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s;
}


/* Correction options */
.correction-options {

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    margin-top: 34px;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: #FDFDFD;
    border-radius: 7.5px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid #E6E6E6;
    padding: 10px;

}

.options-row {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 13px;
    font-size: 14px;
    color: #414141;
    border: none;
    background: #F6F6F6;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s;
}

.option-btn:hover {
    background-color: #f9fafb;
    color: #1f2937;
}

.option-btn:hover {
    background-color: #f9fafb !important;
    color: #1f2937 !important;
}

.option-btn:focus {
    background-color: #f9fafb !important;
    color: #1f2937 !important;
}

.divider {
    color: #e5e7eb;
}

/* ------------------------------------ restart btn -------------------------------------- */
.restart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    margin-top: 29px;
    background-color: #FDFDFD;
    text-align: center;
    text-underline-position: from-font;
    text-decoration-skip-ink: none;
    width: fit-content;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
    border: 1px solid grey;
    opacity: 0.7;
    font-family: Poppins;
    font-size: 16px;
    font-weight: 400;
    line-height: 25.2px;
    color: black;
    text-underline-position: from-font;
    text-decoration-skip-ink: none;
    padding: 12px 40px;
    border-radius: 5px;
    cursor: pointer;
}

.restart-btn span {
    margin-right: 10px;
}


/* ----------------- mic CSS ----------------- */
.lucide-mic.listening-glow {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        filter: drop-shadow(0 0 5px #28a745);
    }

    50% {
        filter: drop-shadow(0 0 15px #28a745);
    }

    100% {
        filter: drop-shadow(0 0 5px #28a745);
    }
}

/* ------------------------------- mic loader ----------------------------------- */
#stopBtn:focus,
#pausePlayBtn:focus,
#downloadBtn:focus {
    background-color: transparent !important;
}

#stopBtn:hover,
#pausePlayBtn:hover,
#downloadBtn:hover {
    background-color: transparent !important;
}

#stopBtn,
#pausePlayBtn {
    padding: 0 !important;
}

.sdownload-class {
    padding: 0 !important;
}


/* 
.loader {
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-top-color: #414141;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
} */

.loader1 {
    display: flex;
    align-items: center;
    margin-right: 6px;
}

.dotted-loader {
    position: relative;
    width: 16px;
    height: 20px;

}

.dotted-loader .dot {
    position: absolute;
    width: 3px;
    height: 3px;
    background-color: #888;
    border-radius: 50%;
    animation: fade 1s linear infinite;
    transform-origin: 10px 10px;
}

/* Create 8 dots positioned in a circle */
.dotted-loader .dot:nth-child(1) {
    transform: rotate(0deg) translateX(8px);
    animation-delay: 0s;
}

.dotted-loader .dot:nth-child(2) {
    transform: rotate(45deg) translateX(8px);
    animation-delay: 0.125s;
}

.dotted-loader .dot:nth-child(3) {
    transform: rotate(90deg) translateX(8px);
    animation-delay: 0.25s;
}

.dotted-loader .dot:nth-child(4) {
    transform: rotate(135deg) translateX(8px);
    animation-delay: 0.375s;
}

.dotted-loader .dot:nth-child(5) {
    transform: rotate(180deg) translateX(8px);
    animation-delay: 0.5s;
}

.dotted-loader .dot:nth-child(6) {
    transform: rotate(225deg) translateX(8px);
    animation-delay: 0.625s;
}

.dotted-loader .dot:nth-child(7) {
    transform: rotate(270deg) translateX(8px);
    animation-delay: 0.75s;
}

.dotted-loader .dot:nth-child(8) {
    transform: rotate(315deg) translateX(8px);
    animation-delay: 0.875s;
}

@keyframes fade {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

/* ---------------------------- new styling -------------------------------- */
#genderSelector span {
    display: flex;
    align-items: center;
    justify-content: center;
}

#genderSelector {
    padding: 7px;
}

.gender-option {
    gap: 4px;
    border-radius: 5px;
    padding: 7px 9px !important;
}

#stopBtn,
#pausePlayBtn {
    position: relative;
}

#stopBtn::after,
#pausePlayBtn::after {
    content: "";
    position: absolute;
    top: 27%;
    right: 0;
    height: 50%;
    width: 0.7px;
    background-color: #D6D6D6;
}


/* --------------------------------- download-------------------------------- */
.download-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 8px;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 200px;
    margin-top: 4px;
}

.download-option {
    padding: 8px 16px;
    cursor: pointer;
    color: #333;
    font-size: 14px;
    transition: background-color 0.2s;
}

.download-option:hover {
    background-color: #f5f5f5;
}

/* ----------------------------- chat implementation ------------------------- */
.chat-container {
    background: #ffffff;
    display: flex;
    flex-direction: column;
    margin: 20px 0;
    margin-top: 30px;
    margin-bottom: 0px;
    overflow: hidden;
}

.chat-header {
    background: #f8f9fa;
    border-bottom: 1px solid #eaeaea;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-icon {
    background: #E24668;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.chat-header-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0px 20px;
    padding-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    text-align: left;
}

.message-content {

    text-align: left;
    word-wrap: break-word;
    /* Handle long words */
}

.user-message {
    background: #E24668;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    font-size: 16px;
}

.bot-message {
    background: #f8f9fa;
    color: #2c3e50;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    text-align: left;
    padding-bottom: 32px;
}




.chat-input-container {
    padding: 16px 20px;
    border-top: 1px solid #eaeaea;
    background: #ffffff;
    color: #4A4A4A;
}

.chat-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
    /* Changed from flex-end to stretch */
    height: 100%;
    /* Set height */
    min-height: 48px;
    /* Ensure minimum height */
}


.chat-input {
    width: 100%;
    min-height: 44px;
    max-height: 120px;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    padding: 12px 40px 12px 16px;
    font-size: 14px;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    line-height: 1.4;
    overflow-y: auto;
    /* Changed from hidden to auto */
    flex: 1;
    /* Take up available space in flex container */
}


.chat-input:focus {
    border-color: #E24668;
}

/* Only show scrollbar when content overflows */
.chat-input.has-content {
    overflow-y: auto;
}

.send-button {
    background: #E24668;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 48px;
}

.send-button:focus {
    background: #E24668 !important;
    color: white;
}

.send-button:hover {
    background: #f87390;
}

.send-button:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 12px;
    align-self: flex-start;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #E24668;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}


.message-actions {
    position: absolute;

    right: 16px;
    display: flex;
    gap: 12px;
    opacity: 0.7;
    transition: opacity 0.2s;
}


.message-actions:hover {
    opacity: 1;
}

.message-action-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #666;
    font-size: 12px;
    transition: color 0.2s;
}

.message-action-btn:hover {
    color: #e24668 !important;
    background-color: transparent !important;
}

.message-action-btn:active {
    color: #666 !important;
    background-color: transparent !important;
}

.message-action-btn:focus {
    color: #666 !important;
    background-color: transparent !important;
}

.message-action-btn svg {
    width: 16px;
    height: 16px;
}

.action-success {
    color: #e24668;
}

.tts-playing {
    color: #dc3545;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}



.loader2 {
    width: 16px;
    height: 16px;
    border: 2px solid #e24668;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: none;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.tts-btn.playing {
    color: #dc3545;
    animation: pulse 1.5s infinite;
}

.tts-btn svg {
    transition: all 0.3s ease;
}

.message-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}





/* ------------------ ! */


.textarea-wrapper-sum {
    display: flex;
    position: relative;
    flex: 1;
    /* Take up available space */
    min-height: 48px;
    /* Match minimum height */
}



.mic-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    padding: 4px;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mic-icon:hover {
    opacity: 0.7;
}

.mic-icon.active {
    stroke: #E24668;
}


/* OCR Progress Styles */
.ocr-progress {
    margin: 15px 0;
    width: 100%;
}

.progress-container {
    background-color: #f0f0f0;
    border-radius: 5px;
    height: 8px;
    overflow: hidden;
    width: 100%;
    margin-bottom: 8px;
}

.progress-bar {
    background-color: #E24668;
    height: 100%;
    width: 0;
    transition: width 0.3s ease;
}

#ocr-status {
    font-size: 14px;
    color: #666;
    text-align: center;
    margin: 5px 0;
}

/* Updated supported formats text */
.supported-formats {
    font-size: 12px;
    color: #777;
    margin-top: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.format-icons {
    background-color: #EFEFEF;
    border-radius: 16px;
    padding: 4px 13px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
}


/* Large Desktop (1200px and above) */
@media screen and (min-width: 1200px) {
    .options-container {
        padding: 10px 20px;
    }

    .options-row {
        gap: 15px;
    }


}

/* Desktop and Small Laptop (992px to 1199px) */
@media screen and (max-width: 1199px) {
    .options-container {
        max-width: 95%;
    }

    .lower-container {
        width: 100% !important;
    }
}

/* Tablet Landscape (768px to 991px) */
@media screen and (max-width: 991px) {
    .options-row {
        gap: 10px;
        padding: 5px;
        justify-content: center;
    }

    .option-btn {
        flex: 0 1 auto;
    }

    .divider {
        display: none;
        /* Hide divider on smaller screens */
    }


}

/* Tablet Portrait (576px to 767px) */
@media screen and (max-width: 767px) {
    .options-container {
        padding: 7.5px;
    }

    .options-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .option-btn {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }

    /* Adjust spacing for read button icons */
    .lucide-volume-2,
    .lucide-pause {
        width: 18px;
        height: 16px;
    }

    /* Stack buttons vertically */
    .rewrite-btn {
        margin-top: 8px;
        order: -1;
        /* Move rewrite button to top on mobile */
    }

    .chat-input-wrapper {
        align-items: center;
        flex-direction: column;
    }

    .textarea-wrapper-sum {
        width: 100%;
    }

    .uploadMax {
        margin-bottom: 20px;
    }
}

/* Mobile (575px and below) */
@media screen and (max-width: 575px) {
    .correction-options {
        margin-top: 10px;
    }

    .options-container {
        padding: 5px;
        border-radius: 8px;
    }

    .option-btn {
        font-size: 13px;
        padding: 10px;
    }

    .option-btn svg {
        width: 16px;
    }

    /* Adjust text spacing */
    .option-btn span {
        font-size: 13px;
    }
}

/* Small Mobile (360px and below) */
@media screen and (max-width: 360px) {
    .options-container {
        padding: 5px;
    }

    .option-btn {
        padding: 8px;
        font-size: 12px;
    }

    .option-btn svg {
        width: 14px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .option-btn {
        min-height: 44px;
        /* Better touch target */
        padding: clamp(12px, 1.5vw, 16px);
    }

    /* Increase tap target area */
    .option-btn+.option-btn {
        margin-top: 8px;
    }
}



/* Ensure proper button behavior when keyboard is visible */
@media screen and (max-height: 500px) {
    .options-container {
        position: static;
        transform: none;
    }

    .options-row {
        flex-wrap: wrap;
        flex-direction: row;
    }

    .option-btn {
        flex: 1 1 auto;
        min-width: 120px;
    }
}

/* High DPI Screens */
@media screen and (min-resolution: 192dpi) {
    .option-btn svg {
        stroke-width: 1.25;
    }
}

/* Print Styles */
@media print {
    .correction-options {
        display: none !important;
    }
}






@media screen and (max-width: 767px) {
    .options-container {
        padding: 7.5px;
    }

    .options-row {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
        gap: 8px;
        padding: 5px;
    }

    /* Base styles for all buttons */
    .option-btn {
        width: 100%;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 12px;
        white-space: nowrap;
        background-color: white;
        border: 1px solid #E6E6E6;
        border-radius: 6px;
        margin: 0 !important;
        box-sizing: border-box;
    }

    /* Explicit order for each button */
    #copyBtn {
        order: 1;
    }

    #readBtn {
        order: 2;
    }

    #undoBtn {
        order: 3;
    }

    .rewrite-btn {
        order: 3;
        background-color: #FCEDF0;
        color: #E24668;
    }

    /* Remove the divider */
    .divider {
        display: none;
    }

    /* Consistent icon styling */
    .option-btn svg {
        width: 16px;
        height: 16px;
        margin-right: 8px;
        flex-shrink: 0;
    }

    /* Consistent text styling */
    .option-btn span {
        font-size: 14px;
        line-height: 1;
        white-space: nowrap;
    }

    .chat-input-container {
        padding: 16px 0;
    }

    .send-button {
        justify-content: center;
        width: 100%;
    }

    .message-actions {
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        /* Remove right positioning */
    }

    .preview-btn,
    .remove-btn {
        width: 50px !important;
    }
}

/* Touch optimization */
@media (hover: none) and (pointer: coarse) {
    .option-btn {
        min-height: 44px;
        height: 44px;
    }
}



@media screen and (max-width: 399px) {
    .options-row {
        grid-template-columns: 1fr;
        /* Single column layout */
        grid-template-rows: auto;
        /* Adjust rows based on content */
        gap: 8px;
        /* Maintain spacing between buttons */
        padding: 5px;
    }
}


/* ! testing code css */





.remove-file-button {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    color: #E24668;
    font-size: 18px;
    background: none;
    border: none;
}

/* Upload Progress Container */
.uploading-container {
    border: 2px dashed #D9D9D9;
    border-radius: 8px;
    padding: 20px 20px;
    text-align: center;
    background-color: #F8F9FA;
}

.upload-status-icon img {
    width: 80px;
    height: auto;
}

.uploading-container p {
    color: #434343;
    margin: 0 !important;
    font-weight: 400;
}

.uploading-container-inner {

    display: flex;
    flex-direction: column;
    flex: 1;

}

/* Success Container */
.success-container {
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background-color: #F8F9FA;
    margin-bottom: 20px;
    border: 2px dashed #D9D9D9;
}

.success-icon img {
    width: 80px;
    height: auto;
}

.success-container p {
    color: #414141;
    margin: 0;
    font-weight: normal;
}

.success-text {
    color: #4CAF50;
}

.file-preview-success,
.file-preview {
    display: flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 10px;
    background-color: #f5f5f5;
    margin-top: 9px;
    border: 1px solid #B2B2B2;
}

#success-file-name {
    margin: 0 !important;
}

.file-icon {
    width: 50px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.file-icon img {
    width: 40px;
    height: auto;
}

.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-info-success {
    display: flex;
    flex-direction: column;
    flex: 1;
    align-items: flex-start;
}

.file-name-preview {
    font-size: 14px;
    color: #979797;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
}

.file-size {
    font-size: 12px;
    color: #B2B2B2;
}

.file-actions,
.file-remove {
    display: flex;
    gap: 4px;
}

.preview-btn,
.remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 0;
}

.preview-btn:focus {
    background: none;
}

.preview-btn:hover {
    background-color: #e6e6e6;
}

.remove-btn {
    color: #E24668;
    font-size: 18px;
}

.remove-btn:hover {
    background-color: #ffebee;
}

/* Progress Bar Styles */
.progress-container {
    width: 100%;
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0;
    background-color: #E86083;
    transition: width 0.3s ease;
}

/* OCR Progress */
.ocr-progress {
    margin-top: 15px;
    padding: 15px;
    background-color: #f8f8f8;
    border-radius: 10px;
}

#ocr-status {
    margin-top: 10px;
    font-size: 14px;
    color: #555;
}


/* Loading and Error States */
.loading {
    text-align: center;
    padding: 20px;
    color: #555;
}

.loading:after {
    content: "...";
    animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {

    0%,
    20% {
        content: ".";
    }

    40% {
        content: "..";
    }

    60% {
        content: "...";
    }

    80%,
    100% {
        content: "";
    }
}

.error {
    color: #E24668;
    text-align: center;
    padding: 20px;
}

/* File modal preview */
.file-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.file-preview-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.close-preview {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 30px;
    cursor: pointer;
}

/* Formatted content for summary */
.formatted-content {
    line-height: 1.6;
}

.formatted-content h2 {
    color: #333;
    margin-bottom: 20px;
}

.formatted-content ul {
    margin-left: 20px;
}

.formatted-content li {
    margin-bottom: 10px;
}

.disabled-input {
    background-color: #f1f1f1;
    cursor: not-allowed;
    opacity: 0.7;
}

.markdown-body-chat ul,
.markdown-body-chat ol {
    margin: 15px 0 15px 20px;
}

.markdown-body-chat hr {
    background-color: transparent;
    border: none;
}


.loader-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    animation: fadeIn 0.3s ease-in-out;
    border-radius: 8px;
}



/* bubble loader  */
.bubble-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    gap: 8px;
}

.bubble {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ff9daf;
    animation: bubble-animation 1.8s ease-in-out infinite;
}

.bubble:nth-child(2) {
    animation-delay: 0.2s;
}

.bubble:nth-child(3) {
    animation-delay: 0.4s;
}

.bubble:nth-child(4) {
    animation-delay: 0.6s;
}

@keyframes bubble-animation {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.3;
    }

    50% {
        transform: scale(3);
        opacity: 0.8;
    }
}

/* Optional ripple effect */
.bubble::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #ff9daf;
    opacity: 0.7;
    animation: ripple 1.8s ease-in-out infinite;
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.loader-text {
    font-family: Poppins;
    color: #414141;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 19px;
}

.char-limit-warning-red {
    color: #E24668 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
}

.eller-div {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 20px 0;
}

.eller-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(74, 74, 74, 0.05) 25%,
            rgba(74, 74, 74, 0.15) 50%,
            rgba(74, 74, 74, 0.05) 75%,
            transparent 100%);
    z-index: 0;
}

#eller-label {
    padding: 0 20px;
    font-size: 16px;
    color: #5f5f5f;
    background-color: #FDFDFD;
    z-index: 1;
    position: relative;
}