html, body {
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
}

@font-face {
    font-family: 'Binance';
    src: url(chrome-extension://egjidjbpglichdcondbcbdnbeeppgdph/fonts/BinancePlex-Regular.otf) format('opentype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Binance';
    src: url(chrome-extension://egjidjbpglichdcondbcbdnbeeppgdph/fonts/BinancePlex-Medium.otf) format('opentype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Binance';
    src: url(chrome-extension://egjidjbpglichdcondbcbdnbeeppgdph/fonts/BinancePlex-SemiBold.otf) format('opentype');
    font-weight: 600;
    font-style: normal;
}

body {
    font-family: 'Binance', 'Arial', sans-serif;
    color: #fff;
    display: flex;
    overflow: hidden;
    background-color: #111111;
    overflow-x: hidden;
}

.bg {
    position: fixed;
    z-index: -100;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    width: 200%;
    height: 200vh;
    background: transparent url('http://assets.iceable.com/img/noise-transparent.png') repeat 0 0;
    background-repeat: repeat;
    animation: bg-animation .2s infinite;
    opacity: .9;
    visibility: visible;
}

@keyframes bg-animation {
    0% { transform: translate(0,0) } 10% { transform: translate(-5%,-5%) }
    20% { transform: translate(-10%,5%) } 30% { transform: translate(5%,-10%) }
    40% { transform: translate(-5%,15%) } 50% { transform: translate(-10%,5%) }
    60% { transform: translate(15%,0) } 70% { transform: translate(0,10%) }
    80% { transform: translate(-15%,0) } 90% { transform: translate(10%,5%) }
    100% { transform: translate(5%,0) }
}

.app-container { 
    display: flex; 
    width: 100%; 
    height: 100%; 
    position: relative; 
    z-index: 1; 
    overflow: hidden;
}

.sidebar {
    width: 260px;
    background-color: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(5px);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-right: 1px solid #1f1f1f;
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    overflow-x: hidden;
}
.sidebar.collapsed {
    width: 0; padding-left: 0; padding-right: 0; transform: translateX(-100%);
}
.sidebar.collapsed .sidebar-header, .sidebar.collapsed .sidebar-menu, .sidebar.collapsed .sidebar-footer {
    visibility: hidden;
}

.sidebar-header { text-align: center; margin-bottom: 20px; }
.sidebar-logo-img {
    max-width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-bottom: 15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    object-fit: cover;
}

.sidebar-menu ul { list-style: none; padding: 0; margin: 0; }
.sidebar-menu li {
    position: relative;
    margin-bottom: 8px;
}

.sidebar-menu li a, .sidebar-menu .menu-item-with-dropdown {
    display: block;
    padding: 12px 16px;
    color: #cccccc;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 18px;
    font-weight: 500;
}

.sidebar-menu li a:hover, .sidebar-menu .menu-item-with-dropdown:hover {
    background-color: #333; 
    color: #fff;
}



.sidebar-menu li a.active, .sidebar-menu .menu-item-with-dropdown.active {
    background-color: #FF7B00;
    color: #fff; 
    font-weight: bold;
}

.sidebar-menu .menu-item-with-dropdown {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-right: 25px;
}

.sidebar-menu .menu-item-with-dropdown::after {
    content: '▼';
    font-size: 10px;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s;
}

.sidebar-menu .menu-item-with-dropdown.active::after {
    transform: translateY(-50%) rotate(180deg);
}

.chat-dropdown {
    display: none;
    margin-left: 15px;
    margin-top: 5px;
    border-left: 2px solid #333;
    padding-left: 10px;
}

.chat-dropdown.active {
    display: block;
}

.chat-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    color: #ccc;
    text-decoration: none;
    border-radius: 4px;
    margin-bottom: 5px;
    font-size: 13px;
    transition: all 0.2s;
    position: relative;
}

.chat-dropdown-item .edit-icon {
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    margin-left: 8px;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.chat-dropdown-item .delete-icon {
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    margin-left: 8px;
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    color: #dc3545;
}

.chat-dropdown-item:hover .edit-icon,
.chat-dropdown-item:hover .delete-icon {
    opacity: 1;
}

.chat-dropdown-item .chat-name {
    flex-grow: 1;
    margin-right: 60px; /* Increased space for both icons */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-dropdown-item:hover {
    background-color: #333;
    color: #fff;
}

.chat-dropdown-item.active {
    background-color: #FF7B00;
    color: #fff;
}

.chat-dropdown-item .edit-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.chat-dropdown-item .delete-icon:hover {
    background-color: rgba(220, 53, 69, 0.2);
}

.chat-dropdown-item .edit-icon svg,
.chat-dropdown-item .delete-icon svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.chat-dropdown-item .chat-name {
    flex-grow: 1;
    margin-right: 8px;
}

.chat-dropdown-item.editing {
    padding: 0;
    position: relative;
}

.chat-dropdown-item.editing input {
    width: 100%;
    padding: 8px 10px;
    background: #333;
    border: 1px solid #444;
    border-radius: 4px;
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    margin-right: 30px; /* Add space for the edit icon */
}

.chat-dropdown-item.editing input:focus {
    outline: none;
    border-color: #FF7B00;
}

.new-chat-btn {
    display: block;
    padding: 8px 10px;
    color: #FF7B00;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 5px;
    font-size: 13px;
    transition: all 0.2s;
    cursor: pointer;
}

.new-chat-btn:hover {
    background-color: rgba(255, 123, 0, 0.1);
}


.sidebar-menu li a, .sidebar-menu .menu-item-with-dropdown {
    position: relative; 
    display: block;
    padding: 10px 15px;
    color: #ccc; 
    text-decoration: none;
    border-radius: 6px; 
    margin-bottom: 8px;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
    font-size: 18px; 
    cursor: pointer;
    overflow: hidden; 
    white-space: nowrap;
    font-family: 'Binance', 'Arial', sans-serif;
}

.sidebar-menu li a:hover, .sidebar-menu .menu-item-with-dropdown:hover {
    background-color: #333; 
    color: #fff; 
    transform: translateX(3px);
    transition: all 0.3s ease;
}

.sidebar-menu li a.inactive {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.sidebar-menu li a.inactive:hover {
    background-color: transparent;
    color: inherit;
    transform: none;
}

.sidebar-menu li a.active, .sidebar-menu .menu-item-with-dropdown.active {
    background-color: #FF7B00;
    color: #fff; 
    font-weight: bold;
}

.sidebar-menu li a::before, .sidebar-menu li a::after,
.sidebar-menu .menu-item-with-dropdown::before, .sidebar-menu .menu-item-with-dropdown::after {
    content: ''; 
    position: absolute;
    width: 8px; 
    height: 8px;
    background-color: rgb(255, 255, 255);
    opacity: 0;
    transition: opacity 0.7s ease, transform 1s ease;
}

.sidebar-menu li a::before, .sidebar-menu .menu-item-with-dropdown::before { 
    top: -5px; 
    left: -5px; 
    transform: rotate(45deg); 
}

.sidebar-menu li a::after, .sidebar-menu .menu-item-with-dropdown::after { 
    bottom: -5px; 
    right: -5px; 
    transform: rotate(45deg); 
}

.sidebar-menu li a:hover::before, .sidebar-menu li a:hover::after,
.sidebar-menu .menu-item-with-dropdown:hover::before, .sidebar-menu .menu-item-with-dropdown:hover::after {
    opacity: 1; 
    transform: rotate(45deg) scale(1.2);
}

.sidebar-footer {
    padding-top: 15px;
    border-top: 1px solid #333;
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.profile-section {
    display: flex;
    align-items: center;
}
.footer-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
    background-color: #fff;
    padding: 0;
    box-sizing: border-box;
}
.profile-name {
    color: #ccc;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}
.settings-button {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.settings-button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}
.settings-button:hover {
    color: #fff;
}

.main-content-wrapper,
.content-area,
.chat-window-ai {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 0;
    width: 100%;
}

.app-header {
    display: flex; align-items: center;
    padding: 0 20px;
    background-color: transparent;
    border-bottom: 1px solid #3a3a3a;
    height: 60px; box-sizing: border-box;
    flex-shrink: 0;
    justify-content: space-between;
}
.menu-toggle-button {
    padding: 8px 10px;
    margin-right: auto;
    font-size: 22px;
    line-height: 1;
    color: #ccc;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Binance', 'Arial', sans-serif;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.menu-toggle-button:hover {
     color: #fff;
     background-color: #333;
}

.app-header .social-links { display: flex; align-items: center; }
.app-header .social-links a { margin-left: 15px; }
.app-header .social-links svg { width: 20px; height: 20px; fill: #cccccc; transition: fill 0.2s ease; }
.app-header .social-links a:hover svg { fill: #FF7B00; }

.content-area {
    flex-grow: 1; 
    padding: 25px;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: transparent;
    position: relative;
}
.content-section { display: none; }
.content-section.active { display: block; animation: fadeIn 0.5s ease-forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.content-section h2 {
    color: #fff; border-bottom: 1px solid #444; padding-bottom: 10px;
    margin-top: 0; margin-bottom: 20px; font-size: 24px;
    font-family: 'Binance', 'Arial', sans-serif;
    text-transform: lowercase;
}

.chat-window-ai {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.message-display-ai {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: calc(100vh - 200px);
    overflow-y: auto;
    width: 100%;
    padding: 24px 0 0 0;
    background: transparent;
    scrollbar-width: thin;
    scrollbar-color: #333 #222;
}
.message-display-ai::-webkit-scrollbar {
    width: 8px;
    background: transparent;
}
.message-display-ai::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

.chat-input-container {
    position: sticky;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 2;
    padding: 20px 0 24px 0;
    margin: 0;
    margin-top: auto;
}

.chat-input-form {
    min-width: 450px;
    width: 45%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #181818;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -2px 16px #0002;
    padding: 24px 0;
    min-height: 80px;
    position: relative;
    z-index: 3;
}

.chat-input-form textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 0;
    min-height: 40px;
    max-height: calc(1.5em * 6 + 24px);
    overflow-y: auto;
    resize: none;
    transition: min-height 0.2s;
    scrollbar-width: thin;
    scrollbar-color: #333 #222;
}
.chat-input-form textarea::-webkit-scrollbar {
    width: 8px;
    background: transparent;
}
.chat-input-form textarea::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

.chat-input-form textarea::placeholder {
    color: #888;
    font-size: 17px;
}
.send-btn {
    position: absolute;
    right: 32px;
    bottom: 23px;
    background: #FF7B00;
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 2;
}
.send-btn:hover {
    background: #D46A00;
}
.send-btn:disabled {
  background: #444 !important;
  color: #888 !important;
  cursor: not-allowed !important;
  opacity: 0.6;
}
.settings-btn {
    position: absolute;
    top: 16px;
    right: 32px;
    background: #232323;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #444;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 3;
}
.settings-btn:hover {
    background: #333;
}

.settings-container {
    position: relative;
    margin-left: 8px;
}
.settings-btn {
    background: #181818;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #444;
    cursor: pointer;
    transition: background 0.2s;
}
.settings-btn:hover {
    background: #222;
}
.rage-settings-dropdown {
    position: absolute;
    top: 110%;
    right: 0;
    background: #232323;
    border-radius: 12px;
    box-shadow: 0 2px 8px 0 #000a;
    padding: 18px 24px 18px 24px;
    min-width: 220px;
    z-index: 20;
    display: none;
}
.rage-settings-dropdown label {
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
}
.rage-settings-dropdown input[type="range"] {
    width: 100%;
    margin-top: 8px;
}

.settings-generation-btn {
    background: #FF7B00;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    display: none;
    font-size: 14px;
    transition: background-color 0.2s;
    white-space: nowrap;
    height: 35px;
}

.settings-generation-btn:hover {
    background: #D46A00;
}

.settings-generation-btn.t2v-mode {
    background: none;
    border: none;
    color: #ccc;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-generation-btn.t2v-mode:hover {
    color: #FF7B00;
}

.settings-generation-btn.t2v-mode svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.t2v-settings-dropdown {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    display: none;
    min-width: 260px;
    margin-bottom: 5px;
    padding: 18px 20px 18px 20px;
}

.t2v-settings-dropdown.active {
    display: block;
}

.t2v-settings-dropdown .model-option {
    padding: 10px 0;
    cursor: pointer;
    border-bottom: 1px solid #333;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 15px;
}

.t2v-settings-dropdown .model-option:last-child {
    border-bottom: none;
}

.t2v-settings-dropdown .model-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: #666;
}

.t2v-settings-dropdown .model-option .soon-badge {
    background-color: #666;
    color: #ccc;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
    margin-left: 10px;
}

.t2v-settings-dropdown .aspect-ratio-options {
    display: flex;
    gap: 8px;
    margin: 12px 0 18px 0;
}

.t2v-settings-dropdown .aspect-option {
    flex: 1;
    padding: 8px 12px;
    background: #444;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border: 1px solid transparent;
    color: #fff;
}

.t2v-settings-dropdown .aspect-option:hover {
    background-color: #333;
    color: #FF7B00;
}

.t2v-settings-dropdown .aspect-option.active {
    background-color: #232323;
    color: #FF7B00;
    border-color: #FF7B00;
}

.t2v-settings-dropdown .length-slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.t2v-settings-dropdown .length-slider {
    flex: 1;
    height: 4px;
    background: #444;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.t2v-settings-dropdown .length-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #FF7B00;
    border-radius: 50%;
    cursor: pointer;
}

.t2v-settings-dropdown .length-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #FF7B00;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.t2v-settings-dropdown .length-value {
    color: #FF7B00;
    font-weight: bold;
    min-width: 40px;
    text-align: right;
}

.command-suggestions {
    position: absolute;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    max-height: none;
    overflow-y: visible;
    z-index: 9999;
    display: none;
    width: 300px;
    max-width: calc(100vw - 40px);
    bottom: calc(100% + -5px);
    left: 27.5%;
    scrollbar-width: none;
    -ms-overflow-style: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.command-suggestions::-webkit-scrollbar {
    display: none;
}

.chat-input-form {
    display: flex;
    align-items: center;
    background: #181818;
    border: 2.5px solid #333;
    border-radius: 22px;
    position: relative;
    z-index: 1000;
    flex-grow: 1;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    transition: box-shadow 0.3s cubic-bezier(0.25,0.8,0.25,1), border-color 0.3s cubic-bezier(0.25,0.8,0.25,1);
    min-height: 80px;
}

.chat-input-form:focus-within {
    box-shadow: 0 8px 32px rgba(255,123,0,0.12);
    border-color: #FF7B00;
}

.chat-input-form .new-chat-btn {
    position: absolute;
    left: 16px;
    bottom: -11px;
    height: 2.5rem;
    width: 4rem;
    background: rgba(255,123,0,0.12);
    color: #FF7B00;
    border: none;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    box-shadow: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, opacity 0.2s;
    opacity: 0.85;
    z-index: 2;
    padding: 0.5rem 1.2rem;
    position: relative;
}
.chat-input-form .new-chat-btn.vid-extra {
    left: 45px;
    position: absolute;
}
.chat-input-form .vid-separator {
    position: absolute;
    left: 85px;
    bottom: 18px;
    color: #FF7B00;
    font-family: 'Material Icons';
    font-size: 28px;
    opacity: 0.85;
    z-index: 2;
    pointer-events: none;
}

/* Frame upload styles */
.chat-input-form .new-chat-btn.vid-extra {
    position: relative;
    overflow: hidden;
    padding: 0;
}

.chat-input-form .frame-plus {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 18px;
    font-weight: bold;
}

.chat-input-form .frame-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
    z-index: 1;
}

.chat-input-form .frame-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-input-form .remove-frame {
    position: absolute;
    top: 12px;
    right: -13px;
    width: 20px;
    height: 20px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

.chat-input-form .remove-frame:hover {
    background: #ff6666;
    transform: scale(1.1);
}

.chat-input-form .new-chat-btn.vid-extra.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.chat-input-form .new-chat-btn:hover {
    background: #FF7B00;
    color: #fff;
    opacity: 1;
}

.chat-input-form .modes-btn {
    position: absolute;
    top: -14px;
    left: 16px;
    background: rgba(255,123,0,0.12);
    color: #FF7B00;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    padding: 6px 9px 6px 14px;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.85;
    transition: background 0.2s, color 0.2s, opacity 0.2s;
}
.chat-input-form .modes-btn:hover {
    background: #FF7B00;
    color: #fff;
    opacity: 1;
}
.chat-input-form .modes-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    margin-left: 2px;
}

.command-suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    border-bottom: 1px solid #333;
    transition: background-color 0.2s;
}

.command-suggestion-item:last-child {
    border-bottom: none;
}

.command-suggestion-item:hover {
    background: #333;
}

.command-suggestion-item.selected {
    background: #FF7B00 !important;
    color: white !important;
}

.command-suggestion-item.selected .command-name {
    color: white !important;
}

.command-suggestion-item.selected .command-description {
    color: rgba(255, 255, 255, 0.8) !important;
}

.command-name {
    color: #FF7B00;
    font-weight: bold;
}

.command-description {
    color: #999;
    font-size: 0.9em;
}

/* Image upload area styles */
.image-upload-area {
    display: none;
    margin: 10px 0;
    padding: 20px;
    border: 2px dashed #444;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.image-upload-area:hover {
    border-color: #FF7B00;
}

.image-upload-area.drag-over {
    border-color: #FF7B00;
    background: rgba(255, 123, 0, 0.1);
}

.image-preview {
    display: none;
    margin-top: 10px;
    position: relative;
}

.image-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 4px;
}

.image-preview .file-name {
    margin-top: 5px;
    color: #999;
    font-size: 0.9em;
}

.image-preview .remove-image {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* Mode indicator */
.current-mode {
    opacity: 0;
    position: absolute;
    left: 20px;
    top: 20px;
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    display: none;
}

.select-mode-button-container {
    display: flex;
    justify-content: center;
    padding: 15px 0;
    margin-bottom: 15px;
}

#selectModeBtn {
    background-color: #FF7B00;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Binance', 'Arial', sans-serif;
    transition: background-color 0.2s ease;
}
#selectModeBtn:hover {
    background-color: #D46A00;
}

.mode-select-modal {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #2a2a2a;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    z-index: 101;
    width: 380px;
    color: #fff;
    font-family: 'Binance', 'Arial', sans-serif;
}
.mode-select-modal h3 {
    margin-top: 0;
    margin-bottom: 25px;
    text-align: center;
    color: #FF7B00;
    font-size: 20px;
}
.mode-select-modal ul {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}
.mode-select-modal li button {
    background-color: #383838;
    color: #e0e0e0;
    border: 1px solid #4d4d4d;
    padding: 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 15px;
    font-family: 'Binance', 'Arial', sans-serif;
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}
.mode-select-modal li button:hover {
    background-color: #454545;
    border-color: #FF7B00;
    color: #fff;
    transform: translateY(-1px);
}
.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #ccc;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.modal-close-btn:hover {
    color: #FF7B00;
}

.chat-input-form span.prompt-icon { color: #FF7B00; margin-right: 10px; font-weight: bold; }
.chat-input-form input[type="text"] {
    flex-grow: 1; background-color: transparent; border: none; color: white;
    padding: 10px 5px; outline: none; font-size: 14px;
    font-family: 'Binance', 'Arial', sans-serif;
}
.chat-input-form input[type="text"]::placeholder { color: #666; }

.text-to-image-layout { display: flex; flex-direction: column; gap: 20px; height: calc(100vh - 120px - 25px); }
.image-generation-area {
    flex-grow: 1; display: flex; justify-content: center; align-items: center;
    background-color: rgba(30, 30, 30, 0.9); border: 2px dashed #444;
    border-radius: 8px; min-height: 250px;
}
.image-generation-area p { color: #777; font-size: 16px; }
.generation-controls { display: flex; justify-content: flex-end; align-items: center; gap: 15px; }
.generation-controls button {
    background-color: #FF7B00;
    color: white; border: none;
    padding: 10px 20px; border-radius: 5px; cursor: pointer;
    font-size: 14px; font-family: 'Binance', 'Arial', sans-serif;
    transition: background-color 0.2s ease;
}
.generation-controls button:hover { background-color: #D46A00; }
.generation-controls button.settings-btn {
     background-color: #444;
}
.generation-controls button.settings-btn:hover { background-color: #555; }

.chat-message {
    display: flex;
    margin-bottom: 15px;
    max-width: 85%; 
    opacity: 0; 
    transform: translateY(10px); 
    animation: messageFadeIn 0.3s ease-out forwards;
}
@keyframes messageFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.luthara-message {
    align-self: flex-start; 
}
.message-avatar {
    margin: 12px 0;
    width: 35px; 
    height: 35px;
    border-radius: 50%;
    margin-right: 12px; 
    object-fit: cover; /* Ensures image covers the area, crops if necessary */
    flex-shrink: 0;
    background-color: #4f4f4f; 
    overflow: hidden; /* Ensures no overflow if image is oddly shaped before object-fit */
}
.message-bubble {
    background: linear-gradient(135deg, #181818 0%, #1a1a1a 100%);
    border: 2px solid #333;
    border-radius: 20px;
    padding: 18px 24px;
    margin: 12px 0;
    max-width: 80%;
    word-wrap: break-word;
    position: relative;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    transition: all 0.3s cubic-bezier(0.25,0.8,0.25,1);
    backdrop-filter: blur(8px);
    font-size: 14px;
    line-height: 1.4;
}

.message-bubble:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    transform: translateY(-2px);
    border-color: #444;
}

.message-bubble.user {
    background: #FF7B00;
    color: #fff;
    margin-left: auto;
    border: 2px solid #FF7B00;
    box-shadow: 0 4px 24px rgba(255,123,0,0.15);
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.message-bubble.user:hover {
    box-shadow: 0 8px 32px rgba(255,123,0,0.25);
    transform: translateY(-2px);
    border-color: #FF8C1A;
    background: #FF8C1A;
}

.message-bubble.luthara {
    background: linear-gradient(135deg, #1c1c1c 0%, #1e1e1e 100%);
    color: #fff;
    margin-right: auto;
    border: 2px solid #333;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}

.message-bubble.luthara:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.message-bubble .timestamp {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
    opacity: 0.8;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.message-bubble.user .timestamp {
    color: rgba(255, 255, 255, 0.9);
}

.message-bubble p {
    margin: 0 0 10px 0;
}
.message-bubble p:last-child {
    margin-bottom: 0;
}
.message-bubble ul {
    margin-left: 0;
    padding-left: 0;
}
.message-bubble li {
    margin-left: 0;
    padding-left: 0;
    list-style: none;
}
.message-bubble .command {
    font-weight: bold;
    color: #FF7B00; 
}
.message-bubble .description {
    display: block; 
    padding-left: 12px; 
    border-left: 3px solid #FF7B00;
    font-style: italic;
    color: #c0c0c0; 
    margin-top: 5px; 
    background-color: rgba(0,0,0,0.1); /* Darker background for quote */
    padding: 8px 12px; /* Added padding for quote */
    border-radius: 4px; /* Rounded corners for quote bg */
}
.message-text-content span.typing-cursor {
    display: inline-block;
    width: 8px;
    height: 1em;
    background-color: #FF7B00;
    animation: blink 0.7s infinite;
    margin-left: 2px;
}
@keyframes blink {
    50% { opacity: 0; }
}

.message-display-ai .chat-message.luthara-message img.message-avatar {
    width: 35px !important;
    height: 35px !important;
    min-width: 35px !important;
    min-height: 35px !important;
    max-width: 35px !important;
    max-height: 35px !important;
    object-fit: cover !important;
    overflow: hidden !important;
    border-radius: 50% !important; /* Ensure it's a circle */
}

.luthara-message .message-bubble::before {
    content: "";
    position: absolute;
    left: -8px; 
    top: 10px; 
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid #404040; 
}

.integrations-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0;
    max-width: 1200px;
    margin: 0;
}

.integration-card {
    background-color: rgba(28, 28, 28, 0.9);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    height: 200px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.integration-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.integration-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: contain;
}

.integration-name {
    font-size: 16px;
    color: #fff;
    flex-grow: 1;
}

.integration-count {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: #333;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #ccc;
}

.integration-token {
    position: relative;
    margin-bottom: 20px;
}

.token-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

.integration-token input {
    width: 100%;
    padding: 10px;
    padding-right: 40px;
    background-color: #1c1c1c;
    border: 1px solid #333;
    border-radius: 4px;
    color: #fff;
    font-family: monospace;
    box-sizing: border-box;
}

.toggle-visibility {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    padding: 5px;
}

.toggle-visibility:hover {
    color: #fff;
}

.integration-actions {
    margin-top: auto;
    display: flex;
    flex-direction: row;
    gap: 10px;
}

.integration-actions button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
    text-align: center;
}

.edit-btn {
    background-color: #FF7B00;
    color: white;
}

.edit-btn:hover {
    background-color: #D46A00;
}

.delete-btn {
    background-color: #dc3545;
    color: white;
}

.delete-btn:hover {
    background-color: #c82333;
}

.empty-card {
    border: 2px dashed #444;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.empty-card:hover {
    border-color: #FF7B00;
    background-color: rgba(255, 123, 0, 0.05);
}

.empty-card-content {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: color 0.2s ease;
}

.empty-card:hover .empty-card-content {
    color: #FF7B00;
}

.empty-card-content svg {
    stroke: currentColor;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.section-header h2 {
    margin: 0;
    border: none;
    padding: 0;
}

.integration-count {
    background-color: #333;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #ccc;
}

.integration-card {
    background-color: rgba(28, 28, 28, 0.9);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    height: 200px;
    display: flex;
    flex-direction: column;
}

/* Add new styles for chat */
.typing-indicator .typing-dots {
    display: inline-flex;
    align-items: center;
}

.typing-indicator .typing-dots span {
    animation: typingDot 1.4s infinite;
    margin: 0 1px;
}

.typing-indicator .typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator .typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
    margin-left: auto;
    max-width: 85%;
}

.user-message .message-bubble {
    background-color: #FF7B00;
    border-top-right-radius: 5px;
    margin-right: 20px;
    margin-left: 0;
    max-width: 600px; /* Ограничение ширины сообщения */
    word-break: break-word; /* Перенос длинных слов */
}

.user-message .message-bubble::before {
    display: none;
}

.user-message .message-avatar {
    margin-left: 12px;
    margin-right: 0;
    order: 2;
}

.user-message .message-bubble {
    order: 1;
}

.chat-dropdown-item.editing .edit-icon,
.chat-dropdown-item.editing .delete-icon {
    display: none;
}

.chat-dropdown-item .edit-icon {
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    margin-left: 8px;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.chat-dropdown-item .delete-icon {
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    margin-left: 8px;
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    color: #dc3545;
}

.chat-dropdown-item:hover .edit-icon,
.chat-dropdown-item:hover .delete-icon {
    opacity: 1;
}

.chat-dropdown-item .chat-name {
    flex-grow: 1;
    margin-right: 60px; /* Increased space for both icons */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-dropdown-item .edit-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.chat-dropdown-item .delete-icon:hover {
    background-color: rgba(220, 53, 69, 0.2);
}

.agents-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
}

.agents-container.has-agents {
    display: flex;
}

.no-agents-message {
    text-align: center;
    padding: 40px 20px;
    color: #ccc;
}

.no-agents-message.hidden {
    display: none;
}

.agent-card {
    background-color: rgba(28, 28, 28, 0.9);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    height: 200px;
    display: flex;
    flex-direction: column;
    position: relative;
    flex: 1;
    min-width: 300px;
    transition: opacity 0.3s ease;
}

.agent-card.inactive {
    opacity: 0.5;
}

.agent-card.inactive .chat-with-ai-btn {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Agent Modal Styles */
.agent-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.agent-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.agent-modal-content {
    background-color: #2a2a2a;
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.agent-modal-content::-webkit-scrollbar {
    display: none;
}

.agent-modal-content h3 {
    margin: 0 0 25px 0;
    color: #FF7B00;
    font-size: 24px;
    text-align: center;
}

.agent-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-section {
    border-bottom: 1px solid #444;
    padding-bottom: 20px;
}

.form-section h4 {
    color: #fff;
    margin: 0 0 15px 0;
    font-size: 18px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px;
    background-color: #1c1c1c;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: #FF7B00;
}

.form-textarea {
    min-height: 80px;
    resize: vertical;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    color: #ccc;
    margin-bottom: 8px;
    font-size: 14px;
}

.help-icon {
    margin-left: 8px;
    color: #FF7B00;
    cursor: help;
    font-size: 16px;
    font-weight: bold;
}

.photo-section {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    opacity: 0.5;
    pointer-events: none;
}

.model-selection {
    flex: 1;
}

.photo-upload {
    flex: 0 0 auto;
}

.photo-placeholder {
    width: 80px;
    height: 80px;
    border: 2px dashed #444;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.photo-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.llm-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 20px;
}

.cancel-btn, .create-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.cancel-btn {
    background-color: #444;
    color: #ccc;
}

.cancel-btn:hover {
    background-color: #555;
}

.create-btn {
    background-color: #FF7B00;
    color: white;
}

.create-btn:hover {
    background-color: #D46A00;
}

/* Agent Chat Styles */
.agent-chat-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #444;
}

.agent-chat-header h2 {
    margin: 0;
    color: #fff;
    font-size: 24px;
    border-bottom: none;
    padding-bottom: 0;
}

#agent-chat .chat-window-ai {
    height: calc(100vh - 120px);
    padding: 10px;
}

#agent-chat .message-display-ai {
    height: calc(100vh - 180px);
    margin-bottom: 10px;
}

.agent-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 15px;
    overflow: hidden;
}

.agent-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.agent-info {
    text-align: center;
}

.agent-name {
    font-size: 18px;
    color: #fff;
    margin-bottom: 10px;
}

.agent-model {
    font-size: 14px;
    color: #ccc;
}

.delete-agent-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 24px;
    transition: color 0.2s ease;
}

.delete-agent-btn:hover {
    color: #FF7B00;
}

.chat-with-ai-btn {
    background-color: #FF7B00;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
    width: 100%;
    margin-top: auto;
}

.chat-with-ai-btn:hover:not(:disabled) {
    background-color: #D46A00;
}

.create-agent-btn {
    background-color: #FF7B00;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.create-agent-btn:hover {
    background-color: #D46A00;
}

.back-to-agents-btn {
    background: none;
    border: none;
    color: #ccc;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.back-to-agents-btn:hover {
    color: #FF7B00;
}

.build-ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #444;
}

.build-ai-header h2 {
    margin: 0;
    color: #fff;
    border-bottom: none;
    padding-bottom: 0;
}

.token-counter {
    background-color: #333;
    color: #FF7B00;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
}

/* Video Message Styles */
.video-message {
    max-width: 400px; /* Reduced max width for better chat display */
    max-height: 300px; /* Added max height to prevent overly tall videos */
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
    position: relative;
}

.video-message:hover {
    transform: scale(1.02);
}

.video-message video {
    width: 100%;
    height: auto;
    max-height: 300px; /* Limit height in chat */
    display: block;
    object-fit: cover; /* Better handling of aspect ratios */
}

/* Video Modal */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.video-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-modal-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-modal-content video {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    object-fit: contain; /* Ensures entire video is visible */
}

.video-modal-close {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #fff;
    border-radius: 50%;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 10px 15px;
    line-height: 1;
    transition: all 0.2s ease;
    z-index: 2001;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.video-modal-close:hover {
    background: rgba(255, 123, 0, 0.8);
    border-color: #FF7B00;
    transform: scale(1.1);
}

.video-modal-close:active {
    transform: scale(0.95);
}

.t2v-settings-dropdown .model-option .soon-badge {
    background-color: #666;
    color: #ccc;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
}

.setting-group {
    padding: 12px 16px;
    border-bottom: 1px solid #333;
}

.setting-group:last-child {
    border-bottom: none;
}

.setting-group label {
    display: block;
    color: #ccc;
    font-size: 12px;
    margin-bottom: 8px;
    font-weight: bold;
}

.length-slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.length-slider {
    flex: 1;
    height: 4px;
    background: #444;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.length-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #FF7B00;
    border-radius: 50%;
    cursor: pointer;
}

.length-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #FF7B00;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.length-value {
    color: #FF7B00;
    font-weight: bold;
    min-width: 40px;
    text-align: right;
}

.aspect-ratio-options {
    display: flex;
    gap: 8px;
}

.aspect-option {
    flex: 1;
    padding: 8px 12px;
    background: #444;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border: 1px solid transparent;
}

.aspect-option:hover {
    background-color: #333;
    color: #FF7B00;
}

.aspect-option.active {
    background-color: #232323;
    color: #FF7B00;
    border-color: #FF7B00;
}

/* Video Loading Animation */
.video-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: rgba(255, 123, 0, 0.1);
    border-radius: 8px;
    border: 1px solid #FF7B00;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #FF7B00;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #FF7B00;
    font-weight: bold;
}

@keyframes pulse {
    0% { background: rgba(255,123,0,0.12); }
    50% { background: rgba(255,123,0,0.3); }
    100% { background: rgba(255,123,0,0.12); }
}

/* AUTH POPUP */
#auth-popup {
  position: fixed; z-index: 9999; left: 0; top: 0; width: 100vw; height: 100vh;
  background: #111111; display: flex; align-items: center; justify-content: center;
}
.auth-modal {
  background: none !important;
  opacity: 1;
  color: #fff; border-radius: 20px; padding: 0; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  min-width: 500px; max-width: 90vw; text-align: center; font-family: 'Binance', Arial, sans-serif;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.auth-modal h2 { color: #FF7B00; margin-bottom: 18px; }
.auth-modal input[type=email] {
  width: 90%; padding: 12px; border-radius: 6px; border: 1px solid #444; margin-bottom: 16px; font-size: 16px;
  background: #181818; color: #fff;
}
.auth-modal button {
  background: #FF7B00; color: #fff; border: none; border-radius: 6px; padding: 12px 24px; font-size: 16px;
  cursor: pointer; transition: background 0.2s;
}
.auth-modal button:hover { background: #D46A00; }
#auth-message { margin-top: 12px; color: #FF7B00; }
/* END AUTH POPUP */

/* Hide app content when not authenticated */
.app-container.hidden {
  display: none !important;
}

.footer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logout-button {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.logout-button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}
.logout-button:hover {
    color: #FF7B00;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hide scrollbar in chat */
.message-display-ai {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.message-display-ai::-webkit-scrollbar {
    display: none;
}

/* Code block styles */
.code-block {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    margin: 15px 0;
    overflow: hidden;
    position: relative;
}

.code-header {
    background: #2d2d2d;
    padding: 10px 15px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-language {
    color: #ccc;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.copy-button {
    background: #FF7B00;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-family: 'Binance', 'Arial', sans-serif;
    transition: background-color 0.2s ease;
}

.copy-button:hover {
    background: #D46A00;
}

.copy-button.copied {
    background: #28a745;
}

.code-content {
    padding: 15px;
    overflow-x: auto;
    background: #1e1e1e;
}

.code-content pre {
    margin: 0;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.5;
    color: #e6e6e6;
}

.code-content code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-family: inherit;
}

/* Override Prism.js theme for better integration */
.code-content .token.comment,
.code-content .token.prolog,
.code-content .token.doctype,
.code-content .token.cdata {
    color: #6a737d;
}

.code-content .token.punctuation {
    color: #e6e6e6;
}

.code-content .token.property,
.code-content .token.tag,
.code-content .token.boolean,
.code-content .token.number,
.code-content .token.constant,
.code-content .token.symbol,
.code-content .token.deleted {
    color: #79b8ff;
}

.code-content .token.selector,
.code-content .token.attr-name,
.code-content .token.string,
.code-content .token.char,
.code-content .token.builtin,
.code-content .token.inserted {
    color: #85e89d;
}

.code-content .token.operator,
.code-content .token.entity,
.code-content .token.url,
.code-content .language-css .token.string,
.code-content .style .token.string {
    color: #f97583;
}

.code-content .token.atrule,
.code-content .token.attr-value,
.code-content .token.keyword {
    color: #f97583;
}

.code-content .token.function,
.code-content .token.class-name {
    color: #b392f0;
}

.code-content .token.regex,
.code-content .token.important,
.code-content .token.variable {
    color: #ffab70;
}

.code-content .token.important,
.code-content .token.bold {
    font-weight: bold;
}

.code-content .token.italic {
    font-style: italic;
}

.code-content .token.entity {
    cursor: help;
}

/* Markdown styles */
.message-bubble h1, .message-bubble h2, .message-bubble h3, .message-bubble h4, .message-bubble h5, .message-bubble h6 {
    color: #FF7B00;
    margin: 18px 0 10px 0;
    font-weight: 600;
    line-height: 1.2;
}
.message-bubble h1 { font-size: 1.7em; }
.message-bubble h2 { font-size: 1.4em; }
.message-bubble h3 { font-size: 1.2em; }
.message-bubble h4, .message-bubble h5, .message-bubble h6 { font-size: 1em; }

.message-bubble p {
    margin: 0 0 10px 0;
}

.message-bubble li {
    margin-bottom: 6px;
}
.message-bubble a {
    color: #79b8ff;
    text-decoration: underline;
    word-break: break-all;
}
.message-bubble a:hover {
    color: #FF7B00;
}
.message-bubble blockquote {
    border-left: 4px solid #FF7B00;
    background: #232323;
    color: #ccc;
    margin: 12px 0;
    padding: 10px 18px;
    border-radius: 6px;
    font-style: italic;
}
.message-bubble table {
    border-collapse: collapse;
    width: 100%;
    margin: 12px 0;
    background: #191919;
}
.message-bubble th, .message-bubble td {
    border: 1px solid #333;
    padding: 8px 12px;
    text-align: left;
}
.message-bubble th {
    background: #222;
    color: #FF7B00;
}
.message-bubble code:not(.language-), .message-bubble kbd {
    background: #232323;
    color: #FF7B00;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.95em;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
}
.message-bubble hr {
    border: none;
    border-top: 1px solid #333;
    margin: 18px 0;
}

/* Loading dots animation */
@keyframes loadingDots {
    0%, 20% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

#loading-dots {
    animation: loadingDots 1.5s infinite;
}

.rage-settings-popup {
    position: absolute;
    top: 4px;
    right: 4px;
    transform: translateY(-90%) scale(0.95);
    margin-top: -10px;
    background-color: #181818;
    border: 1.5px solid #333;
    border-radius: 18px;
    padding: 16px;
    min-width: 280px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.rage-settings-popup.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-100%);
}

.rage-settings-popup .popup-arrow {
    position: absolute;
    bottom: -11px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 12px;
    overflow: hidden;
}

.rage-settings-popup .popup-arrow svg {
    transform: rotate(0);
}

.rage-settings-popup label {
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
}

.rage-settings-popup .rage-slider-container {
    display: flex;
    align-items: center;
    justify-content: center; /* Center slider and value */
    margin-top: 8px;
    width: 100%;
}

.rage-settings-popup .t2v-settings {
    display: none;
    text-align: left;
}

.rage-settings-popup .rage-settings {
    display: block;
    text-align: center;
}

.rage-settings-popup.video-mode .t2v-settings {
    display: block;
}

.rage-settings-popup.video-mode .rage-settings {
    display: none;
}

.rage-settings-popup .rage-slider-container input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: #444;
    border-radius: 2px;
    outline: none;
    transition: background 0.2s;
}

.rage-settings-popup .rage-slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #FF7B00;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 1;
}

.rage-settings-popup .rage-slider-container input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #FF7B00;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.rage-settings-popup .rage-slider-container input[type="range"]::-ms-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #FF7B00;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.rage-settings-popup .rage-slider-container input[type="range"]::-webkit-slider-thumb:hover {
    background: #D46A00;
}

.rage-settings-popup .rage-slider-container input[type="range"]::-moz-range-thumb:hover {
    background: #D46A00;
}

.rage-settings-popup .rage-slider-container input[type="range"]::-ms-thumb:hover {
    background: #D46A00;
}

.rage-settings-popup .rage-slider-container input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    background: transparent !important;
    border-radius: 2px;
}

.rage-settings-popup .rage-slider-container input[type="range"]::-ms-fill-lower {
    background: transparent !important;
    border-radius: 2px;
}

.rage-settings-popup .rage-slider-container input[type="range"]::-ms-fill-upper {
    background: transparent !important;
    border-radius: 2px;
}

.rage-settings-popup .rage-slider-container input[type="range"]::-moz-range-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: #333;
    border-radius: 2px;
}

.rage-settings-popup .rage-slider-container #rageValue {
    margin-left: 12px;
    font-weight: 600;
    color: #FF7B00;
    min-width: 20px;
    text-align: center;
}

.rage-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: #444;
    outline: none;
    opacity: 0.9;
    transition: opacity .2s;
    cursor: pointer;
}

.rage-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #FF7B00;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    margin-top: -7px;
}

