* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 25%, #2d3748 50%, #1e3a5f 75%, #16213e 100%);
    background-size: 400% 400%;
    animation: gradientShift 20s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.background-animation::before,
.background-animation::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
}

.background-animation::before {
    top: -250px;
    left: -250px;
    animation-delay: 0s;
}

.background-animation::after {
    bottom: -250px;
    right: -250px;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(100px, 100px) scale(1.1); }
    50% { transform: translate(200px, -50px) scale(0.9); }
    75% { transform: translate(-50px, 150px) scale(1.05); }
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #16213e 0%, #0f1624 50%, #16213e 100%);
    background-size: 200% 200%;
    animation: gradientPulse 3s ease infinite;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    overflow: hidden;
}

@keyframes gradientPulse {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-rings {
    position: absolute;
    width: 300px;
    height: 300px;
}

.loading-rings::before,
.loading-rings::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 3px solid transparent;
    animation: expandRing 2s ease-out infinite;
}

.loading-rings::before {
    width: 100px;
    height: 100px;
    border-top-color: rgba(255, 255, 255, 0.5);
    border-right-color: rgba(255, 255, 255, 0.3);
}

.loading-rings::after {
    width: 200px;
    height: 200px;
    border-top-color: rgba(255, 255, 255, 0.3);
    border-left-color: rgba(255, 255, 255, 0.2);
    animation-delay: 0.5s;
}

@keyframes expandRing {
    0% {
        transform: translate(-50%, -50%) scale(0.5) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2) rotate(360deg);
        opacity: 0;
    }
}

.loading-particles-burst {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.loading-logo {
    width: 150px;
    height: 150px;
    margin-bottom: 30px;
    filter: drop-shadow(0 0 40px rgba(255, 255, 255, 0.8));
    position: relative;
    z-index: 10;
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

.crazy-pulse {
    animation: crazyPulse 1s ease-in-out infinite, spin 10s linear infinite, colorShift 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.5));
    }
    50% {
        transform: scale(1.15);
        filter: drop-shadow(0 0 50px rgba(255, 255, 255, 0.8));
    }
}

@keyframes crazyPulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 40px rgba(255, 255, 255, 0.8)) hue-rotate(0deg);
    }
    25% {
        transform: scale(1.3) rotate(5deg);
        filter: drop-shadow(0 0 60px rgba(100, 200, 255, 1)) hue-rotate(90deg);
    }
    50% {
        transform: scale(0.9) rotate(-5deg);
        filter: drop-shadow(0 0 80px rgba(255, 100, 200, 1)) hue-rotate(180deg);
    }
    75% {
        transform: scale(1.2) rotate(3deg);
        filter: drop-shadow(0 0 60px rgba(100, 255, 200, 1)) hue-rotate(270deg);
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes colorShift {
    0%, 100% { filter: hue-rotate(0deg) saturate(1); }
    50% { filter: hue-rotate(180deg) saturate(1.5); }
}

.loading-text {
    color: white;
    font-size: 1.4rem;
    font-weight: 400;
    letter-spacing: 4px;
    animation: textGlow 1.5s ease-in-out infinite;
    position: relative;
    z-index: 10;
    text-transform: uppercase;
}

.glitch {
    animation: glitch 1s ease-in-out infinite, textGlow 1.5s ease-in-out infinite;
}

@keyframes glitch {
    0%, 100% {
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.8),
                     0 0 20px rgba(100, 200, 255, 0.6);
        transform: translateX(0);
    }
    20% {
        text-shadow: -2px 0 10px rgba(255, 0, 0, 0.8),
                     2px 0 10px rgba(0, 255, 255, 0.8);
        transform: translateX(-2px);
    }
    40% {
        text-shadow: 2px 0 10px rgba(255, 0, 0, 0.8),
                     -2px 0 10px rgba(0, 255, 255, 0.8);
        transform: translateX(2px);
    }
    60% {
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.8),
                     0 0 20px rgba(255, 100, 200, 0.6);
        transform: translateX(0);
    }
}

