/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: #0d1117;
    color: #e6edf3;
    height: 100vh;
    overflow: hidden;
}

/* Main container */
.main-container {
    display: flex;
    height: calc(100vh - 69px);
    background: #0d1117;
}

/* Left panel - Form (larger) */
.left-panel {
    flex: 1;
    background: #0d1117;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Right panel - Chat (smaller) */
.right-panel {
    width: 400px;
    background: #161b22;
    border-left: 1px solid #30363d;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 20px;
    border-bottom: 1px solid #30363d;
    background: #161b22;
    flex-shrink: 0;
}

.panel-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-title {
    font-size: 18px;
    font-weight: 600;
    color: #f0f6fc;
    margin-bottom: 4px;
}

.panel-subtitle {
    font-size: 14px;
    color: #8b949e;
}

.validation-status {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    background: #dc2626;
    color: white;
}

.validation-status.valid {
    background: #16a34a;
    color: white;
}

.validation-status.invalid {
    background: #dc2626;
    color: white;
}

.validation-status.incomplete {
    background: #f59e0b;
    color: white;
}

/* Form container (left panel) */
.form-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    min-height: 0;
}

.form-container::-webkit-scrollbar {
    display: none;
}

/* Chat container (right panel) */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    min-height: 0;
}

.chat-messages::-webkit-scrollbar {
    display: none;
}

/* Chat input area */
.chat-input-area {
    border-top: 1px solid #30363d;
    background: #161b22;
    padding: 20px;
    flex-shrink: 0;
}

.chat-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    color: #e6edf3;
    font-size: 14px;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    transition: border-color 0.2s ease;
}

.chat-input:focus {
    outline: none;
    border-color: #1f6feb;
    box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.2);
}

.chat-input::placeholder {
    color: #8b949e;
}

.chat-send-btn {
    padding: 12px 20px;
    background: #1f6feb;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    height: 44px;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background: #1a5cd8;
}

.chat-send-btn:disabled {
    background: #30363d;
    cursor: not-allowed;
}

/* Form sections */
.form-section {
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 8px;
    margin-bottom: 8px;
}

.section-title {
    font-size: 11px;
    font-weight: 600;
    color: #f0f6fc;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-label {
    display: block;
    font-size: 10px;
    font-weight: 500;
    color: #e6edf3;
    margin-bottom: 3px;
}

.form-input {
    width: 100%;
    padding: 4px 8px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 4px;
    color: #e6edf3;
    font-size: 11px;
    transition: border-color 0.2s ease;
    margin-bottom: 6px;
    height: 24px;
    box-sizing: border-box;
    vertical-align: top;
}

.form-input.compact {
    padding: 3px 6px;
    font-size: 10px;
    margin-bottom: 4px;
    height: 24px;
    box-sizing: border-box;
}

/* Ensure all input types have same height */
input.form-input,
select.form-input,
textarea.form-input {
    height: 24px;
    line-height: 1;
}

textarea.form-input {
    resize: none;
    padding-top: 3px;
    overflow: hidden;
}

.form-input.small {
    max-width: 120px;
}

.form-input.medium {
    max-width: 180px;
}

.form-input:focus {
    outline: none;
    border-color: #1f6feb;
    box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.2);
}

.form-input::placeholder {
    color: #8b949e;
}

/* Flash animation for programmatic updates */
@keyframes flash-update {
    0% {
        background-color: #0d1117;
        border-color: #30363d;
    }
    25% {
        background-color: rgba(31, 111, 235, 0.15);
        border-color: #1f6feb;
        box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.3);
    }
    75% {
        background-color: rgba(31, 111, 235, 0.1);
        border-color: #1f6feb;
        box-shadow: 0 0 0 1px rgba(31, 111, 235, 0.2);
    }
    100% {
        background-color: #0d1117;
        border-color: #30363d;
    }
}

.form-input.flash-update {
    animation: flash-update 1.2s ease-out;
}

/* 12-column base grid system */
.grid-base {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 4px;
    margin-bottom: 4px;
    align-items: end;
}

.grid-base .form-input {
    margin-bottom: 0;
}

/* Column span classes */
.col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }

/* Legacy grid classes - now using 12-column base */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 4px;
    margin-bottom: 4px;
    align-items: end;
}

.grid-2 > div {
    grid-column: span 6;
}

.grid-2 .form-input {
    margin-bottom: 0;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 4px;
    margin-bottom: 4px;
    align-items: end;
}

.grid-3 > div {
    grid-column: span 4;
}

.grid-3 .form-input {
    margin-bottom: 0;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 4px;
    margin-bottom: 4px;
    align-items: end;
}

