/* Global Styles */
* {
    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%);
    color: #333;
    min-height: 100vh;
}

.container {
    display: grid;
    grid-template-columns: 1fr 300px;
    grid-template-rows: auto auto 1fr;
    grid-template-areas: 
        "header header"
        "controls controls"
        "tree sidebar";
    height: 100vh;
    gap: 10px;
    padding: 10px;
}

/* Header */
.header {
    grid-area: header;
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 5px;
}

.inspiration {
    font-size: 0.9rem;
    color: #888;
}

.inspiration a {
    color: #667eea;
    text-decoration: none;
}

.inspiration a:hover {
    text-decoration: underline;
}

/* Controls */
.controls {
    grid-area: controls;
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

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

.btn:active {
    transform: translateY(0);
}

/* Tree Container */
.tree-container {
    grid-area: tree;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

#tree {
    width: 100%;
    height: 100%;
    display: block;
}

/* Sidebar */
.sidebar {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.node-info, .legend, .schema-stats {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.node-info h3, .legend h3, .schema-stats h3 {
    margin-bottom: 15px;
    color: #667eea;
    font-size: 1.2rem;
}

/* Legend */
.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.legend-color.root {
    background: #667eea;
}

.legend-color.field {
    background: #48bb78;
}

.legend-color.subfield {
    background: #ed8936;
}

.legend-color.union-member {
    background: #9f7aea;
}

.legend-color.enum-value {
    background: #38b2ac;
}

/* Tree Styles */
.node circle {
    cursor: pointer;
    stroke: #fff;
    stroke-width: 2px;
    transition: all 0.3s ease;
}

.node circle.root {
    fill: #667eea;
}

.node circle.field {
    fill: #48bb78;
}

.node circle.subfield {
    fill: #ed8936;
}

.node circle.union-member {
    fill: #9f7aea;
}

.node circle.enum-value {
    fill: #38b2ac;
}

.node circle:hover {
    stroke-width: 4px;
    filter: brightness(1.1);
}

.node text {
    font: 12px sans-serif;
    cursor: pointer;
    fill: #333;
    text-anchor: start;
}

.node text.root {
    font-weight: bold;
    font-size: 14px;
    fill: #667eea;
}

.link {
    fill: none;
    stroke: #ddd;
    stroke-width: 2px;
    transition: stroke 0.3s ease;
}

.link:hover {
    stroke: #667eea;
    stroke-width: 3px;
}

/* Node Details */
#nodeDetails {
    font-size: 0.9rem;
    line-height: 1.6;
}

#nodeDetails h4 {
    color: #667eea;
    margin-bottom: 8px;
}

#nodeDetails .detail-item {
    margin-bottom: 6px;
}

#nodeDetails .detail-label {
    font-weight: 600;
    color: #555;
}

#nodeDetails .detail-value {
    color: #777;
}

/* Schema Stats */
#stats {
    font-size: 0.9rem;
    line-height: 1.6;
}

#stats .stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    padding: 4px 0;
    border-bottom: 1px solid #eee;
}

#stats .stat-label {
    font-weight: 600;
    color: #555;
}

#stats .stat-value {
    color: #667eea;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "header"
            "controls"
            "tree"
            "sidebar";
    }
    
    .sidebar {
        flex-direction: row;
        overflow-x: auto;
    }
    
    .node-info, .legend, .schema-stats {
        min-width: 250px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.node {
    animation: fadeIn 0.5s ease;
}

/* Tooltip */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.tooltip.visible {
    opacity: 1;
} 