/* AI Assistant Styles */
.ai-section {
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    width: 35%;
    display: flex;
    flex-direction: column;
    background: #f5f5f5;
    z-index: 100;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
}

.resize-handle {
    position: absolute;
    left: 0;
    top: 0;
    width: 10px;
    height: 100%;
    cursor: ew-resize;
    background: transparent;
    z-index: 1000;
    transition: background 0.2s;
}

.resize-handle::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 60px;
    background: rgba(102, 126, 234, 0.5);
    border-radius: 1px;
    transition: all 0.2s;
}

.resize-handle:hover::before {
    background: rgba(102, 126, 234, 0.8);
    height: 100px;
    width: 3px;
}

.resize-handle.resizing::before {
    background: #667eea;
    height: 100%;
    width: 4px;
    top: 0;
    transform: translateY(0);
    border-radius: 0;
}

.resize-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: #667eea;
    z-index: 9999;
    display: none;
    pointer-events: none;
}

.ai-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-header-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.ai-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #fff;
}

.message {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 85%;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 14px;
    font-family: Arial, sans-serif;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-message {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #90caf9;
    margin-right: auto;
}

.user-message {
    background: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 100%);
    border: 1px solid #81c784;
    margin-left: auto;
}

/* Code block styling */
.code-block-wrapper {
    margin: 12px 0;
    border-radius: 8px;
    overflow: hidden;
    background: #1e1e1e;
}

.code-block-header {
    background: #2d2d30;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3e3e42;
}

.code-language {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.copy-code-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    font-weight: 500;
}

.copy-code-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.copy-icon {
    font-size: 14px;
}

.message pre {
    background: #1e1e1e;
    padding: 16px;
    overflow-x: auto;
    margin: 0;
}

.message pre code {
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    display: block;
}

.message code.inline-code {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    color: #c7254e;
}

.chat-input {
    padding: 16px;
    background: #fff;
    border-top: 2px solid #e0e0e0;
    display: flex;
    gap: 10px;
    position: relative;
    z-index: 100;
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 24px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.chat-input input:focus {
    outline: none;
    border-color: #667eea;
}

.chat-input button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.chat-input button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.chat-input button:active {
    transform: translateY(0);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Ensure editor wrapper resizes properly */
.editor-wrapper {
    float: left;
    box-sizing: border-box;
}

.editor-wrapper iframe {
    width: 100% !important;
    display: block;
}
