@import url('../assets/font.css');
        /* @import url('../assets/font.css'); */

        :root {
            --primary: #4849E8;
            --primary-light: #6869FF;
            --primary-dark: #3C3DF2;
            --bg-secondary: #141414;
            --bg-tertiary: #181818;
            --text-primary: #e9ecef;
            --text-secondary: #ced4da;
            --border-color: #444;
            --radius-md: 8px;
            --radius-lg: 12px;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: YekanBakh, Tahoma, sans-serif;
            font-weight: 300;
        }

        body {
            background-color: #0a0a0a;
            background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
            background-size: 15px 15px;
            color: var(--text-primary);
            direction: rtl;
            min-height: 100vh;
        }

                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);
}

        .container { max-width: 1400px; margin: 0 auto; padding: 30px 20px; }

        .main-content {
            display: grid;
            grid-template-columns: 1fr 520px;
            gap: 30px;
            margin-bottom: 30px;
        }

        .preview-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 35px;
    display: flex;
    flex-direction: column;
    justify-content: end;
}

        /* -------------- Interactive Slider (Photoshop Style) -------------- */
        .ps-slider-wrapper {
            margin-bottom: 30px;
            margin-top: 20px;
            padding-bottom: 25px; /* Space for thumbs */
            direction: ltr; /* Force LTR for standard math calculations */
        }
        
        .ps-slider-bar {
            height: 24px;
            border-radius: 6px;
            border: 2px solid var(--border-color);
            position: relative;
            cursor: copy; /* Indicates adding a new point */
            background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAADFJREFUOE9jZGBgEGHAAyAKMBJQAwYGBgYGDA1gGqmgZgAA//8AALi1P6HqH5hQ8wAA3A0RERERHygAAAAASUVORK5CYII='); /* Chessboard pattern for transparency */
        }

        .ps-slider-bar-fill {
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            border-radius: 4px;
            pointer-events: none;
        }

        .ps-thumb {
            position: absolute;
            top: 26px; /* Below the bar */
            width: 16px;
            height: 16px;
            background: #fff;
            border: 2px solid #333;
            transform: translateX(-50%);
            cursor: ew-resize;
            box-shadow: 0 2px 5px rgba(0,0,0,0.5);
            z-index: 2;
        }
        /* Triangle top */
        .ps-thumb::before {
            content: '';
            position: absolute;
            top: -8px;
            left: 50%;
            transform: translateX(-50%);
            border-left: 8px solid transparent;
            border-right: 8px solid transparent;
            border-bottom: 8px solid #333;
        }
        .ps-thumb::after {
            content: '';
            position: absolute;
            top: -5px;
            left: 50%;
            transform: translateX(-50%);
            border-left: 6px solid transparent;
            border-right: 6px solid transparent;
            border-bottom: 6px solid inherit; /* Match thumb color */
            z-index: 1;
        }
        .ps-thumb.active { border-color: white; z-index: 3; box-shadow: 0 0 0 2px var(--primary); }
        .ps-thumb.active::before { border-bottom-color: white; }

        /* Popover for Thumb */
        .ps-popover {
            position: absolute;
            bottom: 40px;
            left: 50%;
            transform: translateX(-50%);
            background: var(--bg-tertiary);
            padding: 15px;
            border-radius: var(--radius-md);
            box-shadow: 0 10px 25px rgba(0,0,0,0.8);
            display: none;
            width: 300px;
            border: 1px solid var(--border-color);
            cursor: default;
            direction: rtl;
        }
        
        .action-point-color {
    display: flex;
    align-items: center;
    margin-top: 10px;
    justify-content: space-between;
}
        .ps-thumb.active .ps-popover { display: block; }
        .ps-popover::after {
            content: ''; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
            border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 8px solid var(--bg-tertiary);
        }
        .popover-row { display: flex; align-items: center; gap: 10px; }
        .popover-row:last-child { margin-bottom: 0; }
        
        /* ----------------------------------------------------------------- */

        .gradient-preview { width: 100%; height: 350px; border-radius: var(--radius-lg); margin-bottom: 25px; }
        .preview-actions { display: flex; gap: 12px; justify-content: center; }

        .controls-section { background: var(--bg-secondary); border-radius: var(--radius-lg); padding: 40px; max-height: 700px; overflow-y: auto; }
        .control-group { margin-bottom: 30px; }
        .group-title { font-size: 18px; color: var(--primary-light); margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid var(--border-color); }
        
        .field { margin-bottom: 20px; }
        .field-label { display: block; font-size: 14px; color: var(--text-secondary); margin-bottom: 10px; }
        
        select {
            width: 100%; background: var(--bg-tertiary); border-radius: 8px; padding: 14px 16px;
            color: var(--text-primary); border: none; cursor: pointer; appearance: none;
        }

        .slider-container { display: flex; align-items: center; gap: 15px; }
        .slider { flex: 1; height: 8px; background: #3d3d3d; border-radius: 4px; outline: none; -webkit-appearance: none; }
        .slider::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--primary-light); cursor: pointer; }

        .value-display { min-width: 60px; text-align: center; font-size: 14px; background: var(--bg-tertiary); padding: 10px; border-radius: 8px; direction: ltr; }

        .color-stops-list { display: flex; flex-direction: column; gap: 15px; }
        .color-stop-item { background: var(--bg-tertiary); border-radius: 10px; padding: 15px; border: 1px solid transparent; transition: 0.2s;}
        .color-stop-item.highlight { border-color: var(--primary); }
        .color-stop-header { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; }

        .color-picker { width: 45px; height: 45px; border-radius: 8px; cursor: pointer; background: none; border: none; padding: 0; }
        .color-picker::-webkit-color-swatch-wrapper { padding: 0; }
        .color-picker::-webkit-color-swatch { border: none; border-radius: 8px; }
        
        .color-text-input { flex: 1; background: var(--bg-secondary); border-radius: 8px; padding: 12px; color: var(--text-primary); direction: ltr; text-align: left; border: none; }
        
        .btn-remove { background: #ff4d4d; color: white; border: none; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; }
        
        .btn { display:flex; gap:5px; align-items:center;justify-content:center; background: var(--primary); border: none; border-radius: 8px; padding: 14px 28px; color: white; cursor: pointer; width: 100%; }
        .btn-secondary { background: var(--bg-tertiary); }

        .code-section { background: var(--bg-secondary); border-radius: var(--radius-lg); padding: 30px; }
        .code-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
        .btn-copy { background: var(--primary); border: none; border-radius: 8px; padding: 10px 24px; color: white; cursor: pointer; }
        .code-box { background: var(--bg-tertiary); padding: 24px; border-radius: var(--radius-md); font-family: monospace; line-height: 1.8; overflow-x: auto; color: #a8dadc; direction: ltr; text-align: left; }

        ::-webkit-scrollbar { width: 8px; height: 8px; }
        ::-webkit-scrollbar-track { background: #141414; }
        ::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 10px; }
        
        .preview-actions { 
    display: grid; 
    grid-template-columns: 1fr 1fr 1fr; 
    gap: 12px; 
}
