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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.session-info {
    margin-top: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    display: inline-block;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 20px;
    padding: 30px;
}

.section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.section h2 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.3em;
}

/* Upload Section */
.drop-zone {
    border: 3px dashed #667eea;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.drop-zone:hover, .drop-zone.drag-over {
    background: #f0f4ff;
    border-color: #764ba2;
}

.drop-zone-text p {
    margin: 10px 0;
    color: #666;
}

.uploaded-files {
    margin-top: 20px;
}

.uploaded-files h3 {
    font-size: 1em;
    margin-bottom: 10px;
    color: #666;
}

.uploaded-files ul, .output-files ul {
    list-style: none;
}

.uploaded-files li, .output-files li {
    background: white;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Chat Section */
.chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    min-height: 400px;
    max-height: 600px;
}

.message {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 10px;
    max-width: 85%;
    word-wrap: break-word;
}

.message.user {
    background: #667eea;
    color: white;
    margin-left: auto;
}

.message.assistant {
    background: #e9ecef;
    color: #333;
}

.message.system {
    background: #fff3cd;
    color: #856404;
    text-align: center;
    max-width: 100%;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    max-width: 100%;
}

.command-block {
    background: #2d3748;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    margin: 10px 0;
    overflow-x: auto;
}

.execute-btn {
    margin-top: 10px;
    padding: 8px 16px;
    background: #48bb78;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
}

.execute-btn:hover {
    background: #38a169;
}

.chat-input-container {
    display: flex;
    gap: 10px;
}

#chat-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1em;
    resize: none;
}

#chat-input:focus {
    outline: none;
    border-color: #667eea;
}

/* Output Section */
.output-files {
    margin-top: 15px;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: 40px 20px;
}

.empty-state p {
    margin: 10px 0;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
}

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

/* Progress Bars */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s;
    width: 0%;
}

.upload-progress, .execution-status {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

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

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

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