@import url("https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css");

* {
    font-family: 'Vazirmatn', sans-serif;
    box-sizing: border-box;
}

body {
    margin: 0;
    background: linear-gradient(135deg, #2a0845, #6441a5);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    color: white;
}

.container {
    text-align: center;
    width: 100%;
    max-width: 900px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

h1 {
    font-size: 2.5rem;
    margin: 0;
}

canvas {
    border: 3px dashed white;
    background-color: #fff;
    border-radius: 16px;
    width: 100%;
    height: 500px;
    touch-action: none;
    max-height: 70vh;
}

/* ساختار ابزارها */

.tools {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

/* هر ردیف ابزار در یک خط */

.tools-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* دکمه‌ها در یک خط و وسط چین */

.buttons-row {
    justify-content: center;
}

label,
button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
    user-select: none;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

label:hover,
button:hover {
    background: rgba(255, 255, 255, 0.25);
}

input[type="color"],
input[type="range"],
select {
    margin-right: 0.5rem;
    cursor: pointer;
    vertical-align: middle;
    font-size: 1rem;
    height: 2rem;
}

/* استایل مدرن برای select */

.custom-select {
    appearance: none;
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    padding: 0.4rem 2rem 0.4rem 0.8rem;
    border-radius: 8px;
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg fill="white" height="20" width="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: left 0.4rem center;
    background-size: 1rem;
    direction: rtl;
}

.custom-select:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.25);
}

.custom-select-wrapper {
    position: relative;
    font-size: 1.1rem;
}

select option {
    background-color: #3e2c63;
    color: white;
    padding: 0.4rem 0.8rem;
    font-size: 1rem;
}

/* کلاس برای مخفی کردن عناصر */

.hidden {
    display: none !important;
}

/* ریسپانسیو */

@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }

    canvas {
        height: 300px;
    }

    label,
    button {
        font-size: 1rem;
        padding: 0.4rem 1rem;
    }

    .tools-row {
        flex-direction: column;
        align-items: stretch;
    }
}