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

html,
body {
    width: 100%;
    height: 100%;
    font-family: "Geist", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-size: small;
    font-style: normal;
    scroll-behavior: smooth;
    background: #f5f5f5;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

hr {
    height: 1px;
    background-color: #ddd;
    border: none;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    font-size: small;
    font-weight: 600;
    color: #333;
}

main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 320px;
    background: white;
    padding: 0.8rem;
    overflow-y: auto;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.content-area {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.preview-section {
    background: white;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 0.4rem;
}

.section-title {
    font-size: small;
    font-weight: 600;
    color: #333;
    text-align: center;
}

.image-type {
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
}

.image-rendered-name {
    font-size: small;
    color: #999;
    word-break: break-all;
}

.image-preview-container {
    width: 100%;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.image-preview {
    width: 100%;
    height: 100%;
    border: 1px solid #ddd;
    border-radius: 0.4rem;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-name-container {
    display: flex;
    flex-direction: column;
}

.upload-button {
    width: 50%;
    padding: 0.8rem;
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 0.4rem;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.upload-button:hover {
    background: #f5f5f5;
    border-color: #333;
}

input[type="file"] {
    display: none;
}

.upload-container {
    display: flex;
    align-items: center;
    justify-content: start;
    gap: 1rem;
}

.slider-group {
    margin-bottom: 0.8rem;
}

.slider-label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: inherit;
    color: #333;
}

.input-range-wrapper {
    display: flex;
    align-items: center;
}

.range-slider {
    flex: 1;
    height: 6px;
    border-radius: 0.4rem;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.range-slider::-webkit-slider-thumb:hover {
    background: #000;
}

.range-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: 1px solid #000;
    transition: all 0.2s ease;
}

.range-slider::-moz-range-thumb:hover {
    background: #000;
}

.slider-value {
    min-width: 60px;
    text-align: right;
    font-weight: 400;
    color: #333;
}

.button {
    width: 100%;
    padding: 0.8rem;
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 0.4rem;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.button:hover {
    background: #f5f5f5;
    border-color: #333;
}

.preview-card {
    background: white;
    border-radius: 0.4rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.image-rendered {
    width: 100%;
    max-width: 300px;
    height: 100%;
    height: auto;
    border-radius: 0.4rem;
    border: 1px solid #ddd;
    background: #fafafa;
}

.ascii-art-container {
    background: #fafafa;
    border-radius: 0.4rem;
    padding: 1rem;
    margin: 1rem;
    max-height: 620px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    text-align: center;
}

.ascii-art {
    font-size: 6px;
    font-family: monospace;
    line-height: 0.75;
    letter-spacing: 0;
    white-space: pre;
    color: #333;
    margin: 0;
    padding: 0;
    height: 600px;
    max-height: 100%;
    max-width: 100%;
    overflow: auto;
    display: inline-block;
     text-align: left;
}

.ascii-button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.ascii-art-canvas {
    display: none;
}

.footer {
    height: 100%;
    background: white;
    display: flex;
    align-items: end;
    text-align: start;
    color: #666;
    font-size: smaller;
}

@media screen and (max-width: 768px) {
    main {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        max-height: 220px;
    }

    .image-preview {
        max-width: 120px;
    }

    .content-area {
        padding: 1rem;
    }
}