@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&family=Open+Sans:wght@400;500&family=Fira+Code:wght@400;500&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
}
:root {
    --background-color: #1d1e20;
    --text-color: #e0e0e0;
    --secondary-bg: #252525;
    --accent-color: #ff6b6b;
    --background-opacity: 1;
}
body {
    height: 100vh;
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    overflow: hidden;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    background: #1d1e20;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}
.modal-content,
.settings-modal-content,
.chat-container,
.sidebar {
    background-color: rgba(29, 30, 32, var(--background-opacity));
    transition: background-color 0.3s ease;
}
button,
.upgrade-btn2,
.manage-btn,
.connect-btn,
.change-btn,
.apply-btn,
.reset-btn,
.reset-all-btn,
.theme-btn.active,
.switch input:checked + .slider {
    background: var(--accent-color);
}

.settings-item label,
.language-setting span,
.user-info .username,
.user-info .email {
    color: var(--text-color);
}

body.no-animations ,
body.no-animations :before,
body.no-animations :after {
    transition: none !important;
    animation: none !important;
}
.container {
    display: flex;
    height: 3vh;
    width: 100%;
    background: #1D1E20;
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar {
    width: 250px;
    background: #1D1E20;
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease, background 0.3s;
    position: relative;
    z-index: 10;
    border-right: 1px solid #333;
}

.logo-image {
    width: 40px;
    height: 40px;
    transform: translateX(-1%);
    transform: translateY(-13%);
    object-fit: cover;
    border-radius: 100%;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.logo {
    font-size: 1em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}


.history-panel {
    flex: 1;
    flex-direction: column;
    overflow: hidden;
    background: #414141;
    border-radius: 15px;
    padding: 15px;
    transition: opacity 0.3s;
    max-height: calc(100vh - 100px);
    box-shadow: 0 0 20px rgba(29, 30, 32, 1);
    display: none;
}

.history-panel.active {
    display: flex;
}

.history-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.history-panel input {
    flex: 1;
    padding: 15px;
    border: 2px solid #414141;
    border-radius: 50px;
    background: #1d1e20;
    color: white;
    font-size: 1em;
    transition: box-shadow 0.2s;
}

.history-panel input:focus {
    box-shadow: 0 0 25px #414141;
    outline: none;
}

.close-btn {
    background: #414141;
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.close-btn:hover {
    background: #585656;
}

.history {
    flex: 1;
    overflow-y: auto;
}

.history::-webkit-scrollbar {
    width: 10px;
}

.history::-webkit-scrollbar-track {
    background: #252525;
    border-radius: 10px;
}

.history::-webkit-scrollbar-thumb {
    background: #606060;
    border-radius: 10px;
}

.history::-webkit-scrollbar-thumb:hover {
    background: #707070;
}

.history-item {
    padding: 15px;
    margin-bottom: 10px;
    background: #404040;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-item:hover {
    background: #505050;
    transform: translateX(5px);
}

.header {
    padding: 15px 20px;
    background: var(--background-color);
    color: darkgray;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: opacity 0.3s;
    position: relative;
}

.header.hidden {
    opacity: 0;
    pointer-events: none;
}

.upgrade-btn {
    background: #1d1e20;
    color: white;
    border: none;
    padding: 8px 12px;
    transform: translateY(-40%);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9em;
}

.upgrade-btn:hover {
    background: #585656;
    transform: translateY(-40%);
}

.menu-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 4px;
    flex-wrap: wrap;
    max-width: 60%;
}

.menu-bar select {
    padding: 6px 8px;
    border-radius: 8px;
    background: #414141;
    color: white;
    border: none;
    font-size: 0.85em;
    transition: background 0.2s;
}

.menu-bar select:hover {
    background: #0d47a1;
}

.status {
    font-size: 1em;
    padding: 4px 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    transform: translateY(-40%);
    text-shadow: 0 0 6px rgba(255,255,255,0.4);
}

.menu-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1em;
    transform: translateY(-50%);
    cursor: pointer;
    padding: 6px;
    transition: transform 0.2s;
    position: absolute;
    right: 20px;
    top: 50%;
    
}

.menu-btn:hover {
    transform: rotate(90deg);
    transform: translateY(-50%);
}

#statusContainer {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 70%;
    flex-wrap: nowrap;
}

.menu-dropdown {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    background: #333;
    border-radius: 10px;
    width: 200px;
    max-width: calc(100vw - 120px); 
    z-index: 10;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.menu-dropdown.active {
  display: block;
  opacity: 1;
  transform: scale(1);
}

.menu-dropdown button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 50%;
    padding: 15px 20px;
    border: none;
    background: none;
    cursor: pointer;
    color: #e0e0e0;
    font-size: 0.9em;
    transition: background 0.2s;
}

.menu-dropdown button:hover {
    background: #404040;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
    height: 100%;
    padding-bottom: 100px;
    background: transparent;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #1D1E20;
    position: relative;
    max-height: calc(100vh - 200px);
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 12px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #1D1E20;
    border-radius: 12px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #1D1E20;
    border-radius: 12px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #1D1E20;
}

.message {
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    position: relative;
    transition: transform 0.3s ease;
}

.message.user {
    justify-content: flex-end;
}

.message.bot {
    justify-content: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 15px 20px;
    border-radius: 15px;
    background: #1D1E20;
    color: #e0e0e0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.message-text {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    word-wrap: break-word;
    font-size: 1em;
    white-space: pre-wrap;
    text-align: left;
    line-height: 1.5;
}

.message.user .message-content {
    background: #585656;
    color: white;
    font-size: 1em;
}

.message-content:hover {
    transform: scale(1.05) rotateY(0deg);
    box-shadow: 0 0 25px #1d1e20;
}

.thought-process {
    background: #585656;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 2px 10px rgba(29, 30, 32, 1);
    overflow: hidden;
    border: 1px solid #404040;
    width: 50%;
    margin: 0 auto;
    box-sizing: border-box;
}

.thought-header {
    padding: 15px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    color: #e0e0e0;
    font-size: 1em;
    font-weight: 600;
    background: linear-gradient(90deg, #121212, #121212);
    transition: background 0.3s ease;
}

.thought-content {
    max-height: 0;
    overflow-y: auto;
    transition: max-height 0.5s ease, opacity 0.3s ease;
    opacity: 0;
}

.thought-content.expanded {
    max-height: 500px;
    padding: 10px 15px;
    opacity: 1;
}

/* Sentiment Heatmap Overlay */
.sentiment-heatmap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.predictive-suggestions {
    position: absolute;
    bottom: 60px;
    left: 20px;
    right: 20px;
    background: rgba(29, 30, 32, 0.9);
    border-radius: 10px;
    padding: 10px;
    color: #e0e0e0;
    box-shadow: 0 0 15px rgba(255, 255, 255, 1);
    display: none;
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
    transform: translateY(-180%);
}

.predictive-suggestions.active {
    display: block;
}

.predictive-suggestion:hover {
    background: rgba(29, 30, 32, 1);
    transform: scale(1.02);
}

.response-options {
    display: none;
    position: relative;
    margin-top: 10px;
    background: #252525;
    padding: 5px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    z-index: 10;
}

.response-options.active {
    display: flex;
}

.response-btn {
    background: none;
    border: none;
    color: #e0e0e0;
    cursor: pointer;
    padding: 5px;
    font-size: 0.9em;
    transition: color 0.2s;
}

.response-btn:hover {
    color: #121212;
}

.welcome-section {
    padding: 40px 20px;
    text-align: center;
    color: #e0e0e0;
    background: #1d1e20;
    animation: quantumFade 0.5s ease-in;
    min-height: 100%;
    overflow-y: auto;
}

.welcome-section::-webkit-scrollbar {
    width: 10px;
}

.welcome-section::-webkit-scrollbar-track {
    background: #1d1e29;
    border-radius: 10px;
}

.welcome-section::-webkit-scrollbar-thumb {
    background: #1d1e20;
    border-radius: 10px;
}

.welcome-section::-webkit-scrollbar-thumb:hover {
    background: #1d1e20;
}

.welcome-section h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: #1d1e20;
}

.welcome-section p {
    font-size: 1.3em;
    margin-bottom: 30px;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.predictive-suggestions-bar {
    gap: 5px;
    transform: translateY(-80%);
}

.chat-input {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1d1e20;
    padding: 10px;
    z-index: 10;
    height: 120px;
}

#chatInputSection {
    display: none;
}

.input-container {
    position: relative;
    background: #333;
    border-radius: 20px;
    padding: 10px;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    height: 110%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.chat-input textarea {
    width: 98%;
    padding: 8px;
    border: 1px solid #333;
    border-radius: 20px;
    outline: none;
    resize: none;
    background: #333;
    transform: translateX(-15%);
    transform: translateY(1%);
    transform: translateY(-3%);
    color: #e0e0e0;
    font-size: 1em;
    min-height: 50px;
    max-height: 150px;
    line-height: 1.5;
    overflow-y: auto;
    transition: height 0.2s ease;
    box-sizing: border-box;
    position: absolute;
    bottom: 60px;
    left: 10px;
    right: 10px;
    z-index: 12;
}

.chat-input textarea:placeholder-shown {
    height: 50px;
}

.chat-input textarea:focus,
.chat-input textarea:not(:placeholder-shown) {
    height: auto;
}

.input-tools {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    height: 60px;
    align-self: flex-end;
    transform: translateY(17%);
    transform: translateX(-13%);
}

.chat-input textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.send-btn {
    position: absolute;
    top: 50%;
    right: 25px;
    transform: translateY(-1%);
    transform: translateY(15%);
    transform: translateX(25%);
    background: white;
    color: black;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.send-btn.thinking {
    background: white;
    color: black;
}

.send-btn.thinking::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: black;
    border-radius: 2px;
}

.send-btn.thinking i {
    display: none;
}

.send-btn:disabled {
    background: #414141;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.tool-btn {
    background: #414141;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.tool-btn:hover {
    background: linear-gradient(135deg, #414141, #1d1e20);
    transform: scale(1.1);
}

.tool-btn:disabled {
    background: #404040;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content input[type="range"] {
    width: 100%;
}

.modal-content input[type="checkbox"] {
    transform: scale(1.2);
}

.modal-content button[type="button"] {
    padding: 12px 20px;
    background: #2a2a2a;
    color: #e0e0e0;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    margin-top: 10px;
    transition: background 0.2s;
    box-shadow: 0 0 50px #121212;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        box-shadow: 0 0 60px rgba(29,30, 32, 1);
    }

    .sidebar {
        width: 100%;
        height: 50px;
        flex-direction: column;
        align-items: flex-start;
        padding: 10px;
    }

    .logo {
        font-size: 1em;
        gap: 10px;
    }
    
    #statusContainer {
        gap: 8px;
        max-width: 60%;
    }
    
    .status {
        font-size: 0.8em;
        padding: 3px 6px;
        max-width: 100px; /* Smaller max-width for mobile */
    }
    
    .status:active {
        transform: scale(0.93) rotate(2deg);
    }

    .history-panel {
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        height: calc(100% - 80px);
        z-index: 10;
        background: rgba(0,0,0,0.95);
        box-shadow: 0 10px 25px rgba(0,0,0,0.7);
    }

    .history-header {
        flex-direction: row;
        align-items: center;
    }

    .close-btn {
        width: 30px;
        height: 30px;
    }

    .main {
        height: calc(100% - 80px);
    }

    .header {
        padding: 10px 15px;
    }

    .menu-bar {
    width: 55%;
    gap: 5px;
    margin-top: 2px;
    }

    .menu-bar select {
        padding: 5px 6px;
        max-width: 110px;
        font-size: 0.8em
    }

    .menu-dropdown {
        left: 0;
        transform: translateX(140%);
        top: 55px;
        width: 40%;
        max-width: none;
        right: auto;
        min-width: auto;
        padding: 1px;
    }

    .menu-dropdown button {
        width: 100%;
        padding: 10px 15px;
        font-size: 0.9em;
    }
  .menu-dropdown button:hover {
    transform: translateX(3px);
  }
  .menu-dropdown button:active {
    transform: scale(0.97) translateX(2px);
  }

   .menu-btn {
     right: 15px;
     font-size: 0.9em;
     padding: 5px;
}

    .chat-messages {
        padding: 15px;
    }

    .message-content {
        max-width: 120%;
        padding: 12px 15px;
    }
    
    .chat-input {
        padding: 5px;
        height: 110px;
    }

    .input-container {
        padding: 5px;
    }

    .chat-input textarea {
        bottom: 50px; /* Adjust for smaller tool height */
        left: 5px;
        right: 5px;
    }
    
    .input-tools {
        gap: 8px;
        padding: 8px 0;
        height: 50px;
    }

    .send-btn {
        right: 15px;
        width: 35px;
        height: 35px;
    }

    .tool-btn {
        width: 35px;
        height: 35px;
    }

    .welcome-section {
        padding: 20px;
    }

    .welcome-section h2 {
        font-size: 1.5em;
    }

    .welcome-section p {
        font-size: 1em;
    }
}

@keyframes quantumFade {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes featureSlideIn {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes featureSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(50px); }
}

.chat-messages .message {
    animation: quantumFade 0.3s ease-in;
}

#help-text {
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translate(-50%, 0);
    color: #e0e0e0;
    font-size: 1.5em;
    opacity: 0.7;
    pointer-events: none;
    text-shadow: 0 0 10px rgba(255,255,255,0.3);
}

