/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f0f0f;
    color: #ffffff;
    overflow: hidden;
}

/* Contenedor principal - OCULTO hasta login */
.app-container {
    display: none; /* BLOQUEADO hasta login */
    height: 100vh;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
}

.app-container.authenticated {
    display: flex; /* Solo visible después del login */
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: #1a1a1a;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 18px;
}

.logo svg {
    color: #00d9ff;
}

.toggle-sidebar {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.toggle-sidebar:hover {
    background: #333;
    color: #fff;
}

.chat-history {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.new-chat-btn button {
    width: 100%;
    background: #00d9ff;
    border: none;
    color: #0f0f0f;
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 20px;
}

.new-chat-btn button:hover {
    background: #00c4e6;
    transform: translateY(-1px);
}

.chat-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-item {
    padding: 12px 16px;
    background: #2a2a2a;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.chat-item:hover {
    background: #333;
    border-color: #444;
}

.chat-item.active {
    background: #00d9ff20;
    border-color: #00d9ff;
}

.chat-item-content {
    flex: 1;
    overflow: hidden;
}

.chat-item-title {
    font-weight: 500;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-item-preview {
    color: #888;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-item-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.chat-item:hover .chat-item-actions {
    opacity: 1;
}

.delete-chat-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    width: 28px;
    height: 28px;
}

.delete-chat-btn:hover {
    background: #ff4444;
    color: #fff;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0f0f0f;
}

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

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.menu-toggle:hover {
    background: #333;
    color: #fff;
}

.chat-info {
    flex: 1;
}

#chatTitle {
    font-weight: 600;
    font-size: 18px;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #888;
}

.welcome-icon {
    margin-bottom: 24px;
    color: #00d9ff;
}

.welcome-screen h2 {
    color: #fff;
    margin-bottom: 8px;
    font-size: 24px;
    font-weight: 600;
}

.welcome-screen p {
    font-size: 16px;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 80%;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: #00d9ff;
    color: #0f0f0f;
}

.message.assistant .message-avatar {
    background: #333;
    color: #fff;
}

.message-content {
    background: #2a2a2a;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #333;
    word-wrap: break-word;
}

.message.user .message-content {
    background: #00d9ff;
    color: #0f0f0f;
    border-color: #00c4e6;
}

/* Input Container */
.input-container {
    padding: 20px;
    border-top: 1px solid #333;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 12px 16px;
    transition: border-color 0.2s;
}

.input-wrapper:focus-within {
    border-color: #00d9ff;
}

#messageInput {
    flex: 1;
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    resize: none;
    outline: none;
    min-height: 24px;
    max-height: 120px;
    line-height: 1.5;
}

#messageInput::placeholder {
    color: #888;
}

.input-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.send-button {
    background: #00d9ff;
    border: none;
    color: #0f0f0f;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.send-button:hover:not(:disabled) {
    background: #00c4e6;
    transform: translateY(-1px);
}