.rage-slider::-webkit-slider-runnable-track {
    height: 4px;
    background: transparent;
    border-radius: 2px;
}

.rage-slider::-ms-fill-lower {
    background: transparent !important;
    border-radius: 2px;
}

.rage-slider::-ms-fill-upper {
    background: transparent !important;
    border-radius: 2px;
}

.rage-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #FF7B00;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    margin-top: 0;
}

.rage-slider::-moz-range-track {
    height: 4px;
    background: transparent;
    border-radius: 2px;
}

.rage-slider::-ms-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #FF7B00;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    margin-top: 0;
}

.rage-slider:focus {
    outline: none;
}

.rage-slider::-webkit-slider-thumb:hover {
    background: #D46A00;
}

.rage-slider::-moz-range-thumb:hover {
    background: #D46A00;
}

.rage-slider::-ms-thumb:hover {
    background: #D46A00;
}

.rage-slider::-webkit-slider-runnable-track {
    height: 4px;
    background: transparent;
    border-radius: 2px;
}

.rage-slider::-ms-fill-lower {
    background: transparent;
}

.rage-slider::-ms-fill-upper {
    background: transparent;
}

.rage-help-icon {
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
    cursor: pointer;
    width: 18px;
    height: 18px;
    position: relative;
}

.rage-tooltip {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    left: 50%;
    bottom: 120%;
    transform: translateX(-50%);
    background: #232323;
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    box-shadow: 0 2px 8px #000a;
    white-space: pre-line;
    min-width: 260px;
    z-index: 100;
    transition: opacity 0.25s;
    margin-top: 0;
    margin-bottom: 6px;
}

