/* ===== تم سفید و صورتی ملایم با فونت وزیرمتن ===== */
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

* {
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #fdf6f0;
    background: linear-gradient(145deg, #fff5f5 0%, #ffe8e8 100%);
    color: #3d2c2c;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    width: 100;
    padding: 20px;
    direction: rtl;
}

.container {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 32px;
    padding: 40px;
    max-width: 700px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(255, 150, 180, 0.15), 0 8px 20px rgba(255, 150, 180, 0.08);
    border: 1px solid rgba(255, 220, 230, 0.5);
}

h1 {
    text-align: center;
    font-weight: 300;
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    color: #4a2c3a;
    letter-spacing: -0.5px;
}

h1::after {
    content: "🌸";
    font-size: 1.8rem;
    margin-right: 8px;
}

p {
    text-align: center;
    color: #6b4b5a;
    opacity: 0.85;
    margin-bottom: 2rem;
    font-weight: 300;
}

.form-group {
    margin-bottom: 1.8rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #5a3d4a;
}

input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border-radius: 16px;
    border: 1.5px solid #f5d0d8;
    background: #fffafc;
    color: #3d2c2c;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
    font-family: 'Vazirmatn', sans-serif;
}

input[type="text"]:focus {
    outline: none;
    border-color: #f2a0b0;
    box-shadow: 0 0 0 4px rgba(242, 160, 176, 0.2);
}

input[type="text"]::placeholder {
    color: #ccb0b8;
}

/* ===== دکمه‌ها ===== */
button {
    padding: 6px 14px;
    border: none;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    background: #fce4ec;
    color: #5a3d4a;
    box-shadow: 0 2px 8px rgba(255, 180, 200, 0.2);
    font-family: 'Vazirmatn', sans-serif;
    white-space: nowrap;
}

button:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(255, 150, 180, 0.3);
}

button:active {
    transform: scale(0.96);
}

#generateBtn {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    border-radius: 30px;
    background: linear-gradient(145deg, #f8d0da, #f0b0c4);
    color: #4a2c3a;
    box-shadow: 0 6px 25px rgba(240, 160, 180, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-family: 'Vazirmatn', sans-serif;
}

#generateBtn:hover {
    background: linear-gradient(145deg, #fadce4, #f4b8cc);
    transform: scale(1.02);
    box-shadow: 0 10px 35px rgba(240, 160, 180, 0.4);
}

/* ===== نوار ابزار Canvas ===== */
.canvas-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    align-items: center;
    justify-content: flex-start;
    background: rgba(255, 245, 248, 0.6);
    padding: 12px 16px;
    border-radius: 40px;
    border: 1px solid #f5dce4;
    margin-bottom: 12px;
}

.canvas-toolbar button,
.canvas-toolbar input[type="color"] {
    padding: 6px 14px;
    border-radius: 30px;
    border: 1px solid #f5d0d8;
    background: #fff8fa;
    color: #5a3d4a;
    cursor: pointer;
    font-size: 0.82rem;
    transition: all 0.3s;
    min-height: 36px;
    box-shadow: 0 1px 4px rgba(255, 180, 200, 0.1);
    font-family: 'Vazirmatn', sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.canvas-toolbar button:hover {
    background: #fce4ec;
    border-color: #f2a0b0;
}

.canvas-toolbar button.active-tool {
    background: #f8d0da;
    border-color: #f2a0b0;
    box-shadow: 0 2px 10px rgba(242, 160, 176, 0.3);
    color: #3d2c2c;
}

.canvas-toolbar label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #5a3d4a;
    font-size: 0.82rem;
    font-family: 'Vazirmatn', sans-serif;
}

.canvas-toolbar input[type="range"] {
    width: 70px;
    background: #f5dce4;
    height: 4px;
    border-radius: 4px;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}

.canvas-toolbar input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #f2a0b0;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(242, 160, 176, 0.3);
}

#sizeDisplay {
    min-width: 22px;
    display: inline-block;
    text-align: center;
    color: #5a3d4a;
    font-weight: 600;
}

/* ===== Canvas ===== */
#sketchCanvas {
    width: 100%;
    max-width: 512px;
    height: auto;
    border-radius: 20px;
    border: 2px solid #f5dce4;
    background: #ffffff;
    cursor: crosshair;
    display: block;
    margin: 0 auto;
    touch-action: none;
    box-shadow: 0 8px 30px rgba(255, 180, 200, 0.12);
}

/* ===== وضعیت بارگذاری ===== */
#loading {
    text-align: center;
    padding: 20px;
    font-size: 1.2rem;
    color: #d48a9e;
    background: rgba(255, 240, 245, 0.5);
    border-radius: 30px;
    margin-top: 20px;
    font-family: 'Vazirmatn', sans-serif;
}

/* ===== نتیجه ===== */
#resultContainer {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

#resultContainer img {
    max-width: 100%;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(255, 150, 180, 0.2);
    border: 2px solid #f5dce4;
}

/* ===== پیام خطا ===== */
#resultContainer p {
    color: #d45a6a;
    background: #fff0f2;
    padding: 12px 24px;
    border-radius: 30px;
    border: 1px solid #f5c8d0;
    font-family: 'Vazirmatn', sans-serif;
}

#undoBtn {
    background: #fff0f5;
}
#undoBtn:hover {
    background: #fce4ec;
}