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

body {
    font-family: Arial, sans-serif;
    background-color: #121212;
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 20px;
}

.container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1200px;
    height: 100%;
    background-color: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
}

.sidebar {
    width: 100%;
    padding: 20px;
    background-color: #2c2c2c;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.preview {
    flex: 1;
    background: repeating-linear-gradient(
        45deg,
        #2c2c2c,
        #2c2c2c 10px,
        #3c3c3c 10px,
        #3c3c3c 20px
    );
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.preview canvas {
    max-width: 100%;
    max-height: 100%;
}

.option {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.option label {
    font-size: 14px;
}

.option input,
.option select,
.option button,
#generate {
    padding: 10px;
    border: none;
    border-radius: 4px;
    background-color: #3c3c3c;
    color: #ffffff;
}

.option input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #3c3c3c;
    outline: none;
    transition: background 0.3s;
}

.option input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4caf50;
    cursor: pointer;
    transition: background 0.3s;
}

.canvas-highlight{
    border:1px solid black;
    background-image:url('https://img.freepik.com/premium-vector/transparent-illustrator-background-transparent-grid_210915-135.jpg?semt=ais_hybrid');
    background-repeat: repeat;
    background-position: top left;
    background-size: 20%;
}

.option input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 100%;
    height: 40px;
    border-radius: 4px;
    background-color: #3c3c3c;
    cursor: pointer;
    transition: background-color 0.3s;
}

.option input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.option input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.option input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4caf50;
    cursor: pointer;
    transition: background 0.3s;
}

.option button,
#generate {
    cursor: pointer;
    background-color: #4fc3f7; /* Change background color to light blue */
    border: none;
    border-radius: 4px;
    padding: 10px;
    color: #121212; /* Change text color to dark */
    transition: background-color 0.3s;
}

.option button:disabled,
#generate:disabled {
    background-color: #9e9e9e;
    cursor: not-allowed;
}

.option button:hover:enabled,
#generate:hover:enabled {
    background-color: #29b6f6; /* Change hover background color to light blue */
}

.upload-area {
    width: calc(100% - 40px); /* Add spacing */
    height: 200px;
    border: 2px dashed #4fc3f7; /* Change border color to light blue */
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
    position: relative;
    overflow: hidden;
    margin: 0 20px; /* Add spacing */
}

.upload-area:hover {
    background-color: #2c2c2c;
    border-color: #29b6f6; /* Change hover border color to light blue */
}

.upload-area span {
    font-size: 18px;
    color: #4fc3f7; /* Change text color to light blue */
    transition: color 0.3s;
}

.upload-area:hover span {
    color: #29b6f6; /* Change hover text color to light blue */
}

.upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-area.hidden {
    display: none;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    border-bottom: 2px solid #3c3c3c;
}

.tab {
    padding: 10px 20px;
    background-color: #2c2c2c;
    border: 1px solid #3c3c3c;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
}

.tab.active {
    background-color: #4fc3f7; /* Change active tab background color to light blue */
    border-color: #4fc3f7; /* Change active tab border color to light blue */
    color: #121212; /* Change active tab text color to dark */
}

.tab-content {
    display: none;
    margin-top: 0;
    padding: 20px;
    border: 1px solid #3c3c3c;
    border-radius: 0 0 4px 4px;
    background-color: #2c2c2c;
}

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

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #3c3c3c;
    transition: 0.4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background-color: #4caf50;
    transition: 0.4s;
    left: 2px;
    bottom: 2px;
}

input:checked + .slider {
    background-color: #4caf50;
}

input:checked + .slider:before {
    transform: translateX(26px);
    background-color: #ffffff;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slider-container input[type="number"] {
    width: 80px; /* Increased width */
    padding: 5px;
    border: none;
    border-radius: 4px;
    background-color: #3c3c3c;
    color: #ffffff;
}

.reset-button {
    display: none;
    padding: 10px;
    border: none;
    border-radius: 4px;
    background-color: #f44336;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.3s;
}

.reset-button:hover {
    background-color: #d32f2f;
}

.ads {
    width: 100%;
    height: 100px;
    background-color: #2c2c2c;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    border-radius: 8px;
}

.ads span {
    color: #4caf50;
    font-size: 18px;
}

.warning-message {
    color: #ff5722;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
}

.snap-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.snap-grid button {
    padding: 10px;
    border: none;
    border-radius: 4px;
    background-color: #3c3c3c;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.3s;
    position: relative;
}

.snap-grid button:hover {
    background-color: #4fc3f7; /* Change hover background color to light blue */
    color: #121212; /* Change hover text color to dark */
}

snap-grid button[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 5px;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 12px;
    z-index: 10;
}

@media (min-width: 768px) {
    .container {
        flex-direction: row;
    }

    .sidebar {
        width: 30%;
    }

    .preview {
        width: 70%;
    }
}

@media (max-width: 767px) {
    .container {
        flex-direction: column-reverse;
    }

    .tabs {
        overflow-x: auto;
        white-space: nowrap;
    }

    .tab {
        display: inline-block;
    }
}