.rage-tooltip::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    border-width: 7px 7px 0 7px;
    border-style: solid;
    border-color: #232323 transparent transparent transparent;
}

.rage-help-icon:hover .rage-tooltip,
.rage-help-icon:focus .rage-tooltip {
    opacity: 1;
    pointer-events: auto;
}

/* Loader spinner for auth */
.auth-spinner {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 3px solid #FF7B00;
    border-radius: 50%;
    border-top: 3px solid #fff;
    animation: auth-spin 1s linear infinite;
    vertical-align: middle;
    margin: 0 8px 0 0;
}

@keyframes auth-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Auth modal focus/hover */
#auth-form input[type=email]:focus {
    border-color: #FF7B00;
}

#auth-form button:active {
    background: #D46A00;
}

#auth-form button:disabled {
    background: #444 !important;
    color: #888 !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}

/* Loader spinner for auth */
.auth-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top: 2px solid #fff;
    animation: auth-spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes auth-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Auth modal focus/hover */
#auth-form input[type=email]:focus {
    border-color: #FF7B00;
    box-shadow: 0 0 0 3px rgba(255,123,0,0.1);
}

#auth-form button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255,123,0,0.4);
}

#auth-form button:active:not(:disabled) {
    transform: translateY(0);
    background: linear-gradient(135deg, #D46A00, #FF7B00);
}

