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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

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

.header-content > div {
    text-align: left;
}

header h1 {
    color: #333;
    font-size: 2rem;
    margin-bottom: 10px;
}

header p {
    color: #666;
    font-size: 1.1rem;
}

.btn-docs {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.btn-docs:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.editor-panel, .output-panel {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.panel-header {
    background: #4a5568;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.button-group {
    display: flex;
    gap: 10px;
}

.template-select {
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background: #4299e1;
    color: white;
}

.btn-primary:hover {
    background: #3182ce;
}

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

.btn-secondary:hover {
    background: #4a5568;
}

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

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

.btn-small {
    padding: 5px 15px;
    font-size: 0.85rem;
    background: #e53e3e;
    color: white;
}

.btn-small:hover {
    background: #c53030;
}

.CodeMirror {
    height: 400px;
    font-size: 14px;
    border-bottom: 1px solid #e2e8f0;
}

.output-content {
    padding: 20px;
    min-height: 400px;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    background: #1a202c;
    color: #e2e8f0;
}

.output-content.error {
    color: #fc8181;
}

.output-content.success {
    color: #68d391;
}

.placeholder {
    color: #718096;
    font-style: italic;
}

.ai-assistant {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 20px;
}

.ai-content {
    padding: 20px;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    background: #f7fafc;
    line-height: 1.6;
}

.ai-content.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #718096;
}

.ai-input-group {
    padding: 15px;
    display: flex;
    gap: 10px;
    background: #edf2f7;
}

.ai-input-group input {
    flex: 1;
    padding: 12px;
    border: 2px solid #cbd5e0;
    border-radius: 5px;
    font-size: 1rem;
}

.ai-input-group input:focus {
    outline: none;
    border-color: #4299e1;
}

.examples-section {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.examples-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.example-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.example-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.example-card h4 {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.example-card p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4299e1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@media (max-width: 968px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        flex-wrap: wrap;
    }
}

/* File Actions */
.file-actions {
    display: flex;
    gap: 8px;
    padding: 10px 20px;
    background: #f7fafc;
    border-top: 1px solid #e2e8f0;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
    background: white;
    border: 1px solid #cbd5e0;
    color: #4a5568;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s;
}

.btn-sm:hover {
    background: #edf2f7;
    border-color: #a0aec0;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 5px;
}

.tab-btn {
    padding: 8px 20px;
    background: transparent;
    border: none;
    color: #718096;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    font-weight: 500;
}

.tab-btn:hover {
    color: #4a5568;
    background: rgba(0, 0, 0, 0.05);
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.markdown-preview {
    background: #f7fafc;
    padding: 20px;
    border-radius: 5px;
    min-height: 300px;
    max-height: 400px;
    overflow-y: auto;
    line-height: 1.6;
}

.markdown-preview code {
    background: #edf2f7;
    padding: 2px 6px;
    border-radius: 3px;
    color: #e53e3e;
    font-family: 'Courier New', monospace;
}

.markdown-preview strong {
    color: #2d3748;
}

.markdown-preview em {
    color: #4a5568;
}

/* GitHub Browser Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

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

.modal-header h2 {
    margin: 0;
    color: #2d3748;
}

.btn-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #718096;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    transition: all 0.2s;
}

.btn-close:hover {
    background: #edf2f7;
    color: #2d3748;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.github-search {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.github-search input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #cbd5e0;
    border-radius: 5px;
    font-size: 1rem;
}

.filter-select {
    padding: 10px 15px;
    border: 1px solid #cbd5e0;
    border-radius: 5px;
    background: white;
    cursor: pointer;
}

.github-breadcrumb {
    padding: 10px 0;
    color: #4a5568;
    font-size: 0.9rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 15px;
}

.breadcrumb-link {
    color: #4299e1;
    cursor: pointer;
    text-decoration: underline;
}

.breadcrumb-link:hover {
    color: #3182ce;
}

.github-file-list {
    min-height: 300px;
}

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

.file-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #f7fafc;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    gap: 12px;
}

.file-item:hover {
    background: #edf2f7;
    transform: translateX(5px);
}

.file-item.directory {
    border-left: 3px solid #4299e1;
}

.file-item.repository {
    border-left: 3px solid #667eea;
}

.file-item.file {
    border-left: 3px solid #48bb78;
    cursor: default;
}

.file-item.file:hover {
    transform: none;
}

.file-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 600;
    color: #2d3748;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-desc {
    font-size: 0.85rem;
    color: #718096;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.file-size {
    font-size: 0.8rem;
    color: #a0aec0;
    margin-top: 2px;
}

.btn-import {
    padding: 6px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-import:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.private-badge {
    background: #fc8181;
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
}
