/* nectar/crates/primitives/examples/wasm-demo/styles.css */
:root {
    --primary-color: #3f51b5;
    --secondary-color: #606dbc;
    --background-color: #f8f9fa;
    --text-color: #333;
    --border-color: #e0e0e0;
}

* {
    box-sizing: border-box;
}

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
        sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    margin: 0;
    padding: 20px;
}

main {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1,
h2 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 20px;
}

h1 {
    text-align: center;
}

h2 {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    margin-top: 40px;
    font-size: 1.5rem;
}

.description {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 30px;
    color: #666;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.tab-button {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: bold;
    color: #666;
    transition: all 0.2s ease;
}

.tab-button:hover {
    background-color: #f5f5f5;
    color: var(--primary-color);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-pane {
    display: none;
}

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

/* BMT Hasher Tab */
.input-container {
    margin-bottom: 30px;
}

textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 16px;
    resize: vertical;
}

.stats {
    margin-top: 8px;
    font-size: 14px;
    color: #666;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.span-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

#span-input {
    width: 100px;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

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

.result-box {
    position: relative;
    background-color: #f5f5f5;
    border-radius: 4px;
    padding: 15px;
}

.hash-output {
    background-color: #f0f0f0;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
    font-family: monospace;
    margin: 0;
    word-break: break-all;
}

button.copy {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12px;
}

button.copy:hover {
    background-color: var(--primary-color);
}

.visualizer {
    background-color: #f5f5f5;
    border-radius: 4px;
    padding: 15px;
}

.byte-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
}

.byte {
    aspect-ratio: 1;
    border-radius: 3px;
    background-color: #e0e0e0;
}

.info-panel {
    margin-top: 30px;
    background-color: #f8f8f8;
    border-radius: 4px;
    padding: 2px 15px;
}

summary {
    cursor: pointer;
    padding: 10px 0;
    font-weight: bold;
    color: var(--primary-color);
}

summary:hover {
    color: var(--secondary-color);
}

/* Icon Config */
.icon-config {
    margin-top: 20px;
    margin-bottom: 30px;
}

.config-panel {
    padding: 15px 0;
}

.config-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.config-group {
    margin-bottom: 15px;
}

.config-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.config-group select {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    min-width: 200px;
}

.radio-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 5px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 5px;
}

.icon-preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
    padding: 20px;
    background-color: #f5f5f5;
    border-radius: 8px;
}

#bmt-icon-preview,
#icon-preview {
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.small-button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
}

.small-button:hover {
    background-color: var(--primary-color);
}

/* Icon Generator Tab */
.icon-generator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
    max-width: 100%; /* Ensure container doesn't overflow */
}

.input-section,
.output-section {
    background-color: #f8f8f8;
    padding: 20px;
    border-radius: 8px;
    width: 100%; /* Ensure sections don't exceed their container width */
    max-width: 100%; /* Reinforce width constraint */
    overflow-x: hidden; /* Prevent horizontal scrolling within sections */
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-row {
    display: flex;
    gap: 15px;
}

.half {
    flex: 1;
}

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

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.inline-button {
    padding: 8px 12px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0; /* Prevent button from shrinking */
}

.primary-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    margin-top: 10px;
    width: 100%;
}

.primary-button:hover {
    background-color: var(--secondary-color);
}

.icon-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.control-button {
    flex: 1;
    padding: 8px 0;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.control-button:hover {
    background-color: var(--primary-color);
}

.code-output {
    background-color: #f0f0f0;
    padding: 15px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    max-height: 150px;
    overflow-y: auto;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    margin-top: 0;
    width: 100%; /* Ensure it doesn't exceed container width */
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 20px;
    width: 100%; /* Ensure grid doesn't exceed container width */
}

.example-icon {
    border: 1px solid #eee;
    border-radius: 4px;
    aspect-ratio: 1;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s;
    max-width: 100%; /* Ensure examples don't overflow their grid cells */
}

.example-icon:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
}

.example-icon svg {
    width: 100%;
    height: 100%;
}

/* Benchmark section styles */
.benchmark-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
}