#auth-form button:disabled {
    background: #444 !important;
    color: #888 !important;
    cursor: not-allowed !important;
    opacity: 0.7;
    transform: none !important;
    box-shadow: none !important;
}

/* Auth modal backdrop */
#auth-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(8px);
}

/* Loader spinner for auth */
.auth-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top: 2px solid #fff;
    animation: auth-spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

.auth-spinner-large {
    display: inline-block;
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255,123,0,0.2);
    border-radius: 50%;
    border-top: 4px solid #FF7B00;
    animation: auth-spin 1s linear infinite;
}

@keyframes auth-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Auth modal focus/hover */
#auth-form input[type=email]:focus {
    border-color: #FF7B00;
    box-shadow: 0 0 0 3px rgba(255,123,0,0.1);
}

#auth-form button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255,123,0,0.4);
}

#auth-form button:active:not(:disabled) {
    transform: translateY(0);
    background: linear-gradient(135deg, #D46A00, #FF7B00);
}

#auth-form button:disabled {
    background: #444 !important;
    color: #888 !important;
    cursor: not-allowed !important;
    opacity: 0.7;
    transform: none !important;
    box-shadow: none !important;
}

/* Auth modal backdrop */
#auth-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(8px);
}

.chat-input-form textarea {
    background: linear-gradient(135deg, #181818 0%, #1a1a1a 100%);
    border: none;
    outline: none;
    resize: none;
    font-family: inherit;
    color: #fff;
    min-height: 40px;
}

.chat-input-form textarea::placeholder {
    color: #666;
}

/* 1. FLEX-КОНТЕЙНЕР ДЛЯ КНОПОК ФРЕЙМОВ */
.chat-input-form .frame-buttons-row {
    position: absolute;
    bottom: -4px;
    left: 2px;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* 2. УБРАТЬ min-height */
.chat-input-form {
    min-height: unset;
}

/* 3. КНОПКИ ФРЕЙМОВ */
.chat-input-form .new-chat-btn,
.chat-input-form .new-chat-btn.vid-extra {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 2.5rem;
    width: 4rem;
    margin: 0;
    padding: 0;
}

/* 4. КРЕСТИК НА КНОПКЕ */
.chat-input-form .remove-frame {
    position: absolute;
    top: 12px;
    right: -13px;
    width: 20px;
    height: 20px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

.message-image-thumbnail {
    max-width: 100px;
    max-height: 100px;
    border-radius: 8px;
    margin-bottom: 8px;
    display: block;
}

.message-bubble .timestamp {
    display: block;
    text-align: right;
}

.footer-actions button svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: all 0.2s ease;
}

.t2v-settings .model-option {
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.t2v-settings .model-option:not(.disabled):hover {
    background-color: #4f331d !important; /* Use important to override inline styles */
    color: #FF7B00 !important;
}

.rage-settings-popup .rage-slider-container input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: #444;
    border-radius: 2px;
    outline: none;
    transition: background 0.2s;
}

/* Image Generation Styles */
.img-settings {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #333;
  display: none;
}

.img-settings .model-option {
  background: #333;
  border-radius: 8px;
  padding: 6px 12px;
  color: #aaa;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.img-settings .model-option:not(.disabled):hover {
  background: #444;
  color: #FF7B00;
}

.img-settings .model-option.active {
  background: #FF7B00;
  color: #fff;
}

.img-settings .aspect-ratio-options {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.img-settings .aspect-option {
  flex: 1;
  padding: 8px 12px;
  background: #444;
  border-radius: 4px;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border: 1px solid transparent;
}

.img-settings .aspect-option:hover {
  background-color: #333;
  color: #FF7B00;
}

.img-settings .aspect-option.active {
  background-color: #232323;
  color: #FF7B00;
  border-color: #FF7B00;
}

.number-slider-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.number-slider {
  flex: 1;
  height: 4px;
  background: #444;
  border-radius: 2px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.number-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #FF7B00;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.number-slider::-webkit-slider-thumb:hover {
  background: #FF8C1A;
  transform: scale(1.1);
}

.number-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #FF7B00;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.number-slider::-moz-range-thumb:hover {
  background: #FF8C1A;
  transform: scale(1.1);
}

.number-value {
  color: #FF7B00;
  font-size: 12px;
  font-weight: 500;
  min-width: 60px;
}

/* Image Grid Layout */
.image-grid {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.image-grid.single {
  grid-template-columns: 1fr;
}

.image-grid.double {
  grid-template-columns: 1fr 1fr;
}

.image-grid.triple {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.image-grid.quad {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.image-grid.triple .image-item:first-child {
  grid-column: 1 / -1;
}

.image-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #1a1a1a;
  border: 1px solid #333;
  height: 120px;
}

.image-message.single .image-item {
  height: 300px;
}

.image-message.double .image-item {
  height: 200px;
}

.image-item:hover {
  transform: scale(1.02);
  border-color: #FF7B00;
  box-shadow: 0 4px 12px rgba(255, 123, 0, 0.3);
}

.image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

/* Image Modal */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.image-modal.active {
  opacity: 1;
  visibility: visible;
}

.image-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.image-modal-content img {
  max-width: 85vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 12px;
}

.image-modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 32px;
  height: 32px;
  background: #FF7B00;
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.image-modal-close:hover {
  background: #FF8C1A;
  transform: scale(1.1);
}

/* Image Modal Navigation */
.image-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(255, 123, 0, 0.9);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10001;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.image-modal-nav:hover {
  background: rgba(255, 123, 0, 1);
  transform: translateY(-50%) scale(1.1);
}

.image-modal-prev {
  left: 20px;
}

.image-modal-next {
  right: 20px;
}

.image-modal-info {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 10002;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Image Loading Animation */
.image-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: rgba(255, 123, 0, 0.1);
    border-radius: 8px;
    border: 1px solid #FF7B00;
}

.image-loading .loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #FF7B00;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.image-loading .loading-text {
    color: #FF7B00;
    font-weight: bold;
}

/* Image Message Styles */
.image-message {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.image-message.single {
  grid-template-columns: 1fr;
}

.image-message.double {
  grid-template-columns: 1fr 1fr;
}

.image-message.triple {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 200px 120px;
  max-width: 500px;
}

.image-message.quad {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 150px 150px;
  max-width: 500px;
}

.image-message.triple .image-item:first-child {
  grid-column: 1 / -1;
  grid-row: 1 / 2;
  height: 200px;
}

/* Code digit inputs */
.code-digit {
  transition: all 0.3s ease;
}

.code-digit:focus {
  border-color: #FF7B00 !important;
  box-shadow: 0 0 0 3px rgba(255,123,0,0.1);
  transform: scale(1.05);
}

.code-digit.filled {
  border-color: #FF7B00;
  background: rgba(255,123,0,0.1);
}

/* Disabled button styles */
#auth-submit-btn:disabled,
#auth-code-btn:disabled {
  background: #444 !important;
  color: #888 !important;
  cursor: not-allowed !important;
  opacity: 0.7;
  transform: none !important;
  box-shadow: none !important;
}

/* Auth loading styles */
#auth-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  background: rgba(17,17,17,0.9);
  padding: 20px;
  border-radius: 12px;
  backdrop-filter: blur(8px);
}

#modesDropdown {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 100%;
    z-index: 1000;
}

.chat-input-form {
    position: relative;
}

.command-suggestions.show {
    opacity: 1;
    transform: translateY(0);
}