.grid-4 > div {
    grid-column: span 3;
}

.grid-4 .form-input {
    margin-bottom: 0;
}

.grid-6 {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 4px;
    margin-bottom: 4px;
    align-items: end;
}

.grid-6 > div {
    grid-column: span 2;
}

.grid-6 .form-input {
    margin-bottom: 0;
}

.grid-2-no-margin {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 4px;
    align-items: end;
}

.grid-2-no-margin > div {
    grid-column: span 6;
}

.grid-2-no-margin .form-input {
    margin-bottom: 0;
}

/* Force consistent field heights */
.grid-2 > div,
.grid-3 > div,
.grid-4 > div,
.grid-6 > div,
.grid-2-no-margin > div {
    display: flex;
    flex-direction: column;
    min-height: 40px;
}

.grid-2 > div .form-label,
.grid-3 > div .form-label,
.grid-4 > div .form-label,
.grid-6 > div .form-label,
.grid-2-no-margin > div .form-label {
    margin-bottom: 3px;
    height: 13px;
    line-height: 13px;
}

.grid-2 > div .form-input,
.grid-3 > div .form-input,
.grid-4 > div .form-input,
.grid-6 > div .form-input,
.grid-2-no-margin > div .form-input {
    margin-top: auto;
}

/* Buttons */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}





.btn-clear {
    background: #6e7681;
    color: white;
}

.btn-clear:hover {
    background: #8b949e;
}

.btn-load {
    background: #238636;
    color: white;
}

.btn-load:hover {
    background: #2ea043;
}

/* Message styles */
.message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
}

.message-avatar-ai {
    background: linear-gradient(135deg, #1f6feb, #8b5cf6);
    color: white;
}

.message-avatar-user {
    background: #238636;
    color: white;
}

.message-content {
    flex: 1;
    line-height: 1.5;
    font-size: 14px;
}

.message-content-ai {
    color: #e6edf3;
}

.message-content-user {
    color: #e6edf3;
}

/* Welcome message */
.welcome-text {
    color: #e6edf3;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.welcome-list {
    margin: 8px 0 0 0;
    padding-left: 16px;
    color: #8b949e;
    font-size: 13px;
}

.welcome-list li {
    margin-bottom: 4px;
}

/* Header */
.header {
    background: #161b22;
    border-bottom: 1px solid #30363d;
    padding: 16px 20px;
    flex-shrink: 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: none;
    gap: 20px;
}

.header-left {
    flex-shrink: 0;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 500px;
}

.header-right {
    flex-shrink: 0;
}

.header-title {
    font-size: 20px;
    font-weight: 600;
    color: #f0f6fc;
}

.header-subtitle {
    font-size: 14px;
    color: #8b949e;
    margin-top: 2px;
}

.header-buttons {
    display: flex;
    gap: 8px;
}

/* API Key in Header */
.api-key-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.api-key-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #f0f6fc;
    cursor: pointer;
    justify-content: center;
}

.api-key-icon {
    font-size: 14px;
}

.api-key-input-group {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.api-key-input {
    flex: 1;
    padding: 8px 10px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #e6edf3;
    font-size: 12px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    transition: border-color 0.2s ease;
    min-width: 0;
}

.api-key-input:focus {
    outline: none;
    border-color: #1f6feb;
    box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.2);
}

.api-key-input::placeholder {
    color: #8b949e;
}

.api-key-toggle {
    padding: 6px 8px;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #8b949e;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.api-key-toggle:hover {
    background: #30363d;
    color: #e6edf3;
}

.api-key-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    justify-content: center;
}

.status-indicator {
    font-size: 12px;
}

.status-text {
    color: #8b949e;
}

.api-key-status.valid .status-indicator {
    color: #238636;
}

.api-key-status.valid .status-text {
    color: #238636;
}

.api-key-status.invalid .status-indicator {
    color: #da3633;
}

.api-key-status.invalid .status-text {
    color: #da3633;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .header-container {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .header-left {
        text-align: center;
    }
    
    .header-center {
        max-width: none;
        justify-content: stretch;
    }
    
    .header-right {
        display: flex;
        justify-content: center;
    }
    
    .api-key-content {
        max-width: 400px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    
    .left-panel {
        width: 100%;
        height: 50vh;
        border-right: none;
        border-bottom: 1px solid #30363d;
    }
    
    .right-panel {
        height: 50vh;
        border-left: none;
        border-top: 1px solid #30363d;
    }
    
    .header-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn {
        width: 100%;
    }
}

/* Custom scrollbar for webkit browsers (hidden) */
::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

/* Ensure no scrollbars appear */
html, body {
    overflow: hidden;
} 