* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    min-height: 100vh;
    color: #f1f5f9;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo i {
    font-size: 2.5rem;
    color: #10b981;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #10b981, #34d399);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.tagline {
    color: #94a3b8;
    font-size: 1.1rem;
}

/* Cards */
.card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 1.5rem;
    padding: 2rem;
    border: 1px solid rgba(16, 185, 129, 0.2);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.input-section .card {
    max-width: 800px;
    margin: 0 auto;
}

/* Form Elements */
h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

h2 i {
    color: #10b981;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #cbd5e1;
}

.required {
    color: #ef4444;
}

input, textarea, select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.75rem;
    color: #f1f5f9;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: all 0.2s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

textarea {
    resize: vertical;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: 0.75rem;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 0.5rem;
    color: #10b981;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
}

.btn-copy {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: #3b82f6;
    border: none;
    border-radius: 0.5rem;
    color: white;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Tree Container */
.tree-container {
    margin-top: 2rem;
}

.tree-node {
    margin-left: 2rem;
    padding: 0.75rem;
    border-left: 2px solid rgba(16, 185, 129, 0.3);
    position: relative;
}

.tree-node.depth-0 {
    margin-left: 0;
    border-left: none;
}

.node-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 0.75rem;
    transition: all 0.2s;
}

.node-content:hover {
    background: rgba(16, 185, 129, 0.1);
}

.node-checkbox {
    margin-top: 0.25rem;
    cursor: pointer;
    width: 1.25rem;
    height: 1.25rem;
    accent-color: #10b981;
}

.node-info {
    flex: 1;
}

.node-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.node-description {
    font-size: 0.85rem;
    color: #94a3b8;
}

.node-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.expand-btn {
    background: none;
    border: none;
    color: #10b981;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.expand-btn:hover {
    background: rgba(16, 185, 129, 0.2);
}

.regenerate-btn {
    background: none;
    border: none;
    color: #f59e0b;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.regenerate-btn:hover {
    background: rgba(245, 158, 11, 0.2);
}

/* Children Container */
.node-children {
    margin-top: 0.5rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    text-align: center;
    background: #1e293b;
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid #10b981;
}

.loading-spinner i {
    color: #10b981;
}

.loading-spinner p {
    margin-top: 1rem;
    color: #cbd5e1;
}

/* Error Toast */
.error-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #ef4444;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Export Panel */
.export-panel {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(16, 185, 129, 0.2);
}

.export-content {
    background: #0f172a;
    padding: 1rem;
    border-radius: 0.75rem;
    font-family: monospace;
    font-size: 0.875rem;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
}

.tree-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tree-actions {
    display: flex;
    gap: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .tree-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .node-content {
        flex-direction: column;
    }
    
    .node-actions {
        margin-top: 0.5rem;
    }
}