@import url('../assets/font.css');


        :root {
            --primary: #4849E8;
            --primary-light: #6869FF;
    --bg-secondary: #141414;
    --bg-tertiary: #181818;
            --text-primary: #e9ecef;
            --bg-primary: #121212;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: YekanBakh, Tahoma, sans-serif;
        }

        body {
            color: var(--text-primary);
            height: 100vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            font-weight:300;
            line-height: 1.6;
            background-color: #0a0a0a;
            background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
            background-size: 15px 15px;
            direction: rtl;
        }

                header {
    background: var(--bg-secondary);
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    z-index: 10;
    backdrop-filter: blur(8px);
    overflow:auto;
}

.header-content {
    display: flex;
    flex-direction: row;
    gap: 40px;
    align-items:center;
}
        
        
        .logo-section {
    display: flex;
    gap: 10px;
    align-items: center;
}

.logo-section img {
    width:50px;
}

.logo-section h1 {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu {
    display: flex;
    gap: 10px;
}

.menu a {
    text-decoration: none;
    color: white;
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
        display:flex;
    gap:5px;
}

.menu button {
    color: white;
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 10px;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    display:flex;
    gap:5px;
}

.menu button:hover , .menu a:hover {
    background:#4849e8;
}

/* Popup overlay */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
    animation: fadeIn 0.3s ease;
    z-index: 10;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Popup box */
.popup-box {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    text-align: right;
    color: var(--text-primary);
    transform: translateY(-20px);
    animation: slideDown 0.3s ease forwards;
}

.tools-link {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin:20px 0;
}

@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.popup-box a {
    padding: 8px 0;
    color: white;
    background: var(--bg-tertiary);
    text-decoration: none;
    transition: 0.2s;
    border-radius: 10px;
    padding: 10px 20px;
    display: flex;
    gap: 10px;
    flex-direction: row-reverse;
    justify-content: space-between;
}

.close-popup {
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    border: none;
    border-radius: 6px;
    background: var(--primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: 0.3s;
}
.close-popup:hover {
    background: var(--primary-light);
}

        .header-actions {
            display: flex;
            gap: 15px;
            justify-content:center;
        }

        .btn {
            background: var(--primary);
            border: none;
            border-radius: 8px;
            padding: 10px 20px;
            color: white;
            cursor: pointer;
            font-size: 15px;
            transition: 0.2s;
            display:flex;
            gap:10px;
            font-weight:300;
        }

        .btn:hover { background: var(--primary-light); }
        .btn-export { background: #28a745; }
        .btn-export:hover { background: #34ce57; }
        .btn-secondary { background: var(--bg-tertiary); }
        .btn-secondary:hover { background: #3a3a3a; }

        /* بخش اصلی پالت‌ها */
        .palette-container {
            display: flex;
            flex: 1;
            width: 100%;
            position: relative;
        }

        .color-column {
            flex: 1;
            height: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            position: relative;
            transition: flex 0.3s ease, transform 0.2s ease, opacity 0.2s ease;
            cursor: grab;
        }

        .color-column:active {
            cursor: grabbing;
        }

        /* کنترل‌های روی هر پالت */
        .color-controls {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 15px;
            opacity: 0;
            transform: translateY(20px);
            transition: all 0.3s ease;
            background: rgba(0, 0, 0, 0.4);
            padding: 15px;
            border-radius: 12px;
            backdrop-filter: blur(5px);
        }

        .color-column:hover .color-controls, .color-column.active .color-controls {
            opacity: 1;
            transform: translateY(0);
        }

        .color-hex {
            font-size: 24px;
            font-weight: bold;
            text-transform: uppercase;
            letter-spacing: 2px;
            color: white;
            text-shadow: 0 2px 4px rgba(0,0,0,0.5);
            cursor: pointer;
        }

        .control-btns {
            display: flex;
            gap: 10px;
        }

        .icon-btn {
            background: none;
            border: 1px solid white;
            color: white;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: 0.2s;
        }

        .icon-btn:hover, .icon-btn.active {
            background: white;
        }

        .icon-btn:hover path, .icon-btn.active path {
            fill: black;
        }

        input[type="file"] { display: none; }

        /* دکمه ترکیب رنگ */
        .blend-btn-container {
            position: absolute;
            top: 0;
            bottom: 0;
            width: 40px;
            transform: translateX(50%);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 5;
            cursor: pointer;
            opacity: 0;
            transition: opacity 0.2s;
        }
        .blend-btn-container:hover { opacity: 1; }
        .blend-btn {
            width: 36px;
            height: 36px;
            background: var(--bg-secondary);
            color: white;
            border-radius: 50%;
            font-size: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 8px rgba(0,0,0,0.3);
            pointer-events: none;
        }

        .toast {
            position: fixed;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: var(--bg-tertiary);
            color: white;
            padding: 10px 20px;
            border-radius: 8px;
            opacity: 0;
            pointer-events: none;
            transition: 0.3s;
            z-index: 100;
        }
        .toast.show { opacity: 1; }

        /* --- استایل‌های کالر پیکر اختصاصی --- */
        .custom-color-picker {
            position: absolute;
            background: var(--bg-secondary);
            padding: 15px;
            border-radius: 12px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.5);
            width: 250px;
            z-index: 50;
            display: none;
            flex-direction: column;
            gap: 15px;
            border: 1px solid #333;
            transform: translateX(-50%); /* وسط چین کردن نسبت به نقطه کلیک */
        }

        .custom-color-picker.show {
            display: flex;
        }

        /* ناحیه انتخاب Saturation و Value */
        .cp-sv-area {
            width: 100%;
            height: 150px;
            position: relative;
            border-radius: 8px;
            cursor: crosshair;
            background-color: #ff0000; /* با جاوااسکریپت تغییر میکند */
            overflow: hidden;
        }
        .cp-sv-white {
            position: absolute; top: 0; left: 0; right: 0; bottom: 0;
            background: linear-gradient(to right, #fff, rgba(255,255,255,0));
        }
        .cp-sv-black {
            position: absolute; top: 0; left: 0; right: 0; bottom: 0;
            background: linear-gradient(to top, #000, rgba(0,0,0,0));
        }
        .cp-sv-cursor {
            position: absolute;
            width: 14px;
            height: 14px;
            border: 2px solid white;
            border-radius: 50%;
            transform: translate(-50%, -50%);
            box-shadow: 0 0 4px rgba(0,0,0,0.5);
            pointer-events: none;
        }

        /* نوار انتخاب Hue */
        .cp-hue-slider {
            width: 100%;
            height: 16px;
            position: relative;
            border-radius: 8px;
            cursor: pointer;
            background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
        }
        .cp-hue-cursor {
            position: absolute;
            width: 16px;
            height: 20px;
            background: white;
            border-radius: 4px;
            transform: translate(-50%, -2px);
            box-shadow: 0 2px 4px rgba(0,0,0,0.5);
            pointer-events: none;
        }

        /* ورودی دستی کد رنگ */
        .cp-hex-input-group {
            display: flex;
            align-items: center;
            background: var(--bg-tertiary);
            border-radius: 6px;
            padding: 5px 10px;
            border: 1px solid #444;
        }
        .cp-hex-input-group span {
            color: #888;
            margin-left: 5px;
        }
        .cp-hex-input-group input {
            background: transparent;
            border: none;
            color: white;
            font-size: 16px;
            width: 100%;
            outline: none;
            text-transform: uppercase;
            font-family: monospace;
        }
        
        /* Header Styles */
        header {
            background: var(--bg-secondary);
            padding: 10px 24px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            z-index: 10;
            backdrop-filter: blur(8px);
            overflow: auto;
            border-bottom:;
        }
        .header-content { display: flex; flex-direction: row; gap: 40px; align-items: center; }
        .logo-section { display: flex; gap: 10px; align-items: center; }
        .logo-section img { width: 50px; }
        .logo-section h1 { font-size: 14px; white-space: nowrap; }
        .menu { display: flex; gap: 10px; }
        .menu a { text-decoration: none; color: white; padding: 8px 14px; background: var(--bg-tertiary); border-radius: 10px; font-size: 14px; white-space: nowrap; }
        
        .header-actions {
    display: flex;
    gap: 15px;
    padding: 10px 20px;
}