.send-button:disabled {
    background: #555;
    color: #888;
    cursor: not-allowed;
    transform: none;
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .menu-toggle {
        display: block;
    }

    .main-content {
        width: 100%;
    }

    .message {
        max-width: 90%;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message {
    animation: fadeIn 0.3s ease-out;
}

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

.typing-indicator {
    animation: pulse 1.5s infinite;
}

/* Voice and Model Controls */
.voice-button, .model-selector, .memory-button, .call-button {
    background: #333;
    border: none;
    color: #888;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.voice-button:hover, .model-selector:hover, .memory-button:hover, .call-button:hover {
    background: #444;
    color: #fff;
}

.memory-button:hover {
    background: #00d9ff;
    color: #0f0f0f;
}

.call-button:hover {
    background: #28a745;
    color: #fff;
}

.call-button.active {
    background: #28a745;
    color: #fff;
    animation: pulse 2s infinite;
}

.voice-button.recording {
    background: #ff4444;
    color: #fff;
    animation: pulse 1s infinite;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #1a1a1a;
    margin: 10% auto;
    padding: 0;
    border: 1px solid #333;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 70vh;
    overflow: hidden;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #fff;
}

.close-modal {
    background: none;
    border: none;
    color: #888;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #fff;
}

.modal-body {
    padding: 20px;
    max-height: calc(70vh - 80px);
    overflow-y: auto;
}

.model-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.model-item {
    padding: 12px 16px;
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.model-item:hover {
    background: #333;
    border-color: #00d9ff;
}

.model-item.selected {
    background: #00d9ff20;
    border-color: #00d9ff;
}

.model-name {
    font-weight: 500;
    margin-bottom: 4px;
    color: #fff;
}

.model-description {
    font-size: 14px;
    color: #888;
}

/* Voice Recording Indicator */
.voice-indicator {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 20px 40px;
    border-radius: 12px;
    text-align: center;
    z-index: 3000;
    border: 1px solid #333;
}

.voice-indicator.show {
    display: block;
}

.recording-animation {
    width: 60px;
    height: 60px;
    background: #ff4444;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: pulse 1s infinite;
}

.voice-indicator p {
    margin: 0;
    color: #fff;
    font-size: 16px;
}

/* Message with Audio */
.message-audio {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.play-button {
    background: #00d9ff;
    border: none;
    color: #0f0f0f;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.play-button:hover {
    background: #00c4e6;
}

.audio-duration {
    font-size: 12px;
    color: #888;
}

/* Typing Indicator Enhanced */
.typing-message {
    display: flex;
    gap: 12px;
    max-width: 80%;
}

.typing-content {
    background: #2a2a2a;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #888;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

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

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Call Mode Interface */
.call-mode-interface {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000000;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s, visibility 0.3s;
}

.call-mode-interface.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.call-background {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
}

.call-content {
    text-align: center;
    max-width: 600px;
    width: 100%;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100vh;
    box-sizing: border-box;
}

.ai-avatar {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.voice-lines {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    height: 320px;
}

.line {
    width: 35px;
    background: #000000;
    border-radius: 18px;
    animation: voiceBar 1.2s ease-in-out infinite;
    border: 3px solid #333;
}

.line-1 {
    height: 110px;
    animation-delay: 0s;
}

.line-2 {
    height: 160px;
    animation-delay: 0.1s;
}

.line-3 {
    height: 220px;
    animation-delay: 0.2s;
}

.line-4 {
    height: 140px;
    animation-delay: 0.3s;
}

@keyframes voiceBar {
    0%, 100% {
        transform: scaleY(1);
        opacity: 0.7;
    }
    50% {
        transform: scaleY(2);
        opacity: 1;
    }
}

.call-info {
    margin-bottom: 40px;
}

.call-info h1 {
    font-size: 32px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 10px;
}

.call-info p {
    font-size: 18px;
    color: #888;
    margin-bottom: 20px;
}

.call-timer {
    font-size: 24px;
    font-weight: 500;
    color: #00d9ff;
    font-family: monospace;
}

.call-transcript {
    background: rgba(42, 42, 42, 0.8);
    border-radius: 12px;
    padding: 20px;
    margin: 0 auto 40px;
    max-width: 500px;
    min-height: 120px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #333;
}

.transcript-message {
    margin-bottom: 15px;
    padding: 8px 12px;
    border-radius: 8px;
    animation: fadeIn 0.3s ease-out;
}

.transcript-message.user {
    background: rgba(0, 217, 255, 0.2);
    border-left: 3px solid #00d9ff;
    color: #fff;
}

.transcript-message.assistant {
    background: rgba(255, 255, 255, 0.1);
    border-left: 3px solid #888;
    color: #ddd;
}

.call-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: auto;
    padding-bottom: 20px;
}

.call-control-btn {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #333;
    color: #fff;
}

.call-control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.mute-btn {
    background: #6c757d;
}

.mute-btn:hover {
    background: #5a6268;
}

.mute-btn.muted {
    background: #dc3545;
}

.end-call-btn {
    background: #dc3545;
}

.end-call-btn:hover {
    background: #c82333;
}

/* Code Modal Styles */
.code-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.code-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.code-modal-content {
    background: #1a1a1a;
    border-radius: 12px;
    width: 90%;
    height: 90%;
    max-width: 1200px;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
}

.code-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #333;
    background: #2a2a2a;
}

.code-modal-header h3 {
    color: #00d9ff;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.code-modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.code-modal-close:hover {
    background: #333;
    color: #fff;
}

.code-tabs {
    display: flex;
    background: #2a2a2a;
    border-bottom: 1px solid #333;
}

.code-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.code-tab:hover {
    background: #333;
    color: #fff;
}

.code-tab.active {
    color: #00d9ff;
    border-bottom-color: #00d9ff;
    background: #333;
}

.code-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.code-section {
    display: none;
    flex: 1;
    overflow: hidden;
}

.code-section.active {
    display: flex;
    flex-direction: column;
}

#codePreview {
    padding: 0;
}

#codeFrame {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

#codeSource {
    position: relative;
    background: #1a1a1a;
}

#codeSource pre {
    margin: 0;
    padding: 20px;
    overflow: auto;
    height: 100%;
    background: #1a1a1a;
    color: #ddd;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
}

#codeSource code {
    color: #ddd;
}