.thought-header {
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    color: #e0e0e0;
    font-size: 0.7em;
    font-weight: 600;
    background: #1d1e20;
    transition: background 0.3s ease;
}

.thought-header:hover {
    background: #1d1e20;
}

.thought-header .fa-lightbulb {
    margin-right: 10px;
}

.expand-text {
    color: #b0b0b0;
    font-weight: 400;
    margin-left: 10px;
}

.thought-toggle {
    transition: transform 0.3s ease;
}

.thought-toggle.fa-chevron-up {
    transform: rotate(180deg);
}

.thought-content {
    max-height: 0;
    overflow-y: auto;
    transition: max-height 0.3s ease;
}

.thought-content.expanded {
    max-height: 300px;
    padding: 10px 15px;
}

.thought-content p {
    padding: 0;
    margin: 0;
    color: #e0e0e0;
    font-size: 0.9em;
    line-height: 1.5;
    white-space: pre-wrap;
}

.thought-text {
    padding: 0;
    margin: 0;
    color: #e0e0e0;
    font-size: 0.9em;
    line-height: 1.5;
    white-space: pre-wrap;
}

.thought-text.processing::after {
    content: '';
    animation: blink-caret 0.75s step-end infinite;
}

@keyframes blink-caret {
    50% { border-right: 1px solid #1a73e8; }
    51% { border-right: 1px solid transparent; }
    100% { border-right: 1px solid transparent; }
}

#drawSolveModal .modal-content {
    background: #1d1e20;
    padding: 20px;
    max-width: 600px;
}

