/* Tool: gradient */
:where(body[data-tool="gradient"]) .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}
:where(body[data-tool="gradient"]) .main-content {
    display: grid;
    grid-template-columns: 1fr 520px;
    gap: 30px;
    margin-bottom: 30px;
}
:where(body[data-tool="gradient"]) .preview-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 35px;
    display: flex;
    flex-direction: column;
    justify-content: end;
}
:where(body[data-tool="gradient"]) .ps-slider-wrapper {
    margin-bottom: 30px;
    margin-top: 20px;
    padding-bottom: 25px;
    direction: ltr;
}
:where(body[data-tool="gradient"]) .ps-slider-bar {
    height: 24px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    position: relative;
    cursor: copy;
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAADFJREFUOE9jZGBgEGHAAyAKMBJQAwYGBgYGDA1gGqmgZgAA//8AALi1P6HqH5hQ8wAA3A0RERERHygAAAAASUVORK5CYII=');
}
:where(body[data-tool="gradient"]) .ps-slider-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 4px;
    pointer-events: none;
}
:where(body[data-tool="gradient"]) .ps-thumb {
    position: absolute;
    top: 26px;
    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;
}
:where(body[data-tool="gradient"]) .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;
}
:where(body[data-tool="gradient"]) .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;
    z-index: 1;
}
:where(body[data-tool="gradient"]) .ps-thumb.active {
    border-color: white;
    z-index: 3;
    box-shadow: 0 0 0 2px var(--primary);
}
:where(body[data-tool="gradient"]) .ps-thumb.active::before {
    border-bottom-color: white;
}
:where(body[data-tool="gradient"]) .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;
}
:where(body[data-tool="gradient"]) .action-point-color {
    display: flex;
    align-items: center;
    margin-top: 10px;
    justify-content: space-between;
}
:where(body[data-tool="gradient"]) .ps-thumb.active .ps-popover {
    display: block;
}
:where(body[data-tool="gradient"]) .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);
}
:where(body[data-tool="gradient"]) .popover-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
:where(body[data-tool="gradient"]) .popover-row:last-child {
    margin-bottom: 0;
}
:where(body[data-tool="gradient"]) .gradient-preview {
    width: 100%;
    height: 350px;
    border-radius: var(--radius-lg);
    margin-bottom: 25px;
}
:where(body[data-tool="gradient"]) .preview-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}
:where(body[data-tool="gradient"]) .controls-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 40px;
    max-height: 700px;
    overflow-y: auto;
}
:where(body[data-tool="gradient"]) .control-group {
    margin-bottom: 30px;
}
:where(body[data-tool="gradient"]) .group-title {
    font-size: 18px;
    color: white;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}
:where(body[data-tool="gradient"]) .field {
    margin-bottom: 20px;
}
:where(body[data-tool="gradient"]) .field-label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
:where(body[data-tool="gradient"]) select {
    width: 100%;
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 14px 16px;
    color: var(--text-primary);
    border: none;
    cursor: pointer;
    appearance: none;
}
:where(body[data-tool="gradient"]) .slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}
:where(body[data-tool="gradient"]) .slider {
    flex: 1;
    height: 8px;
    background: #3d3d3d;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
}
:where(body[data-tool="gradient"]) .slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-light);
    cursor: pointer;
}
:where(body[data-tool="gradient"]) .value-display {
    min-width: 60px;
    text-align: center;
    font-size: 14px;
    background: var(--bg-tertiary);
    padding: 10px;
    border-radius: 8px;
    direction: ltr;
}
:where(body[data-tool="gradient"]) .color-stops-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
:where(body[data-tool="gradient"]) .color-stop-item {
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid transparent;
    transition: 0.2s;
}
:where(body[data-tool="gradient"]) .color-stop-item.highlight {
    border-color: var(--primary);
}
:where(body[data-tool="gradient"]) .color-stop-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}
:where(body[data-tool="gradient"]) .color-picker {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}
:where(body[data-tool="gradient"]) .color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}
:where(body[data-tool="gradient"]) .color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 8px;
}
:where(body[data-tool="gradient"]) .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;
}
:where(body[data-tool="gradient"]) .btn-remove {
    background: #ff4d4d;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}
:where(body[data-tool="gradient"]) .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%;
}
:where(body[data-tool="gradient"]) .btn-secondary {
    background: var(--bg-tertiary);
}
:where(body[data-tool="gradient"]) .code-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 30px;
}
:where(body[data-tool="gradient"]) .code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
:where(body[data-tool="gradient"]) .btn-copy {
    background: var(--primary);
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    color: white;
    cursor: pointer;
}
:where(body[data-tool="gradient"]) .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;
}
:where(body[data-tool="gradient"]) ::selection {
    background: var(--primary);
    color: #fff;
}
@media (max-width: 1024px) {:where(body[data-tool="gradient"]) .main-content {
        grid-template-columns: 1fr;
    }
:where(body[data-tool="gradient"]) .controls-section {
        max-height: none;
    }
:where(body[data-tool="gradient"]) .preview-actions {
        grid-template-columns: 1fr 1fr;
    }

}
@media (max-width: 768px) {:where(body[data-tool="gradient"]) .container {
        padding: 15px;
    }
:where(body[data-tool="gradient"]) .preview-section {
        padding: 20px;
    }
:where(body[data-tool="gradient"]) .controls-section {
        padding: 20px;
    }
:where(body[data-tool="gradient"]) .gradient-preview {
        height: 200px;
    }
:where(body[data-tool="gradient"]) .preview-actions {
        grid-template-columns: 1fr;
    }
:where(body[data-tool="gradient"]) .code-section {
        padding: 15px;
    }

}