.copy-code-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #00d9ff;
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
    z-index: 10;
}

.copy-code-btn:hover {
    background: #00c4e6;
    transform: translateY(-1px);
}

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

#codeDownload {
    padding: 20px;
    background: #2a2a2a;
}

.download-options {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.download-btn {
    background: #00d9ff;
    color: #000;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.download-btn:hover {
    background: #00c4e6;
    transform: translateY(-1px);
}

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

.code-info {
    background: #1a1a1a;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #333;
}

.code-info h4 {
    color: #00d9ff;
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
}

.code-info p {
    color: #888;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* Pulse animation for code button */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 217, 255, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 217, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 217, 255, 0);
    }
}

/* Live Code Editor Styles */
.live-code-editor {
    position: fixed;
    top: 0;
    right: 0;
    width: 50%;
    height: 100vh;
    background: #1a1a1a;
    border-left: 2px solid #333;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease-in-out;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
}

.live-code-editor.hidden {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}

.live-code-editor.show {
    transform: translateX(0);
    opacity: 1;
    pointer-events: all;
}

.live-editor-header {
    background: #2a2a2a;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    min-height: 48px;
}

.editor-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #00d9ff;
    font-weight: 600;
}

.editor-title svg {
    animation: pulse 2s infinite;
}

.editor-controls {
    display: flex;
    gap: 8px;
}

.editor-control-btn {
    background: #333;
    border: none;
    color: #888;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-control-btn:hover {
    background: #444;
    color: #fff;
}

.editor-control-btn.active {
    background: #00d9ff;
    color: #000;
}

.live-editor-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.editor-sidebar {
    width: 200px;
    background: #1e1e1e;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
}

.file-explorer {
    flex: 0 0 150px;
    padding: 10px;
    border-bottom: 1px solid #333;
}

.folder-header {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #888;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #ccc;
    transition: all 0.2s;
}

.file-item:hover {
    background: #333;
}

.file-item.active {
    background: #00d9ff;
    color: #000;
}

.live-preview-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.preview-header {
    background: #2a2a2a;
    padding: 8px 12px;
    font-size: 11px;
    color: #888;
    border-bottom: 1px solid #333;
}

#livePreviewFrame {
    flex: 1;
    border: none;
    background: #fff;
}

.code-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.editor-tabs {
    background: #2a2a2a;
    border-bottom: 1px solid #333;
    display: flex;
}

.editor-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #333;
    color: #888;
    font-size: 12px;
    cursor: pointer;
    border-right: 1px solid #444;
    transition: all 0.2s;
}

.editor-tab:hover {
    background: #444;
    color: #fff;
}

.editor-tab.active {
    background: #1a1a1a;
    color: #00d9ff;
}

.line-numbers {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 50px;
    background: #262626;
    color: #666;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 18px;
    padding: 10px 5px;
    text-align: right;
    border-right: 1px solid #333;
    white-space: pre-line;
    overflow: hidden;
    user-select: none;
}

.code-content {
    flex: 1;
    position: relative;
    overflow: auto;
}

#liveCodeContent {
    margin: 0;
    padding: 10px 10px 10px 60px;
    background: #1a1a1a;
    color: #ddd;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 18px;
    min-height: 100%;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#liveCode {
    color: #ddd;
}

.cursor-blink {
    position: absolute;
    width: 2px;
    height: 18px;
    background: #00d9ff;
    animation: blink 1s infinite;
    z-index: 10;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.live-editor-status {
    background: #2a2a2a;
    padding: 8px 20px;
    border-top: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #888;
}

.status-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.separator {
    color: #555;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    width: 120px;
    height: 4px;
    background: #333;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d9ff, #00a8cc);
    transition: width 0.3s ease;
    width: 0%;
}

#progressPercent {
    min-width: 30px;
    text-align: right;
    color: #00d9ff;
    font-weight: 600;
}