#drawCanvas {
    border: 2px solid #404040;
    background: #fff;
    border-radius: 10px;
    margin-bottom: 15px;
}

.canvas-tools {
    display: flex;
    gap: 10px;
    justify-content: center;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: 10;
}

/* Virtuzen Tutor Input Tools */
#tutorInputTools .input-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    padding: 10px;
}

#tutorInputTools .textarea-wrapper {
    position: relative;
    width: 100%;
    min-height: 50px;
}

#tutorInputTools textarea {
    position: static;
    transform: none;
    width: 100%;
    padding: 15px;
    border: 1px solid #333;
    border-radius: 20px;
    outline: none;
    resize: none;
    background: #333;
    color: #e0e0e0;
    font-size: 1em;
    min-height: 50px;
    max-height: 150px;
    line-height: 1.5;
    overflow-y: auto;
    box-sizing: border-box;
}

#tutorInputTools .send-btn {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    background: #414141;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

#tutorInputTools .tutor-input-tools {
    justify-content: center;
    transform: translateY(-30%);
    padding: 10px 0;
    gap: 15px;
    width: 80%;
    height: auto;
    margin-top: 10px;
}

.loading-indicator#tutorLoading {
    position: fixed;
    bottom: 130px;
    left: 50%;
    transform: translateX(-50%);
    color: #ff6b6b;
    font-size: 14px;
    background: rgba(29, 30, 32, 0.9);
    padding: 5px 15px;
    border-radius: 10px;
    z-index: 12;
    display: none;
}

/* Show when active */
.loading-indicator#tutorLoading.active {
    display: block;
}

/* Mobile adjustments for Virtuzen Tutor */
@media (max-width: 768px) {
    #tutorInputTools .input-container {
        padding: 5px;
    }

    #tutorInputTools textarea {
        min-height: 40px;
        padding: 10px;
    }
    
    .loading-indicator#tutorLoading {
        bottom: 120px; /* Adjusted for mobile height (110px) */
        font-size: 12px;
        padding: 4px 12px;
    }

    #tutorInputTools .tutor-input-tools {
        gap: 10px;
        padding: 8px 0;
        margin-top: 5px;
    }

    #tutorInputTools .send-btn {
        width: 35px;
        height: 35px;
        right: 10px;
    }
}

.tutor-voice-btn.active {
    background: #1d1e20;
}
.draw-solve-modal-content {
    width: 650px;
    padding: 20px;
}

.canvas-container {
    position: relative;
}

#drawCanvas {
    display: block;
}

.drawing-guide {
    position: absolute;
    top: 10px;
    left: 10px;
    color: #888;
    font-size: 14px;
    pointer-events: none;
}

#output {
    margin-top: 15px;
    text-align: center;
}

#extractedText {
    font-size: 16px;
    color: #333;
    margin-bottom: 10px;
}

.solution-steps {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 5px;
    text-align: left;
    max-height: 250px;
    overflow-y: auto;
}

.solution-steps p {
    margin: 5px 0;
    font-size: 14px;
}

#confidenceScore {
    font-size: 12px;
    color: #666;
}
.fade-in {
    animation: fadeIn 0.3s ease-in;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.typing-indicator {
    display: flex;
    align-items: center;
}
.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #777777;
    border-radius: 50%;
    margin: 0 2px;
    animation: pulse 0.8s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}
.history-controls {
    display: flex;
    justify-content: space-between;
    padding: 10px;
}
.history-controls button {
    background: #1d1e20;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}
#modelSelect {
  padding: 8px;
  border-radius: 6px;
  background: linear-gradient(135deg, #1d1e20, #565858);
  color: white;
  border: none;
  font-size: 0.9em;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='16' viewBox='0 0 24 24' width='16' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right 4px center;
  cursor: pointer;
  max-width: 120px;
  white-space: nowrap;
  transform: translateY(-40%);
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 8px rgba(29, 30, 32, 1);
  transition: all 0.3s ease;
  
}

#modelSelect:hover {
  background: #444;
  box-shadow: 0 4px 12px rgba(29, 30, 32, 1);
  transform: translateY(-40%);
}

#modelSelect:focus {
  outline: none;
  box-shadow: 0 0 10px rgba(29, 30, 32, 1);
}
.status {
  font-size: 0.9em;
  padding: 6px 12px;
  background: transparent;
  color: white;
  border-radius: 12px;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
  transition: all 0.3s ease;
  cursor: pointer;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status:hover {
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
  transform: translateY(-40%);
}

@media (max-width: 768px) {
  .status {
    font-size: 1em;
    padding: 3px 6px;
  }

  .status:active {
    transform: scale(0.93) rotate(2deg);
  }
}
.welcome-section {
  position: relative;
  z-index: 5;
  background: transparent;
  overflow: hidden;
  display: none;
}
.welcome-section.active {
  display: block;
  animation: holoFadeIn 0.5s ease-out forwards;
}
.welcome-section.hiding {
  animation: holoDissolve 0.5s forwards;
}

.holo-welcome {
  position: relative;
  z-index: 10;
}

.avatar-container {
  margin: 0 auto 20px;
  width: 120px;
  height: 120px;
  perspective: 1000px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(29, 30, 32, 1), transparent);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 20px rgba(255, 255, 255, 1);
  margin-top: 10px;
}

#avatarCanvas {
  border-radius: 50%;
}

#welcomeMessage {
  font-size: 1.2em;
  color: #e0e0e0;
  text-shadow: 0 0 20px rgba(29, 30, 32, 1);
  animation: glowText 2s infinite alternate;
}

.holo-buttons {
  display: flex;
  justify-content: center;
  gap: 1px;
  flex-wrap: wrap;
}
.holo-btn {
  background: transparent;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 12px;
  transform: translateY(-200%);
  font-size: 1em;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.holo-btn:hover {
  transform: rotateX(15deg) rotateY(15deg) scale(1.1);
  box-shadow: 0 0 25px rgba(171, 171, 171, 1);
  transform: translateY(-200%);
  animation: pulseGlow 1s infinite;
}

.particle-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: transparent;
}

@keyframes glowText {
  0% { text-shadow: 0 0 10px rgba(64, 64, 64, 1); }
  100% { text-shadow: 0 0 30px rgba(64, 64, 64, 1); }
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 15px rgba(29, 30, 32, 1); }
  50% { box-shadow: 0 0 30px rgba(255, 255, 255, 1); }
  100% { box-shadow: 0 0 15px rgba(29, 30, 32, 1); }
}