.benchmark-input {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.benchmark-input label {
    font-size: 14px;
    font-weight: bold;
    color: #555;
}

.benchmark-input select,
.benchmark-input input {
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    min-width: 120px;
}

.benchmark-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: bold;
    margin-left: auto;
    min-width: 130px;
}

.benchmark-button:hover {
    background-color: var(--secondary-color);
}

.benchmark-button:disabled {
    background-color: #999;
    cursor: wait;
}

.benchmark-results {
    background-color: #f8f8f8;
    padding: 20px;
    border-radius: 4px;
    min-height: 120px;
}

#result-placeholder {
    color: #777;
    text-align: center;
    padding: 20px 0;
}

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

.benchmark-result-item {
    padding: 10px;
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

footer {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 14px;
}

.error {
    color: #d32f2f;
    text-align: center;
    padding: 30px;
}

/* Responsive styling */
@media (max-width: 768px) {
    main {
        padding: 15px;
    }

    .results {
        grid-template-columns: 1fr;
    }

    .stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .config-row {
        flex-direction: column;
        gap: 10px;
    }

    .benchmark-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .benchmark-button {
        margin: 10px 0 0 0;
        width: 100%;
    }

    .icon-generator-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .examples-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .input-with-button {
        flex-direction: column;
        gap: 5px;
    }

    .inline-button {
        width: 100%;
    }
}
pre#svg-output {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: normal;
    word-wrap: break-word;
}
.benchmark-warning {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 10px 15px;
    margin-bottom: 20px;
    color: #664d03;
    font-size: 14px;
    border-radius: 4px;
}
/* Chunk Creator Tab Styles */
.mode-selector {
    display: flex;
    margin-bottom: 20px;
    background-color: #f5f5f5;
    border-radius: 4px;
    overflow: hidden;
}

.mode-button {
    flex: 1;
    padding: 10px 0;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: bold;
    color: #666;
    transition: all 0.2s ease;
}

.mode-button:hover {
    background-color: #eaeaea;
    color: var(--primary-color);
}

.mode-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: #eaeaea;
}

.chunk-type-selector {
    display: flex;
    margin-bottom: 20px;
    gap: 20px;
}

.chunk-form {
    background-color: #f8f8f8;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.input-type-toggle {
    display: flex;
    margin-bottom: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    width: fit-content;
}

.toggle-option {
    padding: 4px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.toggle-option.active {
    background-color: var(--primary-color);
    color: white;
}

.input-info {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
    display: flex;
    justify-content: space-between;
}

.warning {
    color: #d32f2f;
}

.readonly-value {
    background-color: #f0f0f0;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: monospace;
    word-break: break-all;
    margin-top: 5px;
    position: relative;
}

.copy-enabled {
    cursor: pointer;
    padding-right: 30px;
}

.copy-enabled::after {
    content: "📋";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.copy-enabled:hover::after {
    opacity: 1;
}

.result-container {
    background-color: #f8f8f8;
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
}

.output-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
    margin: 20px 0;
}

.output-cell {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.result-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-field label {
    font-weight: bold;
    color: #555;
    margin-bottom: 3px;
    display: block;
}

.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.action-button {
    padding: 8px 15px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.action-button:hover {
    background-color: var(--primary-color);
}

.serialized-data {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.serialized-data pre {
    background-color: #f0f0f0;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
    font-family: monospace;
    font-size: 14px;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
}

.analysis-status {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.analysis-status.valid {
    background-color: #e8f5e9;
    border-left: 4px solid #4caf50;
}

.analysis-status.invalid {
    background-color: #ffebee;
    border-left: 4px solid #f44336;
}

.error-message {
    color: #d32f2f;
    margin-top: 10px;
    font-family: monospace;
    padding: 8px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}

.info-content {
    padding: 10px 0;
}

.info-content h4 {
    margin-top: 15px;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.info-content pre {
    background-color: #f0f0f0;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
    font-family: monospace;
    margin: 10px 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .output-grid {
        grid-template-columns: 1fr;
    }

    .result-actions {
        flex-direction: column;
    }

    .action-button {
        width: 100%;
    }
}

.input-type-toggle.small {
    font-size: 12px;
    margin-bottom: 4px;
}

.input-type-toggle.small .toggle-option {
    padding: 2px 8px;
}