/* Syntax highlighting */
.keyword { color: #569cd6; }
.string { color: #ce9178; }
.comment { color: #6a9955; }
.tag { color: #569cd6; }
.attr-name { color: #92c5f5; }
.attr-value { color: #ce9178; }
.number { color: #b5cea8; }
.function { color: #dcdcaa; }

/* Responsive adjustments */
@media (max-width: 1200px) {
    .live-code-editor {
        width: 60%;
    }

    .editor-sidebar {
        width: 150px;
    }
}

@media (max-width: 768px) {
    .live-code-editor {
        width: 100%;
    }

    .editor-sidebar {
        display: none;
    }
}

.speaker-btn {
    background: #28a745;
}

.speaker-btn:hover {
    background: #218838;
}

.speaker-btn.active {
    background: #00d9ff;
}

/* Image Generation Indicators */
.image-generation-indicator {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 24px 40px;
    border-radius: 12px;
    text-align: center;
    z-index: 3000;
    border: 1px solid #333;
    min-width: 280px;
}

.image-generation-indicator.show {
    display: block;
}

.generation-animation {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    border: 4px solid #333;
    border-top: 4px solid #00d9ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.image-generation-indicator p {
    margin: 0;
    color: #fff;
    font-size: 16px;
}

.image-generation-indicator .generation-status {
    color: #00d9ff;
    font-weight: 500;
    margin-top: 8px;
}

/* Message Image Display */
.message-image {
    max-width: 100%;
    width: 400px;
    height: auto;
    border-radius: 8px;
    margin-top: 8px;
    border: 1px solid #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.message-image:hover {
    border-color: #00d9ff;
    transform: scale(1.02);
}

.message-image-container {
    position: relative;
    display: inline-block;
    margin-top: 8px;
}

.message-image-overlay {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s;
}

.message-image-container:hover .message-image-overlay {
    opacity: 1;
}

.message-image-info {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
    font-style: italic;
}

/* Image Modal for Full View */
.image-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(4px);
}

.image-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    overflow: hidden;
}

.image-modal img {
    width: 100%;
    height: auto;
    display: block;
}

.image-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: #fff;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.image-modal-close:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Enhanced Model Selector Styles */
.model-category-header {
    margin: 20px 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.model-category-header:first-child {
    margin-top: 0;
}

.model-category-header h4 {
    color: #00d9ff;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.category-count {
    color: #888;
    font-size: 12px;
    background: #2a2a2a;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid #333;
}

.model-item {
    padding: 16px;
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.model-item:hover {
    background: #333;
    border-color: #00d9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 217, 255, 0.1);
}

.model-item.selected {
    background: #00d9ff20;
    border-color: #00d9ff;
    box-shadow: 0 4px 12px rgba(0, 217, 255, 0.2);
}

.model-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.model-name {
    font-weight: 600;
    color: #fff;
    font-size: 16px;
    line-height: 1.2;
}

.model-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-left: 12px;
}

.reasoning-badge,
.multimodal-badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 500;
    white-space: nowrap;
}

.reasoning-badge {
    background: linear-gradient(135deg, #9333ea, #7c3aed);
    color: #fff;
}

.multimodal-badge {
    background: linear-gradient(135deg, #059669, #047857);
    color: #fff;
}

.model-id {
    color: #888;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    margin-bottom: 6px;
}

.model-capabilities {
    color: #aaa;
    font-size: 12px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Modal improvements */
.model-list {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 8px;
}

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

.model-list::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 3px;
}

.model-list::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

.model-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Login Interface Styles */
.login-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.5s ease-in-out;
}

.login-card {
    background: #2a2a2a;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    max-width: 400px;
    width: 90%;
    animation: slideIn 0.6s ease-out;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    color: #00d9ff;
    margin: 0 0 12px 0;
    font-size: 28px;
    font-weight: 600;
}

.login-header p {
    color: #aaa;
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
}

.login-form {
    width: 100%;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #fff;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #00d9ff;
    box-shadow: 0 0 0 2px rgba(0, 217, 255, 0.1);
}

.form-group input::placeholder {
    color: #666;
}

.login-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #00d9ff, #0099cc);
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.login-btn:hover {
    background: linear-gradient(135deg, #00c4e6, #0088bb);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 217, 255, 0.3);
}

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

/* Animation keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Responsive design for login */
@media (max-width: 480px) {
    .login-card {
        padding: 24px;
        margin: 20px;
    }

    .login-header h1 {
        font-size: 24px;
    }
}

/* Logout Button Styles */
.logout-btn {
    background: transparent;
    border: 1px solid #666;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    margin-left: 12px;
}

.logout-btn:hover {
    background: #333;
    border-color: #888;
    color: #00d9ff;
}

.logout-btn svg {
    width: 14px;
    height: 14px;
}

.chat-info {
    display: flex;
    align-items: center;
}