@keyframes quantumDissolve {
  0% { opacity: 1; transform: scale(1); filter: blur(0); }
  50% { opacity: 0.5; transform: scale(0.95); filter: blur(5px); }
  100% { opacity: 0; transform: scale(0.9); filter: blur(10px); display: none; }
}
.avatar-container {
  width: 150px;
  height: 150px;
  perspective: 1000px;
}

.neural-network-text {
  position: relative;
  display: inline-block;
  top: -80px;
  transform: translateY(-100%);
  color: #e0e0e0;
  text-shadow: 0 0 20px rgba(255, 255, 255, 1);
}

.voice-command-panel {
  margin-top: 5px;
  text-align: center;
  transform: translateY(-100%);
  color: #e0e0e0;
  background: rgba(37, 37, 37, 0.9);
  padding: 20px;
  border-radius: 24px;
  box-shadow: 0 0 15px rgba(255, 255, 255, 1);
  font-size: 0.5em;
}

.voice-suggestion {
  color: white;
  font-weight: bold;
  cursor: pointer;
}

.voice-transcription {
  margin-top: 8px;
  font-size: 0.5em; /* Reduced */
  color: #b0b0b0;
}

@keyframes neuralPulse {
  0% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 0.5; }
}
@keyframes holoFadeIn {
  0% { opacity: 0; transform: scale(0.9); filter: blur(5px); }
  50% { opacity: 0.5; transform: scale(1.1); filter: blur(2px); }
  100% { opacity: 1; transform: scale(1); filter: blur(0); }
}
@keyframes holoDissolve {
  0% { opacity: 1; transform: scale(1); filter: blur(0); }
  50% { opacity: 0.5; transform: scale(0.95); filter: blur(5px); }
  100% {
    opacity: 0;
    transform: scale(0.9);
    filter: blur(10px);
    background: linear-gradient(135deg, rgba(255, 255), transparent);
    display: none;
  }
}
.particle-burst {
  position: absolute;
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 1);
  border-radius: 50%;
  animation: burst 0.5s ease-out forwards;
}

@keyframes burst {
  0% { transform: scale(0); opacity: 1; }
  100% { transform: scale(20); opacity: 0; }
}

.about-modal-content {
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    color: #e0e0e0;
    animation: quantumFade 0.5s ease-in;
}