@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.8),
                     0 0 20px rgba(100, 200, 255, 0.6),
                     0 0 30px rgba(100, 200, 255, 0.4);
    }
    50% {
        text-shadow: 0 0 20px rgba(255, 255, 255, 1),
                     0 0 40px rgba(100, 200, 255, 0.8),
                     0 0 60px rgba(100, 200, 255, 0.6);
    }
}

.loading-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 3px;
    margin-top: 15px;
    animation: fadeInOut 2s ease-in-out infinite;
    position: relative;
    z-index: 10;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.container {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
    animation-delay: 0.3s;
}

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

.glass {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

.glass-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
    animation: slideDown 0.6s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.header-logo {
    width: 50px;
    height: 50px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: rotate(360deg) scale(1.1);
}

.title {
    color: white;
    font-size: 1.8rem;
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.chat-container {
    flex: 1;
    padding: 25px;
    margin-bottom: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: calc(100vh - 240px);
    min-height: 400px;
    animation: scaleIn 0.5s ease;
    min-width: 0;
    position: relative;
    isolation: isolate;
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.chat-container::-webkit-scrollbar {
    width: 8px;
}

.chat-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.chat-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.welcome-message {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    padding: 40px 20px;
    animation: bounceIn 0.8s ease;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.message {
    padding: 15px 20px;
    border-radius: 15px;
    max-width: 75%;
    width: fit-content;
    word-wrap: break-word;
    white-space: pre-wrap;
    animation: messageBounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    overflow-wrap: anywhere;
    word-break: break-word;
    min-height: fit-content;
    height: auto;
    flex-shrink: 0;
    contain: layout;
}

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

@keyframes messageBounceIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.98);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.message.user {
    align-self: flex-end;
    background: rgba(45, 55, 72, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    margin-left: auto;
    animation: messageSlideInRight 0.4s ease;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.message.user:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(45, 55, 72, 0.8), 0 0 20px rgba(100, 150, 255, 0.4);
}

@keyframes messageSlideInRight {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.98);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.message.ai {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.message.ai:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.4), 0 0 20px rgba(100, 200, 255, 0.4);
}

.message.ai::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    animation: shimmer 2s infinite;
    border-radius: 15px;
    overflow: hidden;
}

@keyframes shimmer {
    to {
        transform: translateX(100%);
    }
}

.loading-indicator {
    display: flex;
    gap: 8px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    width: fit-content;
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: messageSlideIn 0.4s ease;
}

.loading-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: white;
    animation: bounce 1.4s ease-in-out infinite;
}

.loading-dot:nth-child(1) { animation-delay: 0s; }
.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    30% {
        transform: translateY(-15px);
        opacity: 1;
    }
}

.input-container {
    display: flex;
    gap: 10px;
    padding: 15px;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.user-input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    resize: none;
    overflow-y: hidden;
    min-height: 50px;
    max-height: 200px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.5;
}

.user-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.user-input:focus {
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.5);
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.send-btn {
    padding: 15px 25px;
    border: none;
    border-radius: 15px;
    background: linear-gradient(135deg, #2d3748 0%, #1e3a5f 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.send-btn:hover {
    transform: scale(1.05) rotate(5deg);
    box-shadow: 0 5px 20px rgba(45, 55, 72, 0.8);
}

.send-btn:active {
    transform: scale(0.95) rotate(-5deg);
    animation: wiggle 0.5s ease;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .title {
        font-size: 1.4rem;
    }
    
    .header-logo {
        width: 40px;
        height: 40px;
    }
    
    .message {
        max-width: 90%;
    }
    
    .chat-container {
        max-height: calc(100vh - 220px);
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.2rem;
    }
    
    .loading-logo {
        width: 80px;
        height: 80px;
    }
    
    .user-input {
        font-size: 0.9rem;
    }
}

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: particleFloat 15s linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) translateX(100px);
        opacity: 0;
    }
}

.menu-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    padding: 12px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
    animation: fadeIn 1s ease;
}

.menu-toggle:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

