:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --background-color: #f5f5f5;
    --text-color: #333;
    --border-color: #ddd;
    --hover-background: #f0f0f0;
}

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

body {
    font-family: Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

header button {
    margin-left: 10px;
}

/* Button styles */
#toggle-sections {
    background-color: var(--secondary-color);
}

/* Create button group when multiple buttons */
header div.button-group {
    display: flex;
    gap: 10px;
}

h1 {
    font-size: 1.8rem;
    color: var(--secondary-color);
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: opacity 0.2s;
}

button:hover {
    opacity: 0.9;
}

#editor-container {
    background-color: white;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-height: 300px;
}

#sections-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

section-component {
    display: block;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Add some hover effect for collapsible sections */
section-component::part(section-header) {
    transition: background-color 0.2s;
}

section-component::part(section-header):hover {
    background-color: var(--hover-background);
}

#scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    font-size: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    transition: all 0.3s ease;
    opacity: 0.9;
    border: 2px solid white;
    padding: 0;
}

#scroll-to-top:hover {
    opacity: 1;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

@media (max-width: 768px) {
    #sections-container {
        grid-template-columns: 1fr;
    }

    body {
        padding: 10px;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
    }

    header button {
        margin-top: 10px;
    }
}

.section-wrapper {
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #ddd;
}

footer {
    text-align: center;
    margin-top: 30px;
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
}

.github-link {
    display: inline-flex;
    align-items: center;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}

.github-link:before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z' fill='%232c3e50'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.github-link:hover {
    color: var(--primary-color);
}

.section {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.section-header {
    background-color: #f5f5f5;
    padding: 10px;
    font-weight: bold;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.section-header::after {
    content: "▼";
    font-size: 0.8em;
    transition: transform 0.2s;
    opacity: 0.7;
    margin-left: 5px;
}

.section-header.collapsed::after {
    transform: rotate(-90deg);
}

.section-header:hover::after {
    opacity: 1;
}

.section-content {
    padding: 15px;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    overflow: hidden;
}

.section-content.collapsed {
    max-height: 0;
    padding: 0 15px;
    border-bottom: none;
    visibility: hidden;
}

.empty-message {
    color: #888;
    font-style: italic;
}

section-item {
    display: block;
    margin-bottom: 8px;
}

.item {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.item-label {
    min-width: 150px;
    font-weight: bold;
    margin-right: 10px;
}

.null-value {
    color: #888;
    font-style: italic;
}

.array-item {
    border: 1px solid #eee;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.array-item-header {
    font-weight: bold;
    margin-bottom: 5px;
}

conversion-component {
    display: block;
    margin-bottom: 15px;
}

.conversion-container {
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 4px;
    background-color: #f9f9f9;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.conversion-label {
    margin: 0 8px;
    font-weight: bold;
}

.property-selector {
    margin-right: 8px;
}

.conversion-container #apply-conversion {
    padding: 5px 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    margin: 0 8px;
    transform: scale(0.8);
}

.conversion-container #apply-conversion:disabled {
    background-color: #aaaaaa;
    cursor: not-allowed;
    opacity: 0.8;
}

.conversion-container #apply-conversion:hover:not(:disabled) {
    background-color: #45a049;
}

input, select {
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

input {
    flex: 1;
}

conversion-component input {
    width: 120px;
}

@media (max-width: 600px) {
    .conversion-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .conversion-container input,
    .conversion-container button,
    .conversion-container select {
        margin-top: 8px;
    }

    .conversion-container button {
        margin-left: 0;
    }
}

#conversion-container {
    margin-bottom: 15px;
}

.section-items {
    padding-top: 5px;
}