.about-modal-content h2 {
    font-size: 1.5em;
    color: white;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.about-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.about-options button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(90deg, #1d1e20, #414141);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.about-options button:hover {
    background: linear-gradient(90deg, #1d1e20, #414141);
    transform: scale(1.02);
}

.version-info {
    font-size: 1em;
    color: #e0e0e0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #252525;
    border-radius: 15px;
}
.privacy-policy-modal-content {
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    color: #e0e0e0;
    animation: quantumFade 0.5s ease-in;
    max-height: 80vh;
    overflow-y: auto;
}

.privacy-policy-modal-content h2 {
    font-size: 1.5em;
    color: white;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.policy-content {
    font-size: 1em;
    line-height: 1.6;
}
.terms-of-use-modal-content {
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    color: #e0e0e0;
    box-shadow: 0 0 50px rgba(29, 30, 32, 1);
    animation: quantumFade 0.5s ease-in;
    max-height: 80vh;
    overflow-y: auto;
}

.terms-of-use-modal-content h2 {
    font-size: 1.5em;
    color: white;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.terms-content {
    font-size: 1em;
    line-height: 1.6;
}

.terms-content h3 {
    margin-top: 20px;
    color: white;
}

.terms-content ul {
    padding-left: 20px;
}

.terms-content li {
    margin-bottom: 10px;
}
.help-center-modal-content {
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    color: #e0e0e0;
    animation: quantumFade 0.5s ease-in;
    max-height: 80vh;
    overflow-y: auto;
}

.help-center-modal-content h2 {
    font-size: 1.5em;
    color: white;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.help-content {
    font-size: 1em;
    line-height: 1.6;
}

.help-content h3 {
    margin-top: 20px;
    color: white;
}

.help-content ul, .help-content ol {
    padding-left: 20px;
}

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

.help-content a {
    color: white;
    text-decoration: none;
}

.help-content a:hover {
    text-decoration: underline;
}


.beta-notice-modal-content {
  background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
  padding: 30px;
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  color: #e0e0e0;
  animation: quantumFade 0.5s ease-in;
  text-align: center;
}

.beta-notice-modal-content h2 {
  font-size: 1.5em;
  color: white;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.beta-notice-modal-content p {
  font-size: 1em;
  line-height: 1.6;
  margin-bottom: 20px;
}

.beta-notice-modal-content button {
  padding: 12px 20px;
  background: linear-gradient(90deg, #1a73e8, #0d47a1);
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1em;
  transition: background 0.2s, transform 0.2s;
}

.beta-notice-modal-content button:hover {
  background: linear-gradient(90deg, #1d1e20, #414141);
  transform: scale(1.05);
}

.auto-message {
    animation: float 1.5s ease-in-out infinite;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    border-radius: 5px;
    position: relative;
    margin: 10px 0;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}


@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-container.web-search-active {
    animation: fadeToWeb 0.5s ease forwards;
}

@keyframes fadeToWeb {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

.settings-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-section {
  background: #252525;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #404040;
}

.profile-item {
  font-size: 14px;
  margin: 5px 0;
}

.settings-btn {
  background: #1a73e8;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.settings-btn:hover {
  background: #1557b0;
  transform: translateY(-2px);
}

.settings-btn:active {
  transform: translateY(0);
}

.icon {
  font-size: 16px;
}

.menu-bar-content {
  display: block;
}

@keyframes fadeOutUp {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-20px); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-input {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1d1e20;
    padding: 10px;
    z-index: 10;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.input-container {
    position: relative;
    background: #333;
    border-radius: 20px;
    padding: 10px;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    z-index: 11;
}

.image-preview-container {
    position: absolute;
    bottom: 130px;
    width: 90%;
    max-width: 1200px;
    background: #333;
    border-radius: 20px;
    padding: 10px;
    display: none;
    box-sizing: border-box;
    z-index: 10;
}

.image-preview-container.active {
    display: block;
}

.image-preview-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    overflow-x: auto;
    padding: 5px;
    max-height: 100px;
}

.image-preview-wrapper::-webkit-scrollbar {
    height: 8px;
}

.image-preview-wrapper::-webkit-scrollbar-track {
    background: #252525;
    border-radius: 10px;
}

.image-preview-wrapper::-webkit-scrollbar-thumb {
    background: #606060;
    border-radius: 10px;
}

.image-preview-wrapper::-webkit-scrollbar-thumb:hover {
    background: #707070;
}

.image-preview {
    max-height: 80px;
    max-width: 120px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #404040;
    transition: transform 0.2s ease;
}

.image-preview:hover {
    transform: scale(1.05);
}

.clear-preview-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #414141;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.clear-preview-btn:hover {
    background: #585656;
    transform: scale(1.1);
}

.clear-preview-btn i {
    font-size: 12px;
}

@media (max-width: 768px) {
    .chat-input {
        padding: 5px;
        height: 110px;
    }

    .input-container {
        padding: 5px;
    }

    .image-preview-container {
        bottom: 120px;
        width: 95%;
        padding: 5px;
    }

    .image-preview-wrapper {
        max-height: 80px;
    }

    .image-preview {
        max-height: 60px;
        max-width: 100px;
    }

    .clear-preview-btn {
        width: 20px;
        height: 20px;
    }

    .clear-preview-btn i {
        font-size: 10px;
    }
}

.input-tools-dropdown {
  display: none;
  position: absolute;
  bottom: 60px;
  left: 0;
  transform: translateX(0);
  background: #414141;
  border-radius: 10px;
  width: 150px;
  z-index: 20;
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 0;
  transform: translateX(0) scale(0.9);
}

.input-tools-dropdown.active {
  display: block;
  opacity: 1;
  transform: translateX(0) scale(1);
}

.dropdown-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 15px;
  border: none;
  background: none;
  cursor: pointer;
  color: #e0e0e0;
  font-size: 0.9em;
  transition: background 0.2s;
  text-align: left;
}

.dropdown-btn:hover {
  background: #404040;
}

.dropdown-btn i {
  font-size: 1em;
}

@media (max-width: 768px) {
  .input-tools-dropdown {
    width: 120px;
    bottom: 50px;
    left: 0;
    transform: translateX(0);
  }

  .input-tools-dropdown.active {
    transform: translateX(0) scale(1);
  }

  .dropdown-btn {
    padding: 8px 12px;
    font-size: 0.85em;
  }
}

.feedback-modal-content {
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    color: #e0e0e0;
    animation: quantumFade 0.5s ease-in;
    max-height: 110vh;
    overflow-y: auto;
    box-shadow: 0 0 50px rgba(29, 30, 32, 0.5);
}

.feedback-modal-content h2 {
    font-size: 1.5em;
    color: white;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-size: 1em;
    color: #e0e0e0;
    font-weight: 500;
}

.feedback-select {
    padding: 10px;
    border-radius: 10px;
    background: #252525;
    color: #e0e0e0;
    border: 1px solid #404040;
    font-size: 1em;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.feedback-select:hover {
    background: #303030;
    box-shadow: 0 0 10px rgba(26, 115, 232, 0.3);
}

.feedback-select:focus {
    outline: none;
    box-shadow: 0 0 15px rgba(26, 115, 232, 0.5);
}

.feedback-form textarea {
    padding: 10px;
    border-radius: 10px;
    background: #252525;
    color: #e0e0e0;
    border: 1px solid #404040;
    font-size: 1em;
    transform: translateY(50%);
    transform: translatex(1%);
    transform: translatex(-2%);
    height: 60px; 
    min-height: 60px;
    max-height: 60px;
    resize: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    overflow-y: auto;
}

.feedback-form textarea:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 15px rgba(26, 115, 232, 0.3);
    outline: none;
}

.rating-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.star-rating {
    display: flex;
    gap: 5px;
}

.star {
    font-size: 1.5em;
    color: #606060;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}

.star:hover,
.star.active {
    color: #ffd700;
    transform: scale(1.1);
}

.feedback-form input[type="file"] {
    padding: 5px;
    color: #e0e0e0;
}

.screenshot-preview {
    margin-top: 10px;
    max-height: 150px;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.screenshot-preview img {
    max-height: 100px;
    max-width: 150px;
    border-radius: 10px;
    border: 1px solid #404040;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.screenshot-preview img:hover {
    transform: scale(1.05);
}

.feedback-status {
    font-size: 0.9em;
    text-align: center;
    padding: 5px;
    min-height: 20px;
}

.modal-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
}

.submit-btn,
.close-btn {
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    width: 48%;
}

.submit-btn {
    background: linear-gradient(90deg, #1a73e8, #0d47a1);
    color: white;
    border: none;
}

.submit-btn:hover {
    background: linear-gradient(90deg, #2a85ff, #1565c0);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(26, 115, 232, 0.5);
}

.submit-btn:disabled {
    background: #404040;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.close-btn {
    background: #414141;
    color: #e0e0e0;
    border: none;
}

.close-btn:hover {
    background: #585656;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(29, 30, 32, 0.5);
}

@media (max-width: 768px) {
    .feedback-modal-content {
        padding: 20px;
        width: 95%;
    }

    .feedback-modal-content h2 {
        font-size: 1.3em;
    }

    .submit-btn,
    .close-btn {
        padding: 10px 15px;
        font-size: 0.9em;
        width: 48%;
    }

    .star {
        font-size: 1.2em;
    }

    .screenshot-preview img {
        max-height: 80px;
        max-width: 120px;
    }
}

/* Settings Menu (Full-Screen) */
.settings-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #1a1a1a;
  z-index: 1000;
  animation: slideIn 0.3s ease-out;
}

.settings-header {
  display: flex;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #404040;
}

.settings-header h2 {
  color: #e0e0e0;
  font-size: 24px;
  margin: 0;
  flex-grow: 1;
  text-align: center;
}

.back-btn {
  background: none;
  border: none;
  color: #e0e0e0;
  font-size: 18px;
  cursor: pointer;
  padding: 5px 10px;
}

.settings-list {
  padding: 10px 0;
}

.settings-list button {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 15px 20px;
  background: none;
  border: none;
  color: #e0e0e0;
  font-size: 16px;
  text-align: left;
  border-bottom: 1px solid #404040;
  cursor: pointer;
}

.settings-list button i {
  margin-right: 15px;
  font-size: 18px;
}

.settings-list button .arrow {
  margin-left: auto;
  font-size: 18px;
  color: #888;
}

.settings-list button:hover {
  background: #252525;
}

/* Keep the modal styles from before, but adjust for consistency */
.settings-modal-content {
  width: 100%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
  background: #1a1a1a;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(100%);
  }
}

/* Settings Modal */
.settings-modal-content {
    background: #1d1e20;
    border-radius: 15px;
    padding: 20px;
    max-width: 400px;
    width: 100%;
    color: #e0e0e0;
}

.settings-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.settings-header h2 {
    font-size: 1.5em;
    margin: 0;
}

.back-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 1.2em;
    cursor: pointer;
}

.back-btn:hover {
    color: #e0e0e0;
}

/* Upgrade Banner */
.upgrade-banner {
    background: linear-gradient(135deg, #252525, #333);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.upgrade-banner h3 {
    font-size: 1.3em;
    margin: 0 0 5px 0;
    color: #e0e0e0;
}

.upgrade-banner p {
    font-size: 0.9em;
    color: #b0b0b0;
    margin: 5px 0;
}

.upgrade-banner ul {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.upgrade-banner li {
    font-size: 0.85em;
    color: #e0e0e0;
    margin: 5px 0;
}

.upgrade-banner li i {
    color: #ff6b6b;
    margin-right: 5px;
}

.upgrade-btn2 {
    background: #ff6b6b;
    border: none;
    border-radius: 20px;
    padding: 8px 15px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    position: absolute;
    top: 15px;
    right: 15px;
    transition: background 0.2s ease;
}

.upgrade-btn2:hover {
    background: #ff8787;
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.profile-pic {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 10px rgba(29, 30, 32, 0.5);
}

.account-details {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.username {
    font-size: 1.1em;
    font-weight: 600;
    color: #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email {
    font-size: 0.9em;
    color: #b0b0b0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info span {
    flex: 1;
    font-size: 1em;
    color: #e0e0e0;
}

.manage-btn {
    background: #404040;
    border: none;
    border-radius: 20px;
    padding: 5px 10px;
    color: #e0e0e0;
    font-size: 0.9em;
    cursor: pointer;
    transition: background 0.2s ease;
}

.manage-btn:hover {
    background: #505050;
    transform: scale(1.05);
}

/* Connect X Account */
.connect-x-account {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid #404040;
    border-bottom: 1px solid #404040;
    margin-bottom: 20px;
}

.connect-x-account span {
    font-size: 1em;
    color: #e0e0e0;
}

.connect-btn {
    background: #404040;
    border: none;
    border-radius: 20px;
    padding: 5px 10px;
    color: #e0e0e0;
    font-size: 0.9em;
    cursor: pointer;
    transition: background 0.2s ease;
}

.connect-btn:hover {
    background: #505050;
}

/* Language Setting */
.language-setting {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.language-setting span {
    font-size: 1em;
    color: #e0e0e0;
}

.language-setting i {
    margin-left: 5px;
    color: #888;
}

.change-btn {
    background: #404040;
    border: none;
    border-radius: 20px;
    padding: 5px 10px;
    color: #e0e0e0;
    font-size: 0.9em;
    cursor: pointer;
    transition: background 0.2s ease;
}

.change-btn:hover {
    background: #505050;
}

#settingsMenu {
    z-index: 100;
}

#settingsModal {
    z-index: 101;
}

@media (max-width: 768px) {
    .user-info {
        gap: 10px;
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-pic {
        width: 40px;
        height: 40px;
    }

    .username {
        font-size: 1em;
    }

    .email {
        font-size: 0.85em;
    }

    .manage-btn {
        padding: 4px 8px;
        font-size: 0.85em;
        align-self: flex-end;
    }
}

.language-selector-section {
    padding: 10px 0;
    border-top: 1px solid #404040;
    border-bottom: 1px solid #404040;
}

.language-list {
    max-height: 300px;
    overflow-y: auto;
    background-color: #1a1a1a;
    border-radius: 8px;
    padding: 5px 0;
    margin-top: 10px;
    position: relative;
    z-index: 102;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.language-list.visible {
    opacity: 1;
    transform: translateY(0);
}

.language-list::-webkit-scrollbar {
    width: 8px;
}

.language-list::-webkit-scrollbar-track {
    background: #252525;
    border-radius: 10px;
}

.language-list::-webkit-scrollbar-thumb {
    background: #606060;
    border-radius: 10px;
}

.language-list::-webkit-scrollbar-thumb:hover {
    background: #707070;
}

.language-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.language-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    color: #e0e0e0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.language-list li:hover {
    background-color: #333;
}

.language-list li .native-name {
    flex: 1;
    font-size: 1em;
}

.language-list li .english-name {
    flex: 1;
    font-size: 0.9em;
    color: #aaa;
    text-align: right;
    margin-right: 10px;
}

.language-list li .checkmark {
    color: #1a73e8;
    font-size: 1em;
}

.language-list li.selected .checkmark {
    display: inline;
}

/* Ensure consistency with mobile view */
@media (max-width: 768px) {
    .language-list {
        max-height: 200px;
    }

    .language-list li {
        padding: 8px 10px;
    }

    .language-list li .native-name {
        font-size: 0.9em;
    }

    .language-list li .english-name {
        font-size: 0.85em;
    }
}

/* RTL adjustments */
html[dir="rtl"] {
    direction: rtl;
}

html[dir="rtl"] .settings-header,
html[dir="rtl"] .language-setting,
html[dir="rtl"] .connect-x-account,
html[dir="rtl"] .user-info {
    flex-direction: row-reverse;
}

html[dir="rtl"] .settings-list button,
html[dir="rtl"] .menu-dropdown button {
    flex-direction: row-reverse;
    text-align: right;
}

html[dir="rtl"] .language-list li {
    flex-direction: row-reverse;
}

html[dir="rtl"] .language-list li .english-name {
    text-align: left;
    margin-right: 0;
    margin-left: 10px;
}

html[dir="rtl"] .input-tools,
html[dir="rtl"] .holo-buttons {
    flex-direction: row-reverse;
}

html[dir="rtl"] .send-btn {
    right: auto;
    left: 25px;
}

html[dir="rtl"] .chat-input textarea {
    transform: translateX(15%);
}

/* Adjust other elements as needed for RTL */
html[dir="rtl"] .chat-message.user {
    flex-direction: row-reverse;
    text-align: right;
}

html[dir="rtl"] .chat-message.assistant {
    flex-direction: row-reverse;
    text-align: right;
}

html[dir="rtl"] .avatar-container {
    margin-left: 0;
    margin-right: 10px;
}

.apply-btn {
    display: block;
    width: 100%;
    padding: 8px;
    margin-top: 10px;
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.apply-btn:hover {
    background: #1557b0;
}

/* Settings Section General Styling */
.settings-section {
    display: none;
    flex-direction: column;
    gap: 20px;
}

.settings-section.active {
    display: flex;
}

/* Settings Item */
.settings-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #404040;
}

.settings-item label {
    font-size: 1em;
    color: #e0e0e0;
    font-weight: 500;
}

/* Theme Options */
.theme-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.theme-btn {
    background: #252525;
    color: #e0e0e0;
    border: 1px solid #404040;
    border-radius: 10px;
    padding: 8px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.theme-btn:hover {
    background: #404040;
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(29, 30, 32, 0.5);
}

.theme-btn.active {
    background: linear-gradient(90deg, #ff6b6b, #ef5350);
    color: white;
    border-color: #ff6b6b;
}

/* Font Selection */
#fontSelect {
    padding: 8px 10px;
    border-radius: 10px;
    background: #252525;
    color: #e0e0e0;
    border: 1px solid #404040;
    font-size: 0.9em;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

#fontSelect:hover {
    background: #303030;
    box-shadow: 0 0 10px rgba(29, 30, 32, 0.5);
}

#fontSelect:focus {
    outline: none;
    box-shadow: 0 0 15px rgba(29, 30, 32, 0.5);
}

/* Accent Color Picker */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

#accentColor {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
}

#accentColor::-webkit-color-swatch {
    border: 1px solid #404040;
    border-radius: 5px;
}

#accentColor::-moz-color-swatch {
    border: 1px solid #404040;
    border-radius: 5px;
}

/* Reset Button */
.reset-btn {
    background: #404040;
    color: #e0e0e0;
    border: none;
    border-radius: 10px;
    padding: 5px 10px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.reset-btn:hover {
    background: #505050;
    transform: scale(1.05);
}

/* Transparency Slider */
.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

#transparencySlider {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    background: #404040;
    border-radius: 5px;
    outline: none;
    transition: background 0.2s ease;
}

#transparencySlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #ff6b6b;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#transparencySlider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

#transparencySlider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #ff6b6b;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#transparencySlider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

#transparencyValue {
    font-size: 0.9em;
    color: #b0b0b0;
}

/* Toggle Switch */
.toggle-item {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #404040;
    transition: 0.3s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background: #e0e0e0;
    transition: 0.3s;
    border-radius: 50%;
}

.switch input:checked + .slider {
    background: #ff6b6b;
}

.switch input:checked + .slider:before {
    transform: translateX(20px);
}

/* Reset All Button */
.reset-all-btn {
    background: linear-gradient(90deg, #ff6b6b, #ef5350);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    margin-top: 10px;
}

.reset-all-btn:hover {
    background: linear-gradient(90deg, #ef5350, #ff8787);
    transform: scale(1.05);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .settings-item {
        padding: 8px 0;
    }

    .theme-btn {
        padding: 6px 12px;
        font-size: 0.85em;
    }

    #fontSelect {
        padding: 6px 8px;
        font-size: 0.85em;
    }

    #accentColor {
        width: 35px;
        height: 35px;
    }

    .reset-btn {
        padding: 4px 8px;
        font-size: 0.85em;
    }

    #transparencySlider {
        height: 5px;
    }

    #transparencySlider::-webkit-slider-thumb,
    #transparencySlider::-moz-range-thumb {
        width: 14px;
        height: 14px;
    }

    #transparencyValue {
        font-size: 0.85em;
    }

    .reset-all-btn {
        padding: 8px;
        font-size: 0.85em;
    }
}

.settings-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: #252525;
    border-radius: 10px;
    color: #e0e0e0;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.settings-list li:hover {
    background: #404040;
    transform: scale(1.02);
}

.settings-list li i {
    font-size: 1.1em;
    color: var(--accent-color);
}

/* Ensure dropdowns in Behavior section match Appearance section */
#behavior-section select {
    padding: 8px 10px;
    border-radius: 10px;
    background: #252525;
    color: #e0e0e0;
    border: 1px solid #404040;
    font-size: 0.9em;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

#behavior-section select:hover {
    background: #303030;
    box-shadow: 0 0 10px rgba(29, 30, 32, 0.5);
}

#behavior-section select:focus {
    outline: none;
    box-shadow: 0 0 15px rgba(29, 30, 32, 0.5);
}

/* Customize Section Styling */
#customize-section h3 {
    font-size: 1.2em;
    color: #e0e0e0;
    margin-bottom: 15px;
    border-bottom: 1px solid #404040;
    padding-bottom: 5px;
}

