* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f0f0f0;
    color: #333;
    line-height: 1.6;
}

.container {
    width: 80%;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 2.5rem;
}

h2 {
    color: #3498db;
    margin-bottom: 20px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.input-section, .output-section {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.input-methods {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.username-input {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
}

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

input[type="text"] {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    flex: 1;
    font-size: 1rem;
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

.skin-preview {
    text-align: center;
    margin-top: 30px;
}

#skin-container {
    width: 300px;
    height: 400px;
    margin: 0 auto;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

#skin-render-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.blueprint-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 30px;
}

.body-part-section {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background-color: #f9f9f9;
    margin-bottom: 20px;
}

.body-part-section h3 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #333;
}

.views-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 15px;
}

.view {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
    height: 250px;
    display: flex;
    flex-direction: column;
}

.body-part-section:nth-child(1) .view { /* Body */
    height: 400px;
}

/* Make arms, body, and legs containers taller than head */
.body-part-section:nth-child(2) .view { /* Body */
    height: 450px;
}

.body-part-section:nth-child(3) .view { /* Arms */
    height: 450px;
}

.body-part-section:nth-child(4) .view { /* Legs */
    height: 450px;
}

.view h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #555;
    font-size: 14px;
}

.blueprint-view {
    border: 1px solid #ddd;
    background-color: white;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    min-height: 0;
}

/* Style for overlay blocks */
.overlay-block {
    z-index: 2;
    position: relative;
}

.blueprint-grid {
    display: grid;
    gap: 2px;
    width: fit-content;
    margin: 0 auto;
    transform-origin: center;
}

.block {
    width: 28px;
    height: 28px;
    background-size: cover;
    background-position: center;
    position: relative;
    z-index: 1; /* Base z-index for all blocks */
    box-shadow: 0 0 1px rgba(0,0,0,0.2);
}

.block:hover::after {
    content: attr(data-block-name);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10;
}

.materials-list {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

#materials-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.material-item {
    display: flex;
    align-items: center;
    background-color: white;
    border-radius: 4px;
    padding: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.material-item img {
    width: 32px;
    height: 32px;
    margin-right: 10px;
}

.material-count {
    font-weight: bold;
}

#download-blueprint {
    display: block;
    margin: 0 auto;
    padding: 12px 25px;
    font-size: 1.1rem;
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
