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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}

body {
    display: flex;
    align-items: center;
    overflow-y: hidden; 
    justify-content: center;
    min-height: 100vh;
    background: rgb(2, 0, 36);
    background: linear-gradient(
        90deg,
        rgba(2, 0, 36, 1) 0%,
        rgba(9, 9, 121, 1) 35%,
        rgba(0, 212, 255, 1) 100%
    );
}

.container {
    display: flex;
    width: 100%;
    gap: 10px;
    padding: 100px;
    min-width: 1050px;
}

section {
    background: #fff;
}

.tools-board {
    width: 210px;
    padding: 15px 22px 0;
}

.tools-board .row {
    margin-bottom: 10px;
}

.row-options {
    list-style: none;
    margin: 10px 0 0 5px;
}

.row .options .option {
    display: flex;
    cursor: pointer;
    align-items: center;
    margin-bottom: 10px;
}

.option:is(:hover, .active) img {
    filter: invert(17%) sepia(90%) saturate(3000%) hue-rotate(900deg) brightness(100%) contrast(100%);
}

.option :where(span, label) {
    color: #5a6168;
    cursor: pointer;
    padding-left: 10px;
}

.option:is(:hover, .active) :where(span, label) {
    color: #4a97f7;
}

.option #fill-color {
    cursor: pointer;
    height: 14px;
    width: 14px;
}

.colors .options {
   display: flex;
   justify-content: space-between;
}

.colors .option {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    margin-top: 3px;
    position: relative;
}

.colors .option:nth-child(1) {
    background-color: #fff;
    border : 1px solid #cfcfcf
}
.colors .option:nth-child(2) {
    background-color: #000;
}
.colors .option:nth-child(3) {
    background-color: #e02020;
}
.colors .option:nth-child(4) {
    background-color: #6dd400;
}
.colors .option:nth-child(5) {
    background-color: #4a97f7;
}

.colors .option.selected::before {
    position: absolute;
    content: '';
    top: 50%;
    left: 50%;
    height: 12px;
    width: 12px;
    background: inherit;
    border-radius: inherit;
    border: 2px solid #fff;
    transform: translate(-48%, -50%);
}

.colors .option:first-child.selectede::before {
    background-color: #ccc;
}

.option #color-picker {
    opacity: 0;
    cursor: pointer;
}

.buttons button {
    width: 100%;
    color: #fff;
    border: none;
    outline: none;
    padding: 11px 0;
    font-size: 0.9rem;
    margin-bottom: 13px;
    background: none;
    border-radius: 4px;
    cursor: pointer;
}

.buttons .clear-canvas {
    color: #6c757d;
    border: 1px solid #6c757d;
    transition: all 0.3s ease;
}
.buttons .clear-canvas:hover {
    color: #fff;
    background:#6c757d;
    transition: all 0.3s ease;
}

.buttons .save-img {
    background:#4a97f7;
    border: 1px solid #4a97f7;
}

.drawing-board {
    flex: 1;
    overflow: hidden;
}

.drawing-board canvas {
    width: 100%;
    height: 100%;
}

/* Mavjud kod o'zgartirilmaydi, responsivlik uchun qo'shimchalar */

@media (max-width: 1200px) {
    .container {
        padding: 80px;
        min-width: 900px;
    }

    .tools-board {
        width: 180px;
    }

    .buttons button {
        font-size: 0.85rem;
    }
}

@media (max-width: 992px) {
    .container {
        flex-direction: column;
        align-items: center;
        min-width: auto;
        padding: 50px;
    }

    .tools-board {
        width: 100%;
        margin-bottom: 20px;
    }

    .drawing-board {
        width: 100%;
    }
}

@media (max-width: 768px) {
    body {
        overflow-y: auto;
    }

    .drawing-board canvas {
    width: 100%;
    height: 500px;
}

    .container {
        padding: 30px;
    }

    .tools-board  {
        padding: 10px 15px;
    }


    .buttons button {
        font-size: 0.8rem;
        padding: 10px 0;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 20px;
    }

    .tools-board {
        padding: 10px;
    }

    .buttons button {
        font-size: 0.75rem;
        padding: 8px 0;
    }

    .colors .option {
        height: 18px;
        width: 18px;
    }

    .colors .option.selected::before {
        height: 10px;
        width: 10px;
    }
}