/* Tone Options */
.tone-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tone-btn {
    background: #252525;
    color: #e0e0e0;
    border: 1px solid #404040;
    border-radius: 10px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.tone-btn:hover {
    background: #404040;
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(29, 30, 32, 0.5);
}

.tone-btn.active {
    background: linear-gradient(90deg, #ff6b6b, #ef5350);
    color: white;
    border-color: #ff6b6b;
}

/* Custom Tone Input */
.custom-tone-wrapper {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
}

#customToneInput {
    flex: 1;
    padding: 8px 10px;
    border-radius: 10px;
    background: #252525;
    color: #e0e0e0;
    border: 1px solid #404040;
    font-size: 0.9em;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#customToneInput:focus {
    border-color: #ff6b6b;
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
    outline: none;
}

/* Personality Traits */
.personality-traits {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.trait-option {
    display: flex;
    align-items: center;
    gap: 5px;
}

.trait-option input[type="checkbox"] {
    transform: scale(1.2);
    accent-color: #ff6b6b;
}

.trait-option label {
    font-size: 0.9em;
    color: #e0e0e0;
}

/* Response Length and Creativity Sliders */
#responseLength,
#creativityLevel {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    background: #404040;
    border-radius: 5px;
    outline: none;
    transition: background 0.2s ease;
}

#responseLength::-webkit-slider-thumb,
#creativityLevel::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #ff6b6b;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#responseLength::-webkit-slider-thumb:hover,
#creativityLevel::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

#responseLength::-moz-range-thumb,
#creativityLevel::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #ff6b6b;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#responseLength::-moz-range-thumb:hover,
#creativityLevel::-moz-range-thumb:hover {
    transform: scale(1.2);
}

