@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #1a1b1e; 
    color: #e0e0e0;
    margin: 0;
    padding: 30px 20px;
    display: grid;
    place-items: center;
    min-height: 100vh;
}

h1 {
    color: #ffffff;
    font-weight: 700;
    text-align: center;
    margin-bottom: 30px;
    letter-spacing: -0.5px;
}

.container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 50px;
    background-color: #2c2f33;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid #3a3f44; 
    max-width: 900px;
    width: 100%;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.controls label {
    font-weight: 600;
    font-size: 14px;
    color: #b0b8c4;
    margin-bottom: -10px;
}


input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #1a1b1e;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #007aff;
    border-radius: 50%;
    border: 2px solid #2c2f33; 
    box-shadow: 0 2px 4px rgba(0, 122, 255, 0.3);
    cursor: grab;
    margin-top: -6px;
    transition: transform 0.2s ease;
}
input[type="range"]:active::-webkit-slider-thumb {
    transform: scale(1.15);
    cursor: grabbing;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #007aff;
    border-radius: 50%;
    border: 2px solid #2c2f33;
    box-shadow: 0 2px 4px rgba(0, 122, 255, 0.3);
    cursor: grab;
}
input[type="range"]:active::-moz-range-thumb {
    transform: scale(1.15);
    cursor: grabbing;
}

input[type="color"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    height: 40px;
    background-color: transparent;
    border: 1px solid #4a4f54; 
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 4px; border-radius: 6px; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 4px; }
input[type="color"]::-moz-color-swatch { border: none; border-radius: 4px; padding: 4px; }


label[for="inset-shadow"] {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    margin-top: 5px;
    font-weight: 600;
    color: #b0b8c4;
}

input[type="checkbox"]#inset-shadow {
    display: none;
}

input[type="checkbox"]#inset-shadow + ::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #5a5f64; 
    border-radius: 4px;
    transition: all 0.2s ease;
}

input[type="checkbox"]#inset-shadow:checked + ::before {
    background-color: #007aff;
    border-color: #007aff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 14px 14px;
    background-position: center;
    background-repeat: no-repeat;
}

.output {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#preview-box {
    width: 100%;
    height: 100%;
    min-height: 250px;
    flex-grow: 1;
    border-radius: 12px;
    background-color: #232528;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    border: 1px solid #3a3f44;
    transition: box-shadow 0.15s ease-out;
}

#result-code {
    width: 100%;
    font-family: 'SF Mono', 'Courier New', Courier, monospace;
    font-size: 14px;
    padding: 15px;
    border: 1px solid #3a3f44;
    border-radius: 8px;
    background-color: #1a1b1e; 
    resize: none;
    margin-top: 20px;
    color: #e0e0e0; 
    line-height: 1.5;
}
#result-code::selection {
    background: rgba(0, 122, 255, 0.2);
}

#copy-btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background-color: #007aff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.2s ease;
}

#copy-btn:hover {
    background-color: #005ec4;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
}

#copy-btn:active {
    background-color: #004a99;
    transform: translateY(1px);
}

@media (max-width: 800px) {
    .container {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 25px;
    }

    h1 {
        font-size: 28px;
    }

    #preview-box {
        height: 200px;
        flex-grow: 0;
    }
}