/* static/css/hatch.css  */


#chatPanel {
    min-height: 300px !important;
    display: flex !important;
    flex-direction: column !important;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 300px;
    background: #1e293b;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    scroll-behavior: smooth;
    min-height: 150px;
}

.chat-input-area {
    border-top: 1px solid #475569;
    padding: 12px;
    background: #0f172a;
    flex-shrink: 0; /* Prevent input area from shrinking */
    min-height: 80px; /* Guarantee visibility */
}

/* === Rest of Original CSS === */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

.loader {
    border: 3px solid rgba(96, 165, 250, 0.2);
    border-radius: 50%;
    border-top: 3px solid #60a5fa;
    width: 48px;
    height: 48px;
    animation: spin 1s linear infinite;
}

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

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in {
    animation: slideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.CodeMirror {
    height: 100% !important;
    font-size: 14px;
    line-height: 1.5;
}

.file-item {
    cursor: pointer;
    transition: all 0.2s;
    padding: 8px 12px;
    border-radius: 6px;
}

.file-item:hover {
    background: rgba(96, 165, 250, 0.1);
}

.file-item.active {
    background: rgba(96, 165, 250, 0.2);
    border-left: 3px solid #60a5fa;
}

.file-item.modified {
    border-left: 3px solid #fbbf24;
    animation: fileModified 1s ease;
}

.file-item.new-file {
    border-left: 3px solid #10b981;
    animation: fileCreated 1s ease;
}

@keyframes fileModified {
    0%, 100% { background: rgba(251, 191, 36, 0.1); }
    50% { background: rgba(251, 191, 36, 0.3); }
}

@keyframes fileCreated {
    0%, 100% { background: rgba(16, 185, 129, 0.1); }
    50% { background: rgba(16, 185, 129, 0.3); }
}

.folder-item {
    cursor: pointer;
    user-select: none;
    padding: 6px 12px;
    transition: background 0.2s;
}

.folder-item:hover {
    background: rgba(148, 163, 184, 0.1);
}

.folder-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.folder-content.expanded {
    max-height: 2000px;
}

.chevron {
    transition: transform 0.2s;
    display: inline-block;
}

.chevron.rotated {
    transform: rotate(90deg);
}

.preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

/* Input Screen Fixes */
#inputScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    height: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden;
}

#inputScreen > div {
    min-height: 100vh;
    height: auto;
    overflow-y: visible;
}

/* Editor Screen Fix */
#editorScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.hidden {
    display: none !important;
}

.resizer {
    background: #475569;
    cursor: ew-resize;
    width: 4px;
    position: relative;
    transition: background 0.2s;
}

.resizer:hover {
    background: #60a5fa;
}

.resizer-vertical {
    cursor: ns-resize;
    height: 4px;
    width: 100%;
}

.preview-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: white;
}

.preview-fullscreen iframe {
    width: 100%;
    height: 100%;
}

.preview-fullscreen .bg-slate-800 {
    background: #1e293b !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.chat-message {
    margin-bottom: 16px;
    animation: messageSlideIn 0.3s ease;
}

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

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

.message-assistant {
    display: flex;
    justify-content: flex-start;
}

.message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
}

.message-user .message-content {
    background: #3b82f6;
    color: white;
}

.message-assistant .message-content {
    background: #334155;
    color: #e2e8f0;
}

.message-processing .message-content {
    background: #475569;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

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

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.file-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin: 2px;
    font-family: 'Courier New', monospace;
}

.badge-modified {
    background: #fef3c7;
    color: #92400e;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: #1e293b;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 8px;
    margin: 8px 0;
    transition: all 0.3s ease;
}

.status-item.active {
    background: rgba(59, 130, 246, 0.2);
    border-left: 3px solid #3b82f6;
}

.status-item.completed {
    background: rgba(34, 197, 94, 0.2);
    border-left: 3px solid #22c55e;
}

.status-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-icon.pending {
    background: #475569;
}

.status-icon.active {
    background: #3b82f6;
    animation: pulse 2s ease-in-out infinite;
}

.status-icon.completed {
    background: #22c55e;
}

.status-spinner {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    animation: spin 1s linear infinite;
}

.checkmark {
    color: white;
    font-size: 12px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

/* Mobile/Responsive */
@media (max-width: 768px) {
    #inputScreen {
        height: auto !important;
        min-height: 100vh;
    }
    
    #chatPanel {
        min-height: 250px !important;
    }
    
    .chat-input-area {
        min-height: 70px !important;
    }
}

/* Tab Styling */
.editor-tab {
    min-width: 120px;
    max-width: 200px;
    user-select: none;
}

.editor-tab:hover {
    background: #334155 !important;
}

.modified-indicator {
    color: #fff;
    font-size: 16px;
    line-height: 1;
    animation: pulse-dot 2s ease-in-out infinite;
}

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

.saved-indicator {
    color: #10b981;
    font-size: 14px;
    line-height: 1;
    animation: fadeInScale 0.3s ease-out;
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.close-tab-btn {
    flex-shrink: 0;
}

.close-tab-btn:hover {
    background: #64748b !important;
}

.file-item.file-open {
    font-weight: 500;
}

.file-item.file-open svg {
    color: #60a5fa !important;
}

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

.animate-slide-up {
    animation: slide-up 0.3s ease-out;
    transition: opacity 0.3s, transform 0.3s;
}

#editorTabs > div::-webkit-scrollbar {
    height: 3px;
}

#editorTabs > div::-webkit-scrollbar-track {
    background: #1e293b;
}

#editorTabs > div::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}

#editorTabs > div::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.save-file-btn .opacity-75 {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
}

.editor-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #94a3b8;
    font-size: 0.875rem;
}


.status-item.retrying .status-icon {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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