#responseLengthValue,
#creativityLevelValue {
    font-size: 0.9em;
    color: #b0b0b0;
}

/* Mobile Adjustments for Customize Section */
@media (max-width: 768px) {
    #customize-section h3 {
        font-size: 1.1em;
    }

    .tone-btn {
        padding: 6px 12px;
        font-size: 0.85em;
    }

    #customToneInput {
        padding: 6px 8px;
        font-size: 0.85em;
    }

    .trait-option label {
        font-size: 0.85em;
    }

    #responseLength,
    #creativityLevel {
        height: 5px;
    }

    #responseLength::-webkit-slider-thumb,
    #creativityLevel::-webkit-slider-thumb,
    #responseLength::-moz-range-thumb,
    #creativityLevel::-moz-range-thumb {
        width: 14px;
        height: 14px;
    }

    #responseLengthValue,
    #creativityLevelValue {
        font-size: 0.85em;
    }
}

.preview-container {
    background: #252525;
    border-radius: 10px;
    padding: 15px;
    margin-top: 10px;
    border: 1px solid #404040;
}

.preview-text {
    font-size: 0.9em;
    color: #b0b0b0;
    margin-bottom: 10px;
}

.preview-response {
    font-size: 0.95em;
    color: #e0e0e0;
    background: #1d1e20;
    padding: 10px;
    border-radius: 8px;
    min-height: 50px;
}

.preview-btn {
    background: linear-gradient(90deg, #1a73e8, #0d47a1);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 8px 15px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    margin-top: 10px;
}

.preview-btn:hover {
    background: linear-gradient(90deg, #2a85ff, #1565c0);
    transform: scale(1.05);
}

.preview-btn:disabled {
    background: #404040;
    cursor: not-allowed;
    transform: none;
}

/* Data Controls Section Buttons */
.export-btn,
.import-btn,
.clear-btn,
.delete-btn {
    background: #252525;
    color: #e0e0e0;
    border: 1px solid #404040;
    border-radius: 10px;
    padding: 8px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.export-btn:hover,
.import-btn:hover,
.clear-btn:hover,
.delete-btn:hover {
    background: var(--accent-color);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.delete-btn {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.delete-btn:hover {
    background: #ff6b6b;
    color: white;
}

/* Data Import Input */
#importData {
    padding: 5px;
    border-radius: 10px;
    background: #252525;
    color: #e0e0e0;
    border: 1px solid #404040;
    font-size: 0.9em;
    margin-bottom: 10px;
    width: 100%;
    box-sizing: border-box;
}

#importData:focus {
    border-color: #ff6b6b;
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
    outline: none;
}

/* Data Controls Section Description Text */
.settings-item p {
    font-size: 0.85em;
    color: #b0b0b0;
    margin: 5px 0;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .export-btn,
    .import-btn,
    .clear-btn,
    .delete-btn {
        padding: 6px 12px;
        font-size: 0.85em;
    }

    #importData {
        font-size: 0.85em;
    }

    .settings-item p {
        font-size: 0.8em;
    }
}

.feedback-list {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 20px;
    padding: 10px;
    background: #252525;
    border-radius: 8px;
}

.feedback-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px;
    margin-bottom: 10px;
    background: #333;
    border-radius: 5px;
}

.feedback-content {
    flex-grow: 1;
}

.feedback-type, .feedback-rating, .feedback-message {
    margin: 5px 0;
    font-size: 14px;
}

.feedback-image {
    max-width: 200px;
    border-radius: 8px;
}

.delete-feedback-btn {
    background: #ff6b6b;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
}

.delete-feedback-btn:hover {
    background: #e55a5a;
}

.star-rating .star.selected {
    color: #ffd700;
}

#coreAiInputTools {
    display: none; /* Hidden by default, shown via JS when model is 'creative' */
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    padding: 10px;
    background: #333;
    border-radius: 20px;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    z-index: 11;
}