.sidebar {
    position: fixed;
    left: -320px;
    top: 0;
    width: 300px;
    height: 100vh;
    z-index: 999;
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: left 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-header h2 {
    color: white;
    font-size: 1.5rem;
    margin: 0;
}

.new-chat-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
}

.new-chat-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-list::-webkit-scrollbar {
    width: 6px;
}

.chat-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.chat-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.chat-item {
    padding: 12px 15px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideInLeft 0.3s ease;
}

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

.chat-item:hover {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transform: translateX(5px);
}

.chat-item.active {
    background: rgba(45, 55, 72, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.chat-item-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.delete-chat-btn, .rename-chat-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.delete-chat-btn:hover {
    color: #ff6b6b;
    transform: scale(1.2) rotate(90deg);
}

.rename-chat-btn:hover {
    color: #4dabf7;
    transform: scale(1.2) rotate(-10deg);
}

.sidebar-footer {
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.settings-btn {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    transition: all 0.3s ease;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.model-chooser-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    position: relative;
}

.model-chooser-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.model-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
}

.model-name {
    font-weight: 500;
}

.model-dropdown {
    position: absolute;
    top: 80px;
    right: 70px;
    min-width: 380px;
    padding: 12px;
    display: none;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
    background: rgba(20, 20, 30, 0.95);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.model-dropdown.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.model-option {
    padding: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
}

.model-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.model-option:hover::before {
    left: 100%;
}

.model-option:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateX(8px) scale(1.02);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.model-option-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.6));
    transition: all 0.3s ease;
}

.model-option:hover .model-option-icon {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 0 15px rgba(102, 126, 234, 0.8));
}

.model-option-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.model-option-name {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 700;
    font-size: 1.05rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.model-option-desc {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.model-usage-counter {
    background: rgba(102, 126, 234, 0.3);
    border: 1px solid rgba(102, 126, 234, 0.5);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 0 8px rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 12px rgba(102, 126, 234, 0.3);
    animation: pulse-glow 2s ease-in-out infinite;
    white-space: nowrap;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 12px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
    }
}

.clear-chat-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.clear-chat-btn:hover {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    transform: scale(1.1);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
}

.modal-content {
    padding: 30px;
    max-width: 500px;
    width: 90%;
    animation: scaleIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.modal-content h2 {
    color: white;
    margin-bottom: 20px;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-form label {
    color: white;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-form input {
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.settings-form input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.settings-form input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.settings-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.primary-btn, .secondary-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.primary-btn {
    background: linear-gradient(135deg, #2d3748 0%, #1e3a5f 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(45, 55, 72, 0.5);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .sidebar {
        width: 80%;
        left: -85%;
    }
    
    .container {
        margin-left: 0;
    }
}

.glass-header {
    position: relative;
}

.title {
    flex: 1;
}

@keyframes glow {
    0%, 100% {
        text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    }
    50% {
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 30px rgba(255, 255, 255, 0.6);
    }
}

/* Image Message Styles */
.message.image-message {
    max-width: 90%;
    background: rgba(255, 255, 255, 0.08);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.ai-image {
    max-width: 80%;
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 10px 0;
    box-shadow: 0 0 20px rgba(255,255,255,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.ai-image:hover {
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(255,255,255,0.5), 0 0 40px rgba(102, 126, 234, 0.4);
}

.image-download-btn {
    background: rgba(102, 126, 234, 0.2);
    border: 2px solid rgba(102, 126, 234, 0.4);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.image-download-btn:hover {
    background: rgba(102, 126, 234, 0.4);
    border-color: rgba(102, 126, 234, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.image-download-btn svg {
    transition: transform 0.3s ease;
}

.image-download-btn:hover svg {
    transform: translateY(2px);
}

/* Image Loading Animation */
.loading-indicator.image-loading {
    background: rgba(255, 255, 255, 0.08);
    padding: 30px;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.image-loading-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    animation: pulse 2s ease-in-out infinite;
}

.image-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: rgba(102, 126, 234, 0.8);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Model Usage Counter Styles */
.model-usage-counter {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
}