/* Show when active */
#coreAiInputTools.active {
    display: flex;
}

/* Textarea Wrapper */
#coreAiInputTools .textarea-wrapper {
    position: relative;
    width: 100%;
    min-height: 50px;
}

/* CoreAI Textarea */
#coreAiInputTools textarea {
    position: static;
    transform: translateY(20%);
    width: 100%;
    padding: 15px;
    border: 1px solid #333;
    border-radius: 20px;
    outline: none;
    resize: none;
    background: #333;
    color: #e0e0e0;
    font-size: 1em;
    min-height: 50px;
    max-height: 150px;
    line-height: 1.5;
    overflow-y: auto;
    box-sizing: border-box;
    z-index: 12;
}

/* Send Button */
#coreAiInputTools .send-btn {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-5%); /* Center vertically */
    background: #414141;
    color: #e0e0e0;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    z-index: 13;
}

#coreAiInputTools .send-btn:disabled {
    background: #404040;
    cursor: not-allowed;
    transform: translateY(-50%);
    box-shadow: none;
}

#coreAiInputTools .coreai-input-tools {
    display: flex;
    gap: 15px;
    padding: 10px 0;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: auto;
    margin-top: 10px;
    transform: none; /* Remove conflicting transforms */
}

/* Media Type Selector */
#coreAiInputTools #mediaTypeSelect {
    padding: 8px 10px;
    border-radius: 10px;
    background: #252525;
    color: #e0e0e0;
    border: 1px solid #404040;
    font-size: 0.9em;
    cursor: pointer;
    transform: translateX(-100%);
    transition: background 0.2s ease, box-shadow 0.2s ease;
    max-width: 120px;
}

#coreAiInputTools #mediaTypeSelect:hover {
    background: #303030;
    box-shadow: 0 0 10px rgba(29, 30, 32, 0.5);
    transform: translateX(-100%);
}

#coreAiInputTools #mediaTypeSelect:focus {
    outline: none;
    box-shadow: 0 0 15px rgba(29, 30, 32, 0.5);
}

.message.media-message {
    flex-direction: column;
    align-items: flex-start;
    max-width: 100%;
}

.message.media-message img,
.message.media-message video {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid #404040;
    margin-bottom: 10px;
    display: block;
}

.message.media-message video {
    width: 100%;
}

.message.media-message .media-caption {
    font-size: 0.9em;
    color: #b0b0b0;
    text-align: left;
    max-width: 100%;
    word-wrap: break-word;
}

.loading-indicator#coreAiLoading {
    position: fixed;
    bottom: 130px;
    left: 50%;
    transform: translateX(-50%);
    color: #e0e0e0;
    font-size: 14px;
    background: rgba(29, 30, 32, 0.9);
    padding: 5px 15px;
    border-radius: 10px;
    z-index: 12;
    display: none;
}

.loading-indicator#coreAiLoading.active {
    display: block;
}

@media (max-width: 768px) {
    #coreAiInputTools {
        padding: 5px;
    }

    #coreAiInputTools .textarea-wrapper {
        min-height: 40px;
    }

    #coreAiInputTools textarea {
        min-height: 40px;
        padding: 10px;
        font-size: 0.9em;
    }

    #coreAiInputTools .send-btn {
        width: 35px;
        height: 35px;
        right: 10px;
    }

    #coreAiInputTools .coreai-input-tools {
        gap: 10px;
        padding: 8px 0;
        margin-top: 5px;
    }

    #coreAiInputTools #mediaTypeSelect {
        padding: 6px 8px;
        font-size: 0.85em;
        max-width: 100px;
    }

    #coreAiInputTools .preview-btn {
        width: 35px;
        height: 35px;
    }

    .message.media-message img,
    .message.media-message video {
        max-height: 200px;
    }

    .message.media-message .media-caption {
        font-size: 0.85em;
    }

    .loading-indicator#coreAiLoading {
        bottom: 120px;
        font-size: 12px;
        padding: 4px 12px;
    }
}

html[dir="rtl"] #coreAiInputTools .send-btn {
    right: auto;
    left: 15px;
}

html[dir="rtl"] #coreAiInputTools .coreai-input-tools {
    flex-direction: row-reverse;
}

html[dir="rtl"] .message.media-message .media-caption {
    text-align: right;
}

@media (max-width: 768px) {
    html[dir="rtl"] #coreAiInputTools .send-btn {
        left: 10px;
    }
}

.custom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-modal.show {
    display: flex;
    opacity: 1;
}

.custom-modal-content {
    background: rgba(29, 30, 32, 0.95);
    border: 1px solid #4a4a4a;
    border-radius: 10px;
    padding: 20px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    animation: modalFadeIn 0.3s ease-in-out;
}

.custom-modal-content p {
    color: #e0e0e0;
    margin-bottom: 20px;
    font-size: 16px;
}

.custom-modal-btn {
    background: #4a4a4a;
    border: none;
    color: #fff;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

.custom-modal-btn:hover {
    background: #5a5a5a;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@media (display-mode: standalone) {
    body {
        overscroll-behavior: none;
    }
    .chat-input {
        padding-bottom: env(safe-area-inset-bottom);
    }
    .chat-container {
        padding-bottom: env(safe-area-inset-bottom);
    }
    .settings-modal-content {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

.settings-option.install-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    margin: 5px 0;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s ease;
}
.settings-option.install-option:hover {
    background: rgba(255, 107, 107, 0.3);
}
.settings-option.install-option span {
    color: var(--text-color);
    font-size: 0.9em;
}
.settings-option.install-option i {
    color: var(--accent-color);
}

@media (min-width: 769px) {
    .menu-btn {
        position: absolute;
        left: auto;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 1em;
        padding: 6px;
        color: white;
        cursor: pointer;
        transition: transform 0.2s;
        z-index: 15;
        pointer-events: auto;
    }

    .menu-btn:hover {
        transform: translateY(-50%) rotate(90deg);
    }

    .menu-dropdown {
        z-index: 12;
        left: auto;
        right: 20px;
        top: 60px;
        transform: none;
    }

    .menu-dropdown.active {
        display: block;
        opacity: 1;
        transform: none;
    }

    .chat-container {
        max-width: 1200px;
        margin: 0 auto;
        width: calc(100% - 250px);
        box-sizing: border-box;
    }

    .chat-messages {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    .chat-input textarea {
        transform: none;
        width: 100%;
        left: 0;
        right: 0;
        padding: 8px 50px 8px 15px;
        box-sizing: border-box;
    }

    .input-tools {
        transform: none;
        justify-content: center;
        width: 100%;
        padding: 10px 0;
    }

    .send-btn {
        transform: translateY(-5%);
        right: 15px;
        top: 50%;
    }

    .input-container {
        max-width: 800px;
    }
}
